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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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