Hello!!
if anyone could help this would be great. I'm tring to figure out how to find the max and min number out of a set of user inputs numbers in a program. for example the user inputs 4 set of numbers like 30 79 91 and 4 and i want to add the sum of them but subtract the max and min numbers. How would I do this??
I know how to do that it just that its hard for me to put it into code
this is what I came up with but it doesnt seem to work on my program. I'm doing loops
Now that is a much better question. You have gone from essentially asking us to do your homework for you, to giving us some code you're having trouble with.
Firstly, this makes no sense else ( score < smallestScoreSoFar)
I suspect you meant elseif ( score < smallestScoreSoFar)
but this has a problem. What happens if only one number is entered? Then that should be the biggest AND smallest, right? So each input number needs to be checked for being the biggest AND for being the smallest, like this:
What values are you setting biggestScoreSoFar and smallestScoreSoFar to at the start?
You can still improve your questions, though.
what I came up with but it doesnt seem to work on my program
is not nearly enough. What does it do that you don't like, or not do? Does it compile? Does it link? Does it crash? Does it produce output? What output, for what input? Do you get the idea?
sorry if I'm not explaining it correctly I am new to C++ programming and I get lost really easily. I'm trying to correct a previous assignment that was given to me.