Assignment #6 Java Loop – Due Date – Sunday March 6 11:59pm (nothing accepted late)
150 points
Write a program that prompts the user for data to be read from the keyboard until the user wishes to stop (you must have a while loop)
Your program will store data a survey students (you are to make up the data)
(You must read in at least 10 to 15 sets of data)
The survey data to read in is:
· The gender of the student (male or female)
· Major of the student? (math or cis)
· GPA of the student? (double)
· Number of credits taken so far (integer)
You will then print the following:
1. number of students taking the survey
2. number of students who are math majors
3. percentage of students who are math majors
4. number of students who are cis majors
5. percentage of students who are cis majors
6. number of female students who are cis majors
7. number of male students who are math majors
8. number of students who are seniors (more than 90 credits)
9. number of students who are freshmen (less than 36 credits)
10. highest gpa of all math majors
11. highest gpa of all cis majors
12. average gpa of all students
ü You must use dialog boxes for input, but may use System.out statements for output.
You must take a structured approach to this program, For example, first get the loop to run. Then work on the first thing to count and print it. Then move on to the next thing to count.
You will have a lot of variables to keep track of in the program. They must be defined at the beginning of the code and you must use meaningful names. For example, you could call the count of female cis majors, “female_cis”. A variable name like “fc” is not acceptable.