see the attachments please
In the English measurement system, 1 yard equals 3 feet and 1 foot equals 12 inches. Use this
information to create an application that lets the user convert distances to and from inches, feet and
yards.
Figure 4-35 on page 265 shows an example of how the application’s form might appear. In the example,
the user enters the distance to be converted into a TextBox. A ListBox allows the user to select the units
being converted from, and another ListBox allows the user to select the units being converted to.
Note: Be sure to handle the situation where the user picks the same units from both list boxes. The
converted value will be the same as the value entered.
CS 165 01
Program Assignment 03
Chapter 04
20 Points
In the English measurement system, 1 yard equals 3 feet and 1 foot equals 12 inches. Use this
information to create an application that lets the user convert distances to and from inches, feet and
yards.
Figure 4-35 on page 265 shows an example of how the application’s form might appear. In the example,
the user enters the distance to be converted into a TextBox. A ListBox allows the user to select the units
being converted from, and another ListBox allows the user to select the units being converted to.
Note: Be sure to handle the situation where the user picks the same units from both list boxes. The
converted value will be the same as the value entered.
Add the following comments to the beginning of the program.
Name:
Your Name
Class and Section:
CS 165 01
Assignment:
Program Assignment 03
Due Date:
See above
Date Turned in:
Program Description: You write a short description of what the program will do
Programming Problems
265
Figure 4-35 shows an example of how the application’s form might appear. In the
example, the user enters the distance to be converted into a TextBox. A ListBox
allows the user to select the units being converted from, and another ListBox allows
the user to select the units being converted to
Figure 4-35 The Distance Converter form
Distance Converter
x
Enter a distance to convert
10
From
To
Inches
Inches
Fee
Yards
Yards
Converted Distance
120
Convert
Ed
6.
.
.
Note: Be sure to handle the situation where the user picks the same units from both
list boxes. The converted value will be the same as the value entered.
Book Club Points
Serendipity Booksellers has a book club that awards points to its customers based
on the number of books purchased each month. The points are awarded as follows:
If a customer purchases 0 books, he or she earns 0 points.
If a customer purchases I book, he or she earns 5 points.
If a customer purchases 2 books, he or she earns 15 points.
If a customer purchases 3 books, he or she earns 30 points.
If a customer purchases 4 or more books, he or she earns 60 points.
Create an application that lets the user enter the number of books that he or she has
purchased this month and displays the number of points awarded.
Software Sales
A software company sells a package that retails for $99. Quantity discounts are
given according to the following table:
Quantity
Discount
10-19
20%
20-49
30%
50-99
40%
100 or more
50%
Create an application that lets the user enter the number of packages purchased.
The program should then display the amount of the discount (if any) and the total
amount of the purchase after the discount.
Body Mass Index Program Enhancement
Programming Problem 6 in Chapter 3, you were asked to create an application
that calculates a person’s body mass index (BMI). Recall from that exercise that the
BMI is often used to determine whether a person is overweight or underweight for
their height. A person’s BMI is calculated with the following formula:
BMI = Weight x 703 + Height
8.