3. Write a program for college’s admission office. Create variables to store a s
ID: 3625717 • Letter: 3
Question
3. Write a program for college’s admission office. Create variables to store a student’s numeric high school grade point average(for example 3.2) and admission test score. Print the message “Accept” if the student has any of the following*a grade point average of 3.0 and above, and an admission test score of at least 60.
*a grade point average below 3.0 and an admission test score of at least 80.
If the student doesn’t meet either of the qualification criteria, print “Reject”. Save the program as Admission.java
(Requirement for the inputs use JOptionPane)
Explanation / Answer
import javax.swing.JOptionPane;
public class Admission {
public static void main(String[] args) {
double gpa = Double.parseDouble(JOptionPane.showInputDialog("Input a GPA."));
int score = Integer.parseInt(JOptionPane.showInputDialog("Input a test score."));
if ((gpa >= 3.0 && score >= 60) || score >= 80) {
System.out.println("Accept");
} else {
System.out.println("Reject");
}
}
}
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.