// This program will calculate the highest and the lowest,
// variable out of a set of numbers. Also, it is going to give
// the sum and the average out of this set.
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
int number, average, amount, sum;
int variables = 0;
cout << " What is the amount of numbers that you want to sum ? ";
cin >> amount;
do
{
cout << "Enter the following number until you move into the next step: ";
cin >> number;
variables++;
sum += (number + number) / 2;
average = ( sum / amount);
} while (amount > variables);
if ()
cout << " The largest number that you entered was " << number << endl;
cout << " The amount of numbers that you decide to add was " << amount << endl;
cout << " The total sum of all the numbers that you entered is " << sum << endl;
cout << " The average of the numbers that you entered is " << average << endl;
return 0;
}
Write a C++ program that will first ask the user how many numbers they want to enter. Then, the program should allow the user to enter those numbers. Once all numbers are entered, the program should report the sum of all of the numbers, the average of all of the numbers, and the highest and lowest of all of the numbers that were entered.
I'm having a trouble with the last part, finding the lowest and highest value and I would like to get some help.