Docsity

Programming Assignment 2 on Problem Solving-Programming Concepts I | CIS 120, Assignments of Computer Science

Toggle sidebar
bg1
Name:___________________________________________ Section:________
CIS 120-101 Fall 2007
Programming Assignment 2
Due: Week 5 (Fri 9/21/07)
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.
pf3
pf4
pf5

Partial preview of the text

Download Programming Assignment 2 on Problem Solving-Programming Concepts I | CIS 120 and more Assignments Computer Science in PDF only on Docsity!

Name:___________________________________________ Section:________

CIS 120-101 Fall 2007

Programming Assignment 2

Due: Week 5 (Fri 9/21/07)

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 Design

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

CIS 120-101 Fall 2007

Programming Assignment 2 Cover Sheet Grade _______________

Name (Print): __________________________________________ Student #: ____________

Instructor: __ _________ Paul Overstreet ________ _______ Section: ______________

Your program documentation should be labeled and organized according to the following:

DOCUMENTATION and DESIGN: 25% Paper copy and electronic copy are mandatory.

_____5 pt. Problem Analysis

Identification of inputs, processes, and output

_____5 pt. Algorithmic Design:

Pseudocode – Clearly Written and Understood

Correct Solution

_____5 pt. Data Dictionary

All data and data types specified

Appropriate names chosen

Correct data types chosen

_____10 pt. Test Design (5%) and corresponding program output (5%)

Minimum of five documented test cases.

Displays correct input and output expected by program

Output is clear and correct.

Your program should have proper global documentation (at the top). It should also have appropriate

internal documentation with code lines. See lab 1 programs for an example.

PROGRAM: 75% Paper copy and electronic copy are mandatory.

_____10 pt. Global and Internal documentation and comments

_____10 pt. Style (indentation, spacing, blank lines, correct capitalization of identifiers

based on coding convention, etc.)

_____ 5 pt. Meaningful identifiers - matches data dictionary

_____35 pt. Correctness of program

Including: Program compiles, program runs, produces correct output

_____15 pt. Follows algorithm