/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package mp3_calebfontenot;

import java.util.Scanner;

/**
 *
 * @author caleb
 */
public class FindHighestScoreWhile {
    public static void main(String[] args)
    {
        int i = 0;
        
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the number of students: ");
        int numOfStudents = input.nextInt();
        System.out.print("Enter a student name: ");
        String student1 = input.next();
        System.out.print("Enter a student score: ");
        double score1 = input.nextDouble();
        while (i < numOfStudents - 1) {
            System.out.print("Enter a student name: ");
            String student = input.next();
            System.out.print("Enter a student score: ");
            double score = input.nextDouble();
            if (score > score1) {
                student1 = student;
                score1 = score;
            }
            i++;
        }
        System.out.println("Top student " + student1 + "'s score is " + score1);
    }
}
