Write a C++ console application that accepts up to five numbers from the user. Display all...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ console application that accepts up to five numbers from the user. Display all numbers, the highest, the lowest, and the average of the numbers. Ask the user if they want to continue entering another set of numbers. Requirements: 1. Comments are extremely important. Add comments as you code. Do NOT wait until you are done coding. Also, in the beginning of your codes include the following comments: • Purpose of the program o Name of the author 。 Date 2. Use proper naming conventions for your variables and functions (see handout). 3. Tell the user what the program is all about. Do NOT start the program with "Enter a number"!! 4. Create an array of five elements to store the numbers. 5. The user does not have to enter all five numbers. They can enter fewer. However, of course, you need at least two numbers to be able to look for the highest and the lowest. Make sure you explain this to the user. 6. Do not ask the user first how many numbers they want. The purpose of the assignment is for you to use proper logic to handle this task. 7. Create three functions to perform the following tasks: Get the values from the user. This function must also decide how many numbers the user has entered. Calculate the highest, the lowest, and the average. Hint: use reference parameters for min, max, and average. Print all results (all numbers, the highest, the lowest, and the average) 8. Pass the maximum number of elements to the function. The functions do not know how many numbers they should process. 9. All three functions must be called by the main, not other functions. 10. Keep track of the number of the values the user enters. Remember, they do not have to enter all 5 numbers. 11. Absolutely no global variables are allowed, including the array. 12. Do not use Magic Numbers. 13. The program must work correctly if you decide to change the number of possible values later. This program asks for up to 5 numbers. It then displays the numbers, the highest, the lowest, and the average. Please enter the first number: 87.93 Please enter the second number: 100 Would you like to add another number? Y/N: y Please enter #3 value: 77.34 Would you like to add another number? Y/N: Y Please enter #4 value: 7 Would you like to add another number? Y/N: n You entered: 87.93 100 77.34 7 Highest: 100 Lowest: 7 Average: 68.0675 Would you like to do it again? Y/N: y Please enter the first number: 777 Please enter the second number: 666 Would you like to add another number? Y/N: y Please enter #3 value: 11.2343 Would you like to add another number? Y/N: Y Please enter #4 value: -45 Would you like to add another number? Y/N: y Please enter #5 value: 5 You entered: 777 666 11.2343 -45 5 Highest: 777 Lowest: -45 Average: 282.847 Would you like to do it again? Y/N: n Write a C++ console application that accepts up to five numbers from the user. Display all numbers, the highest, the lowest, and the average of the numbers. Ask the user if they want to continue entering another set of numbers. Requirements: 1. Comments are extremely important. Add comments as you code. Do NOT wait until you are done coding. Also, in the beginning of your codes include the following comments: • Purpose of the program o Name of the author 。 Date 2. Use proper naming conventions for your variables and functions (see handout). 3. Tell the user what the program is all about. Do NOT start the program with "Enter a number"!! 4. Create an array of five elements to store the numbers. 5. The user does not have to enter all five numbers. They can enter fewer. However, of course, you need at least two numbers to be able to look for the highest and the lowest. Make sure you explain this to the user. 6. Do not ask the user first how many numbers they want. The purpose of the assignment is for you to use proper logic to handle this task. 7. Create three functions to perform the following tasks: Get the values from the user. This function must also decide how many numbers the user has entered. Calculate the highest, the lowest, and the average. Hint: use reference parameters for min, max, and average. Print all results (all numbers, the highest, the lowest, and the average) 8. Pass the maximum number of elements to the function. The functions do not know how many numbers they should process. 9. All three functions must be called by the main, not other functions. 10. Keep track of the number of the values the user enters. Remember, they do not have to enter all 5 numbers. 11. Absolutely no global variables are allowed, including the array. 12. Do not use Magic Numbers. 13. The program must work correctly if you decide to change the number of possible values later. This program asks for up to 5 numbers. It then displays the numbers, the highest, the lowest, and the average. Please enter the first number: 87.93 Please enter the second number: 100 Would you like to add another number? Y/N: y Please enter #3 value: 77.34 Would you like to add another number? Y/N: Y Please enter #4 value: 7 Would you like to add another number? Y/N: n You entered: 87.93 100 77.34 7 Highest: 100 Lowest: 7 Average: 68.0675 Would you like to do it again? Y/N: y Please enter the first number: 777 Please enter the second number: 666 Would you like to add another number? Y/N: y Please enter #3 value: 11.2343 Would you like to add another number? Y/N: Y Please enter #4 value: -45 Would you like to add another number? Y/N: y Please enter #5 value: 5 You entered: 777 666 11.2343 -45 5 Highest: 777 Lowest: -45 Average: 282.847 Would you like to do it again? Y/N: n
Expert Answer:
Answer rating: 100% (QA)
Heres a C console application that fulfills the given requirements include include Function to get v... View the full answer
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Jayhawks decided to acquire Tarheels corporation. Because Jayhawks is larger, after the acquisition, the combined company will use Jayhawks cost of debt and Jayhawks Debt and Equity percentages You...
-
In Problems 25 54, solve each system. Use any method you wish. 2xxy + y = 8 xy = 4
-
A CPA needs to satisfy state continuing education requirements each year to preserve her license to practice. Due to procrastination, she waited until the last minute to fulfill this requirement. She...
-
Phonetex is a medium- size manufacturer of telephone sets and switching equipment. Its primary business is government contracts, especially defense contracts, which are very profitable. The com-pany...
-
What are the primary components of an insurance policy?
-
Tech Support Services has the following unadjusted trial balance as of January 31, 2014. The debit and credit totals are not equal as a result of the following errors: a. The cash entered on the...
-
In 2023, Kathleen Tweardy incurs $30,000 of interest expense related to her investments. Her investment income includes $7,500 of interest, $6,000 of qualified dividends, and a $12,000 net capital...
-
Use INDEX and MATCH functions to fill in a table that extracts the amounts shipped between each pair of cities in the accompanying data, which shows the solution to an optimization model that finds...
-
Today Carvana's stock was up 33% and another 20% in after hours trading. Based on news of a potential bankruptcy warning and Financial statements that are less then stellar, why do these stocks act...
-
What factors does a court consider when determining if a restrictive covenant in an employment contract is legal and enforceable?
-
What three essentials of a binding contract have we considered thus far?
-
What are the consequences of failure to comply with consumer protection legislation as opposed to the Statute of Frauds or Sale of Goods Act?
-
Distinguish among the different outcomes for contracts that are unenforceable, voidable, and void.
-
Explain the nature of a seal and its legal importance in Canada.
-
1 The company's bank statement shows a cash balance of $12,000. Comparing the company's cash records with the monthly bank statement reveals several additional cash transactions such as checks...
-
Software Solution is family-owned business that has been in operation for more than 15 year. The board of directors is comprised of mainly family members, plus a few professionals such as an...
-
Convert the following pseudocode to Java code. Be sure to declare the appropriate variables. Store 172.5 in the force variable. Store 27.5 in the area variable. Divide area by force and store the...
-
Write an application that displays a slideshow of images, one after the other, with a time delay between each image. The user should be able to select up to 10 images for the slide show and specify...
-
Write an if statement that assigns 0.2 to commission if sales is greater than or equal to 10000.
-
Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors should be used as keys, and the predefined Color objects should be used...
-
Use SecureRandom method ints to generate a stream of 50 random numbers in the range 1 to 999, then filter the resulting stream elements to select only the odd numbers and display the results in...
-
(a) How many of male respondents in this study had some college degree? (b) How would you describe the largest group of respondents? (c) What could be stated about the differences between male and...
Study smarter with the SolutionInn App