Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class highscore {
- public static void main(String[] args) {
- Scanner input = new Scanner(System. in );
- int i = 0;
- int hiscore;
- string hiscorename;
- System.out.print("How many student's are there? ");
- int count = input.nextInt();
- for (int i = 0; i < count; i++) {
- System.out.println("Students name: ");
- string n = input.nextLine();
- System.out.println("");
- System.out.println("Student Score: ");
- int score = input.nextInt();
- }
- if (score > 0) {
- score = hiscore;
- System.out.println(n + " has the highest score with " + hiscore);
- }
- if (score > hiscore) {
- score = hiscore;
- System.out.println(n + " has the highest score with " + hiscore);
- } else if (hiscore > score);
- while (i > count);
- System.out.println("No students left");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment