:?: can anyone explain to me a simple way to get the lowest input and the highest input From
multiple inputs
while also counting how many are below a certain value and avove a certain value
I am at my witts end tryng to learn. I am a newbie at programming and trying so many ways that I know are unneeded so far I have this
#include <iostream.h>
main()
{
int totalCalls,callcounter,Duration;
int longest, shortest;
double average ;
while(callcounter <= 10) //using ten as the amount o call to easy use
{
cout << "Enter Call duration :\n"; \\ lenght of calls
cin >> Duration ;\\ user input
totalcalls = totalcalls + duration;\\ adds duration to call total
callcounter+ ; \\add one or every loop to counter
}//end while
average = totalcalls/callcounter;\\ average of all calls
if (duration ==5)
shortest = duration
cout << " Average length of all calls :"<< average <<"\n";
cout << " Total length of all calls :"<< totalcalls<<"\n";
cout << " Total of call\t :"<< callcounter<<"\n";
}endmain
I can't seem to get the hang of getting the maximum legnth of calls and the miniumun length of calls also calls below and above a certain number
I have tried multiple if statements but am lost
I know it may be possible that I have to use arrays, switchs or a pointers
but as I have just started to learn C++ within the last two weeks any help is appreciated
< :?: If it aint hard it it good >