Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives The purpose of this assignment is to Practice writing small programs in C++ Write Selection Control Flow Statements using if-then-else statements. Write Iteration Control

Objectives

The purpose of this assignment is to

  • Practice writing small programs in C++
  • Write Selection Control Flow Statements using if-then-else statements.
  • Write Iteration Control Flow Statements using while loops
  • Perform simple input validation on user input to check its validity
  • Utilize Integer Arrays Filled from User Input to Analyze User Data

The Metric Array

Write a simple program that prompts the user to enter ten integer values between 1 and 100, stores these ten integers into an integer array, determines the smallest and largest values entered by the user into the array as well as the average of all the numbers entered by the user into the array (express this average as a floating-point number), and then prints each element of our integer array, followed by a blank line and the smallest number, the largest number, and the average of the numbers stored in our integer array. Print the smallest, largest, and average values with an appropriately descriptive label to identify it to the user out on the console screen.

As your third programming assignment, write a simple program to do the following:

  1. Please call your program MetricArray.cpp (5 points)
  2. Include the basic header comments in your program. This includes multi-line comments detailing your name, the class name, the name of your program, a very brief description of what your program does, and the due date for this assignment. (5 points)
  3. Print a welcome message out to the screen. (5 points)
  4. Prompt the user to enter the ten numbers with either individual prompts or separated by a space. For each number, check to make sure the users input value is between 1 and 100 inclusive before you assign that value into in your array.
  5. If a valid number was entered, then assign it into the appropriate position within your 10 integer array. (10 points)
  6. In a separate loop, you should look through the elements in your array in order to find the smallest and largest values within your integer array. (10 points)
  7. You should sum up the numbers within your integer array and divide that sum by 10 to calculate the average value (make sure your average variable is a float) of the numbers within your integer array. (10 points)
  8. Print out to the console screen the correct smallest and largest values for any 10 integers within the valid range contained in your integer array. (10 points)
  9. Print out to the console screen the correct floating point average value for any 10 integers within the valid range contained in your integer array. (10 points)
  10. Include comments in your code that mirrors your pseudo-code as we did in class to improve code readability and help you organize the segments of code that make up your program into a logical sequence of steps taken to solve this problem. (5 points.)

This assignment is due by the end of the day on Monday, February 8th by 11:59 PM. When you have completed your work, submit your completed C++ program file (the .cpp file) to Canvas via the Assignment portal.

Sample Run:

Welcome to the Metric Array Software Analysis Program!

Enter ten integers between 1 and 100, and I will tell you the smallest, the largest, and the average:

56

47

21

3

10

8

77

41

9

34

Smallest: 3

Largest: 77

Average: 30.6

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions