Design a Windows application and write the code that will execute according to the program requirements in Figure 5-104 and the Use Case Definition in Figure 5-105 on the next page. Before writing the code, create an event planning document for each event in the program. The completed Form object and other objects in the user interface are shown in Figure 5-106 on the next page.
Application title: Patient Weight Converter
Purpose: This Windows application converts the weight of the patient from pounds to kilograms and
kilograms to pounds.
Program The user enters the weight of the patient, selects the conversion type (pounds to kilograms
Procedures: or kilograms to pounds), and displays the converted weight of the patient.
1. A user must be able to enter the weight of the patient in pounds or kilograms. Processing, and
2. The user must be able to select the type of conversion: pounds to kilograms or kilograms to pounds.
3. The user must be able to initiate the weight conversion and the display of the patient’s converted weight.
4. The conversion formulas are:
kilograms = pounds / 2.2
pounds =kilograms * 2.2
5. The user must be able to clear the entered weight, conversion choice, and results.
1. If a nonnumeric value is entered or if the weight is left blank, the user should be advised and asked for a valid entry.
2. If a negative number is entered for the weight, the user should be advised and asked for a valid entry.
3. If the value entered is greater than 500 for the conversion from pounds to kilograms or
greater than 225 for the conversion from kilograms to pounds, the user should be advised and asked for a valid entry.
4. The default conversion choice should be pounds to kilograms.
5. The converted weight should be displayed with one digit to the right of the decimal point.
Comments: 1. Obtain an image for this program from scsite.com/vb2010/ch5/images. The image file
name is Scale.
USE CASE DEFINITION
1. The Windows application window opens.
2. The user enters the patient’s weight.
3. The user selects the conversion type (pounds to kilograms or kilograms to pounds).
4. The user clicks the Display button to display the converted weight value.
5. The user clears the input and the result by clicking the Clear button.
6. If desired, the user repeats the process.
|Programming Language||Visual Basic|