



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Problem Description You must design and implement a Java program that will provide a High IQ/Genius IQ classification based on an IQ score. Your program will first assign a numerical classification based on IQ score according to the following: 115-124: 0, 125-134: 1, 135-144: 2, 145-164: 3, 165-179: 4, 180-200: 5, >200: 6. The numerical levels will then be used to output the IQ category classifications according to the following: 0 – Above Average, 1 - Gifted, 2 - Highly Gifted, 3 - Genius, 4 – High Genius, 5 - Highest Genius, 6 – Immeasurable Genius. Error Checking: If the user inputs an IQ score between 0 and 114 the program will output “This program does not categorize IQ scores below 115. Program will exit” and then exit. If the user inputs a negative integer the program will output the message “Invalid IQ. Program will exit.” and then exit. If the user clicks cancel on the input dialog box the program should output the message “Cancel was selected. Program will exit.” and then exit. You are not expected to handle error cases of non-int String input. Coding Requirements: You are expected to use a nested if-else statement to set the numerical classification. You are expected to use a switch statement to set the message to be displayed. Your output windows must have a title of “Program2 (Your Name)”. Filename Requirements: Your program must be saved to a file called Program2.java. Facts: When an object reference (e.g. String) does not reference an object yet, it will be set to hold a special value that in Java is designated null. null is returned from the JOptionPane.showInputDialog method when the cancel button is clicked. Deliverables You must submit a printed and electronic (CD or Floppy) copy of your commented program along with a printed copy of your problem analysis, pseudocode, completed data dictionary, completed test design table and screen captures of the input and output for all 5 test cases in a manila envelope or folder that has a data pocket. Problem Analysis - all inputs, processes, and outputs described. You must also include any formulas or constants in the problem analysis. Pseudocode – These steps should be detailed enough for you to transform each English- like statement into Java statements.
Data Dictionary (You may add additional lines) Variable Name Type Usage
Test Case input output 1 Click cancel^ Program shows a message indicating cancel was clicked and exits. 2 3 4 5
IQ not above 114 and associated output