Counter-controlled while loop lab

Assignment Help C/C++ Programming
Reference no: EM132432239

Counter-Controlled While Loop Lab

Write a program that does the following:

  • Prompts the user for the number of grades they wish to enter.
  • Computes a running total of the grades entered. You will need to initialize this variable to zero when you declare it.
  • Calculates the average of the grades entered.
  • Test to make sure the average is not computed if the number of grades is zero.
  • Prints out one of the following:
  • A message stating the average of the grades entered.
  • An error message stating that the number of grades must be greater than zero.

Include the following:

0. If the User enters a zero or less for the number of grades then print out an error message stating that the number of grades must be greater than zero.

1. Initialize the counter to either zero or one before the while loop begins.

2. Use a counter controlled while loop that uses the number of grades entered by the User as the maximum number of loops executed. 

a. If you initialized your counter to zero you will want the loop to continue as long as your counter is less than the number of grades. 

b. If you initialized your counter to one you will want the loop to continue as long as your counter is less than or equal to the number of grades.

3. Within the body of the loop:

a. Prompts the User for the next grade.

b. Compute a running total of these grades as they are entered.

4. After the While Loop is done executing, compute the average of all the grades entered. Remember to check to make sure you don't perform a division by zero.

5. Include all Prologue information.

6. Include an initial algorithm.

7. Include a refined algorithm.

Reference no: EM132432239

Questions Cloud

Management of memory and the data it holds : Just as arrays allow us to have one variable to access more than one value, how do pointers expand this functionality aside from arrays also being pointers?
What is the minimum taxable income : Computer Ltd. generated the following data for its December 31, 2018 taxation year: Capital Gains $35,000. What is the minimum taxable income
How would you approach figuring out your breakeven point : Recently a friend of mine set up small psychologist practice. How would you approach figuring out your breakeven point? What would you include in variable costs
Draw the flow chart and pseudo code for a program : Draw the flow chart and pseudo code for a program needed by Hometown Bank. The program determines a monthly checking account fee.
Counter-controlled while loop lab : Prompts the user for the number of grades they wish to enter. Computes a running total of the grades entered. You will need to initialize this variable to zero
Determine the Times Interest Earned Ratio : For the FY 2018, Frederick Company had net sales of $1,100,000 and net income of $75,000, Determine the Times Interest Earned Ratio
Major Social Forces at Work Assignment : Major Social Forces at Work Assignment help and solutions:- Describe at least three of the major social forces that impact work organizations
Develop a program that calculates final score : Develop a program that calculates final score and average score for a student from his/her (1)class participation, (2) test, (3) assignment
Explore applicable concepts within abstract algebra : Examine set theory and functions applicable to software engineering and Investigate solutions to problem situations using the application of Boolean algebra.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program class the speed of sound

Write a program class The Speed Of Sound that asks the user to enter "air", "water", or "steel", and the distance that a sound wave will travel in the medium. The program should then display the amount of time it will take.

  Definition of two queues

Write a code in C language for the definition of two queues, one to hold the process in ready state and one to hold the process in waiting state.

  Which pieces of information can be found in the ip header

There are eight network security questions. I have answered the questions however, I am unclear if I am correct. Please review and if I am wrong, please provide the correct answer along with your explanation.

  Determine the reynolds number of flow in a rectangular

determine the reynolds number of flow in a rectangular channel 2m deep and 4m wide if the water level is 60 and running

  Program to add numbers and display sum

For each of problems write C++ code to do the required task. Receive the number and find out whether it is odd or even.

  Consider the following nested loop construct

Consider the following nested loop construct. Categorize its efficiency in terms of the variable n using big-O notation. Suppose the statements represented by the ellipsis require four main memory accesses (each requiring one microsecond) and two dis..

  What action would you like to implement

Create an Inner class called Student inside Students class with the following methods: default constructor, overloaded constructor, setID

  A used car dealership maintains an inventory

Submit the completed program (all 4 parts) including all class definitions/implementations in a single .cpp source file (i.e., do not construct separate files for class headers and implementation).

  Object-oriented programming-event-driven programming

Use the Internet or Strayer databases to research the advantages, features, and common examples of OOP and EDP. Note: You may use the Association for Computing Machinery (ACM) Digital Library to support research on the above topics. Instructions d..

  Program solves the n-queens problem

you will write a program that solves the N-Queens problem by the backtracking method. The pseudocode for the solution is on the last page. Your program should run in standard Java, either as an application or an applet.

  How to implement member functions in c++

I am having a dificult time understanding Classes in C++ and how to implement member functions. Given the attached code I need to:

  Difference between the effects of the given two declarations

What is the difference between the effects of the following two declarations: Ratio y(x); Ratio y = x; What is the difference between the effects of the following two lines: Ratio y = x; Ratio y; y = x;

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