(1) Use JOptionPane and switch to write an application for Residential Life that determines a student’s housing, based upon gender and grade point average.Prompt the user to enter the gender:
(1)Female(2)Male.Prompt the user to enter the grade point average (0.0 – 4.0).If the user is male, he will reside in Beckwith Hall.If the user is female, her residency is based upon her grade point average.
HallGPA
Holmes Hall |
3.5 – 4.0 |
Merner Hall |
3.0 – 3.49 |
Pfeifer Hall |
2.0 – 2.99 |
Display the student’sgender, gpa, and Residence Hall assignment.
(2) Rewrite the program using Scanner and if.
WhatsApp us