I have homework C++
-
Enter an array of n real numbers, find and print the smallest and largest elements, and calculates and prints the average of the elements in the array. Print out the elements smaller than the average.
-
@maixeptoanphat And you want others to do your home work?!
-
yepp, pls help me
-
@maixeptoanphat No, I will not. It's your home work, so you have to do it...
-
@maixeptoanphat Then ask concrete questions. What did you try? What did not work? This forum is not for teaching C++ basics...
-
Hi
We can talk in board terms about each task without it being too much cheating.
However being in C++ Gurus forum, its a little off. ;)-
Enter an array of n real numbers,
we need a list here containing "real" values
Did you learn about std::vector ? -
find and print the smallest and largest elements,
Here we can use a for loop to run over the List.
we need 2 new variables to keep track of the biggest and smallest
value we have seen. -
Calculates and prints the average of the elements in the array.
Use a new variable and a for loop to loop the list and sum up
each value in the list. -
Print out the elements smaller than the average.
Again a for loop and use the new variable from before holding the avg value and
check pr value in list
-
-
lol, I translated the bio statement for this user:
"[EDIT: Name deleted --JKSH] is proud to be the supplier and installation of the highest quality portable folding roof in the area. Please contact us for advice and installation of the new and most beautiful portable folding roof today." -
@JonB said in I have homework C++:
Then just one more question, sorry: are they likely to get many orders for roofs from a Qt forum?!
Probably not, but such details don't bother spammers because their main goal is to leave hyperlinks in forums: https://en.wikipedia.org/wiki/Spamdexing#Link_spam
-
I sooo miss the days when the InterNet was by geeks, for geeks, and unknown to all but geeks. I blame AOL.