Program 19

Hello,


I decided to move on with my exercises,

Keep track of the sum of values entered (as well as the smallest and the largest) and the number of values entered. When the loop ends, print the smallest, the largest, the number of values, and the sum of values. Note that to keep the sum, you have to decide on a unit to use for that sum; use meters.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
double a;
int b; =value entered
int c; =sum of the values entered
double i= sum of units
string sum of units;
sum of units= "Meters";

while (cin>>a) {

for (double a=0; a<i ; ++a)        // Increment a up to sum which is i

vector<int>sum of values;
for (int b=0;b<c;++b)                // Get the sum of the values entered
v.push back(1);
           

}




Yeah, I got lost. If someone could explain me how to get this working would be nice. Thanks
Last edited on
Topic archived. No new replies allowed.