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

  In what order would you complete the tasks

You are sitting at your desk entering charges for a patient when you receive a call from the front desk. Patient Angela Diaz has just been seen by the doctor, and she is in the process of checking out.  She needs to schedule two appointments.

  Compare and contrast the software development process

question 1 take a position on the idea that software development is either a creation process or a manufacturing

  Use ezcountour to create a contour map of z

Generate a combination surface and contour plot of Z, using ezsurfc.

  Write a function that computes the sum of cubes

Write a function that computes the sum of cubes of all odd numbers occurring in a list of integers. Write a function that computes the sum of numbers in a list of lists of numbers: sumOfSums(List(List 1, 2, 3), List(4, 5, 6)) = 21

  Create the table relationships

make one query, your choice. Remember a query answers a question. As an example, list all household electronics that are greater in value than $200. Please ensure that the query title reflects what the query is about.

  Use vb to make an application

Use VB to make an application

  Should softarc move to a saas provider

Should SoftArc move to a SaaS provider in order to provide email and office automation services for their employees? What are the advantages and disadvantages of moving to a SaaS provider for these services?

  Write a program that computes the amount of money

Write a program that computes the amount of money the computer club will receive from proceeds of their granola bar sales project.

  How looping statements different from selection

define when you would use a while loop rather than a for loop and vice versa. Provide an example of one such instance.how looping statements different from selection.

  Managed care organizations and information technology

Normal 0 false false false EN-US X-NONE X-NONE Managed Care Organizations and..

  Distributed information systems

Complete the partial code provided with this lab that implements a simple group communication application using Java's MulticastSocket class.

  Why lexical analysis is separated from syntax analysis

What do you mean by the term aliasing mean?why Lexical analysis is separated from syntax analysis.

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