Guest User

Highest Student Score

a guest
Jul 10th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class highscore {
  3.     public static void main(String[] args) {
  4.         Scanner input = new Scanner(System. in );
  5.         int i = 0;
  6.         int hiscore;
  7.         string hiscorename;
  8.         System.out.print("How many student's are there? ");
  9.         int count = input.nextInt();
  10.         for (int i = 0; i < count; i++) {
  11.             System.out.println("Students name: ");
  12.             string n = input.nextLine();
  13.             System.out.println("");
  14.             System.out.println("Student Score: ");
  15.             int score = input.nextInt();
  16.         }
  17.         if (score > 0) {
  18.             score = hiscore;
  19.             System.out.println(n + " has the highest score with " + hiscore);
  20.         }
  21.         if (score > hiscore) {
  22.             score = hiscore;
  23.             System.out.println(n + " has the highest score with " + hiscore);
  24.         } else if (hiscore > score);
  25.  
  26.         while (i > count);
  27.  
  28.         System.out.println("No students left");
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment