0% found this document useful (0 votes)
157 views1 page

CIS160 Assignment 2

The document provides instructions for modifying a gain/loss calculator program. It lists 5 criteria for modifications: 1) Add error handling for blank or non-numeric values. 2) Fix a bug so positive values are displayed correctly. 3) Add text to the result label. 4) Add a clear button. 5) Set the calculate and clear buttons as accept and cancel. The grading criteria and points for each modification are also provided.

Uploaded by

rriness
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
157 views1 page

CIS160 Assignment 2

The document provides instructions for modifying a gain/loss calculator program. It lists 5 criteria for modifications: 1) Add error handling for blank or non-numeric values. 2) Fix a bug so positive values are displayed correctly. 3) Add text to the result label. 4) Add a clear button. 5) Set the calculate and clear buttons as accept and cancel. The grading criteria and points for each modification are also provided.

Uploaded by

rriness
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

CIS-160 Homework #2 Name:__________

Copy the Assignment 2 project (gain/loss) from the R: drive and make the following
modifications:
1. Add error handling if the user leaves either of the textboxes blank or enters
non-numeric values.
2. There is a bug in this program. If I have expenses of $10 and an income of
$100, then I should have made $90. Instead, it says ($90.00), which
means I lost $90. Correct this problem so the right value is always shown.
3. Instead of just outputting a value, put the words The gain or loss is in front
of the gain/loss amount. Do this in the code using string concatenation.
4. Add a Clear button which clears the textboxes and the result label, and puts
the focus on the first textbox.
5. Set the calculate button to be the Accept button and the Clear button to be
the Cancel button.
Turn in this sheet and a print out of your code in a folder; drop your project folder in
the dropbox on the R: drive.
Grading

Criteria Points

Incorrect/blank values handled appropriately /5

Gain/loss calculated correctly /5

Result label includes appropriate text /4

Clear button clears appropriate controls and sets focus /4

Accept and Cancel buttons set /3

Comments and appropriate names used /4

You might also like