Major Grade Point Average Advisor
Business 3.0-4.0 Donna Trump
Business 0.0-2.9 Edgar Skilling
Computer Information Systems 3.0-4.0 Wilma Gates
Computer Information Systems 0.0-2.9 Carl Careers
Liberal Arts 0.0-4.0 Andrea Worhol
Design the application that allows a user to enter a student's major and grade point average continuously until a sentinel value is entered. If the major is not one of the three offered by the college or the grade point average is not within range, consider the student unassigned. Display the assigned advisor for each student or a message indicating the student is unassigned. At the end of the programs execution, display a count to the number of students who have been assigned to each advisor and the number who are unassigned.
so far I have
import java.util.Scanner;
class major{
public static void main (String[] args){
Scanner myInput = new Scanner(System.in);
System.out.println("Please enter your major");
String major=myInput.nextLine();
System.out.println("Please enter your GPA");
Double gpa=myInput.nextDouble();
if(major.equals("business") && gpa>=3.0)
{
System.out.println("You have been assigned Donna Trump");
}
else {
System.out.println ("You have been assigned Edgar Skilling");}
}
}
Business 3.0-4.0 Donna Trump
Business 0.0-2.9 Edgar Skilling
Computer Information Systems 3.0-4.0 Wilma Gates
Computer Information Systems 0.0-2.9 Carl Careers
Liberal Arts 0.0-4.0 Andrea Worhol
Design the application that allows a user to enter a student's major and grade point average continuously until a sentinel value is entered. If the major is not one of the three offered by the college or the grade point average is not within range, consider the student unassigned. Display the assigned advisor for each student or a message indicating the student is unassigned. At the end of the programs execution, display a count to the number of students who have been assigned to each advisor and the number who are unassigned.
so far I have
import java.util.Scanner;
class major{
public static void main (String[] args){
Scanner myInput = new Scanner(System.in);
System.out.println("Please enter your major");
String major=myInput.nextLine();
System.out.println("Please enter your GPA");
Double gpa=myInput.nextDouble();
if(major.equals("business") && gpa>=3.0)
{
System.out.println("You have been assigned Donna Trump");
}
else {
System.out.println ("You have been assigned Edgar Skilling");}
}
}