Sei sulla pagina 1di 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

Potrebbero piacerti anche