Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

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+ " " );
}
}
}
  
}

Explanation / Answer

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) */ class Student { private String name; private double gpa; public Student() { } public Student(String name, double gpa) { this.name = name; this.gpa = gpa; } public String getName() { return name; } public void setName(String name) { this.name = name; } public double getGpa() { return gpa; } public void setGpa(double gpa) { this.gpa = gpa; } } public class Scholarship2 { public static void main(String[] args){ double grade =1; String name; String scholar; ArrayList students = new ArrayList(); Scanner in =new Scanner(System.in); while(grade > 0 ){ System.out.println("Enter the Student15 Name: "); name=in.nextLine(); System.out.println("Enter their GPA(0 to quit): "); grade = in.nextDouble(); students.add(new Student(name, grade)); in.nextLine(); } for(int i = 0; i =4){ scholar = "You're Great Scholarship, TrevonCornwell Award,BumbleBee Award, Hollow, Almost there Award"; System.out.print(students.get(i).getName() + " is eligible for " + scholar + " "); } if(students.get(i).getGpa()>=3 & students.get(i).getGpa()=2 & students.get(i).getGpa()
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote