/home/caleb/ASDV-Java/Assignments/MP3_CalebFontenot/src/mp3_calebfontenot/FindHighestScoreDoWhile.java
/*
 * 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 FindHighestScoreDoWhile {
    public static void main(String[] args)
    {
        int i = 0;
        String student1 = "";
        double score1 = 0;
        
        Scanner input = new Scanner(System.in);
        System.out.print("Enter the number of students: ");
        int numOfStudents = input.nextInt();
        do  {
            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++;
        } while (i < numOfStudents);
        System.out.println("Top student " + student1 + "'s score is " + score1);
    }
}