Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

Lab 05 Help-- finding the highest score

+9 votes
We know the method for finding the max of two values that returns the highest of the two, but how would I go about finding the max of a specific list of values? Perhaps I'm thinking about it in the wrong sense, but isn't that what the student high score finder supposed to do?
asked Oct 3, 2016 in CSC 211 (F16) by Lyliana Chavez (100 points)

5 Answers

+3 votes
Best answer
You'll want to create an "if" statement in order to narrow down the values for the house you want, and from there all you have to do is create a statement that saves the next value only if it is larger than the last and reassigns the value.
answered Oct 4, 2016 by Melissa Conway (100 points)
selected Oct 5, 2016 by Lyliana Chavez
+3 votes
I used an "if" statement for this one. Before the if statement I initialized a variable at 0 then if the score I was considering was higher I replaced it (re-assigned it) with the current score.
answered Oct 4, 2016 by Jon Clauss (100 points)
+3 votes
first you should declare an int for the highest score and set it at 0, then use a"if" to check if the highest score int is less than the score in the FOR loop above, then set the highest score integer to score => you have the highest score now
answered Oct 5, 2016 by Trung Le (Jayden) (100 points)
+1 vote
I believe it has something to do with an if statement. I hope that somewhat helps.
answered Oct 5, 2016 by Lucas Simon (100 points)
edited Oct 5, 2016 by Lucas Simon
+1 vote
You need to use an if statement and can use && in your if statements. At least that is what I did.
answered Oct 5, 2016 by Rachel Cheval (100 points)
When simplifying, the &&'s will get taken out