Testing Video for Lab 6
For this project you may create your own interface or use the one provided
in the Shell folder on Cobra. If you use the shell "make it your own" by changing colors, fonts, and/or rearrange
Your task is to code If statements behind the command buttons.
The Discount and Leap Year buttons are similar to the previous lab except
for the following differences.
The purchase amount must be greater than zero but may not be
greater than 500. Display an appropriate error message if the purchase amount is
not within the acceptable range of values.
Use compound conditions through out the code to solve the
problem. IMPORTANT - you must rewrite the logic previously used in lab 5
incorporating compound conditions.
Remember from lab 5 that all years that are evenly divisible by 400 are leap years
and that all years that are evenly divisible by 4 and not evenly divisible by 100 are
also leap years. All other years are not leap years. 1996, 2000, and 2004 are
all leap years but 1998, 1999, and 2100, and not leap years.
Since the modern leap year calculation was placed into law
by the Calendar Act 1751 it cannot be used reliably for years prior to 1753.
Display an message to that affect if the input year is prior to 1753.
Display an appropriate message if the value entered for the
year is not a whole number.
Use compound conditions to apply the leap year algorithm.
IMPORTANT - you must rewrite the logic previously used in lab 5 incorporating
Determine Shipping Charge
A shipping company calculates a shipping charge based on the
weight of a package and the distance it is to be shipped.
||Cost Per Pound
|up to 50 miles
|between 51 and 500 miles
|over 500 miles
An additional 10% is added if the customer wishes to insure
the package. (Indicated by a check box)
Display an appropriate message if the value in the weight textbox is not
a whole number.
Display an appropriate message if the value in the distance textbox is not
a whole number.
This company does not handle packages over 500 pounds. Display an appropriate message if the value in the
weight textbox is less than or equal 0 or more than 500 pounds.
Since the distance around the world is approximately 25,000
miles it is logical that the maximum distance to any given place is < 15,000 (we
can't assume a perfectly straight path). Display an appropriate message if the value in the
distance textbox is less than or equal to 0 or more than 15,000 miles.
Use compound conditions.
Set focus back to the text box related to the command button after output
(including error messages) is
Output labels must be blank if the input value is determined to be
Store the input value in variables. Do not use the contents of the
textboxes in numeric operations. (comparisons or calculations)
Define all needed variables locally, that is, in the event procedures.
Format all output values appropriately.
Include your name in the title bar of the form
Add documentation to the General Declaration Section of the class that includes
a brief description of what the program does
A record of how much time you spent on the lab
Adhere to all coding guidelines.
Use the Grader
A sample executable is available in the Sample Executable folder in
Use the TryParse method to
determine if the input value is a whole number.
Use the MessageBox object (Show method) or MsgBox statement to display
the error messages
To be certain your program works think carefully about what values should be
used to adequately test your statements?
When you are confident the program works
Submit a zipped folder(s) containing the entire project(s) as an attachment in the
appropriate drop box.