Hello,
I am having a hard time with a easy problem. I need to ask a user how many scores they would like to enter (up to 15) and then use a method to get the number of scores. in the form of
Enter score 1: xx.xx
Enter score 2: xx.xx
Enter score 3: xx.xx
and so on till you hit the requested number or 15.
Here is what I have so far. Your help is greatly appreciated.
import java.util.Scanner;
public class Exams
{
public static void main ( String args [] )
{}
private final static int MAX_SCORE =15;
private int count=0;
public Exams()
{
Scanner input=new Scanner(System.in);
System.out.print("Welcome to the Exam Scores Program \n");
System.out.print ("\n");
System.out.print ( " How many scores will you enter (up to 15):");
count = input.nextInt();
System.out.print ("\n");
if (count > MAX_SCORE)
{
System.out.print(" Error: You may onlyenter upto 15 scores - Please try again:");
count=input.nextInt();
System.out.print ("\n");
}
}
public void getScores ()
{
int i = 0;
while (1 <= count)
{
System.out.print("Enter Score " + i );
i++;
}
}
}