Help me pls.
/*(Finding the two highest scores) Write a program that prompts the user
to enter the number of students and each student's name and score,
and finally displays the student
with the highest score and the student with the second-highest score.*/
I dont know it how Do ı do:S
Break the big problem down into smaller problems and solve each one individually. For instance first work on getting the input from the user. Then work on checking which is highest and second highest, and finally work on displaying out put.
You should try as much as possible on your own, and post your attempt here. Then ask specific questions if possible. Please see the last link in my signature for more on creating a new program when you don't know how. Much luck!
I wanted user who have max score I wrote this code but it didnt work.
Scanner sc=new Scanner(System.in);
Please tell us how it doesn't work. Does it show any error messages? Does it show the wrong out put?
Originally Posted by pinar
Also, please post formatted code with indentations, and use code tags -- which I've added to your code above (see my first signature link to see how to do this).
edit: also, this line doesn't compile, does it?
Also, since you want to look for the biggest and the next to biggest score, you'll need two variables to hold this, say maxNo and secondMaxNo.