Reference no: EM131262089
While-End Loop (Repetition Structure)
Create your own simple program using a repetition (i.e., Loop) structure. You decide the theme. Provide an overview (i.e., Program Design) of what your repetition structure is doing. Then provide the Pseudocode of your example. Please keep the design simple for this exercise. Just a few lines of code is all that is needed for this response.
First, write using a for loop for a fixed number of loops.
Then for the same program use a While loop with a sentinel approach.
When using the While loop, you will need some logic to exit the loop and you will need a loop counter.
You could take one of your prompts from Road Trip and create a loop around it.
I don't want to see just a loop where you just print out the loop counter.
Some suggestions:
1) Prompt for mileage run daily, count the days, and calculate the ave miles per day, display total miles and ave daily miles
2) Prompt for grocery costs per week, count the weeks, calculate the ave grocery costs per week, display total grocery costs and ave grocery costs
3) Prompt for car miles driven in a month, count the months, and calculate the ave miles driven per month, display total miles and ave monthly miles driven
4) Prompt for number of movie tickets sold in a night, count the number of nights, calculate the ave tickets sold per night, display the total tickets sold and the ave tickets sold per night.
Remember--- The accumulation of total is done inside the loop. To calculate ave you divide the accumulated total by the number of whatever you are looping. The ave is done after the end of the loop.
2: Convert Part 1 to C-code. You only need to do one of the loop types. Don't for get to indent your code. Put Part 2 - problem no. X in the Subject area and submit a .txt (or .c) file for your code.
3: Take your While-End repetition structure from Part 1 and modify it so that the While condition test uses a Boolean variable. You will need to initialize the Boolean variable prior to the loop as well as set it inside the loop so that you exit the loop appropriately.
The gap or need based on prior research
: What challenges did you encounter in creating this section? Explain. - What additional information do you need to improve this section?
|
Explain whether you agree or disagree with the research
: APA writing STYLE & Formatting REQUIRED explanation of how gender might affect two of the following: friendship, attraction, entering a relationship, or relationship satisfaction. Then explain whether you agree or disagree with the research you se..
|
Ethical behavior among chief executives at arc
: What effect does organizational structure and compensation have on ethical behavior among chief executives at ARC?
|
Examine different circumstances with analysis of data
: Compute the Beta and interpret it for Prashant. - Examine different circumstances with analysis of data.
|
Create your own simple program using a repetition structure
: Create your own simple program using a repetition (i.e., Loop) structure. You decide the theme. Provide an overview (i.e., Program Design) of what your repetition structure is doing
|
Would you say you are living the good life
: What makes you happy? Would you say you are living "the good life?" Why or why not? If you could make any changes you wished that would make you happier, what would those be?
|
Examine women and families during the childbearing period
: In this course, students will examine women and families during the childbearing period. Individual, societal, cultural, and environmental factors as well as health care disparities related to childbearing and parenting will be identified and asse..
|
Apply the philosophies and techniques of jit
: To what extent should Dean expect to apply the philosophies and techniques of JIT described in this chapter to the running of staircase cell?
|
What information would be most important
: Discuss William's situation from the perspective of positive psychology. What information would be most important? What conclusions and recommendations might be made by a psychologist working from the positive psychology model?
|