Create your own simple program using a repetition structure

Assignment Help Computer Engineering
Reference no: EM131262089

While-End Loop (Repetition Structure)

 

1592_Figure.png

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.

Reference no: EM131262089

Questions Cloud

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?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Developing the new websites

A developer obtained the following three rules in specification for a new Web site. If a Web page consists of the word “painting”, then it also comprises either “acrylic” or “oil”.

  What a white box testing plan includes

A business letter addressed to the board of Jonesville Library introducing the contents of the document.

  Construct an alternative e-r tables

Construct an alternative E-R tables that uses only a binary relationship between students and course_offerings

  In software engineering one can find out various life cycle

in software engineering one can find various life cycle models. some examples include the waterfall model agile

  Make binary search tree that will accept integers in order

modify a C++ Binary Search Tree that will accept integers in this order: 35, 18, 48, 72, 60, 25. Ask user for input and search tree utilizing integer input. Return "True" if input integer is found or "False" if it is not found in tree.

  In short describe the situation inside your company

It is likely that your organization uses various decision-support programs, as in  programs that automate production, programs for resource optimization, and so on.

  What is printed by the given program

What is printed by the following program? Suppose the input is the following: Miller 34 340 #include #include using namespace std; const int PRIME_NUM = 11; int main () { const int SECRET = 17; string name

  Show how to build a j-k flip-flop

express how to build a J-K flip-flop using a T flip-flop with enable and combinational logic.

  Implementing stringed musical instrument class

Generate a Java test class which simulates utilizing your instrument class. a) Construct 10 examples of your instrument, b) tune your instruments, c) Start playing your instrument, d) Call your unique method, and e) Stop playing your instruments.

  Research for a voip solution

In the future, Klamath’s separate the voice network will be dismantled. All the voice, data, and video traffic will traverse Metro Ethernet network.

  How electricity usage file the amount of electricity

make an electricity usage report showing the customer number.

  Recommend two 2 factors which would affect the decision to

q1. suggest two 2 factors that would influence the decision to disable bridge all site links as part of the site

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd