I am trying to covert this code in to two classes but I am having trouble on wha
ID: 3743292 • Letter: I
Question
I am trying to covert this code in to two classes but I am having trouble on what to do.
Here's the code
import java.util.*;
/**
* This class was designed for Academic Advisors, this is a tool in which they are allowed to plug in the available scholarships that they're
* student(s) may be eligible for. They simply enter the students name and they're weighted GPA and the program will automatically specify which
* scholarships each student is eligible for.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Scholarship2
{
public static void main(String[] args){
double grade =1;
String name;
String scholar;
ArrayList<Double> gpa= new ArrayList<Double>();
ArrayList<String> names= new ArrayList<String>();
Scanner in =new Scanner(System.in);
while(grade > 0 ){
System.out.println("Enter the Student Name: ");
name=in.nextLine();
System.out.println("Enter their GPA(0 to quit): ");
grade = in.nextDouble();
names.add(name);
gpa.add(grade);
in.nextLine();
}
for(int i = 0; i < names.size()-1; i++) {
if(gpa.get(i)>=4){
scholar = "You're Great Scholarship, TrevonCornwell Award,BumbleBee Award, Hollow, Almost there Award";
System.out.print( names.get(i) + " is eligible for " + scholar + " ");
}
if(gpa.get(i)>=3 & gpa.get(i)<4){
scholar = "BumbleBee Award, Hollow, Almost there Award ";
System.out.print(names.get(i) + " is eligible for " + scholar + " " );
}
if(gpa.get(i)>=2 & gpa.get(i)<3 ){
scholar = "Almost there Award";
System.out.print(names.get(i) + " is eligible for " + scholar + " " );
}
if(gpa.get(i) <2){
scholar= "nothing :/";
System.out.print(names.get(i) + " is eligible for " + scholar+ " " );
}
}
}
}