Programming I Hands On Semester Review

advertisement
Programming I Hands On Semester Review
Case
1. Use Visual Basic to complete the following steps:
a)
Create a MailingCost project. The application interface should look similar to:
b)
Set the appropriate object properties from the Design window.
c)
Write the application code so that the mailing cost of a package of magazines is
displayed when the magazine size is selected. The mailing cost for regular magazines is
$1.05 per magazine (1.05 * quantity) and $1.25 per magazine (1.25 * quantity) for
oversized magazines. Your code should include comments with your name and today’s
date. The application interface should look similar to the following after a quantity is
typed and a magazine size is selected:
d)
Modify the MailingCost application to include a TextChanged event procedure that
clears the mailing cost.
e)
Save the modified MailingCost application.
f)
Print the code.
2. Use Visual Basic to complete the following steps:
a)
Create a VanPool application. The application interface should look similar to:
b)
Set the appropriate object properties from the Design window.
c)
Write the application code so that when Compute is clicked the number of vans needed
and the number of people left over are displayed. A van can hold 8 people. Your code
should include comments with your name and today’s date. The application interface
should look similar to the following after clicking Compute:
d)
Modify the VanPool application to include a TextChanged event procedure that clears
the vans needed and the people left over.
e)
Save the modified VanPool project.
f)
Print the code.
3. Use Visual Basic to complete the following steps:
a)
Create a MealOrder application. The application interface should look similar to:
b)
Write the application code so that when Order is clicked the price of the order is
displayed. The price for breakfast is $3.99, the price for lunch is $6.99, and the price for
dinner is $10.99. Your code should include comments with your name and today’s date.
The application interface should look similar to the following after clicking Order:
c)
Modify the MealOrder application to display “The lunch soup of the day is Cream of
Tomato” in a message box when the Lunch check box is selected.
d)
Save the modified MealOrder application.
e)
Print the code.
4. Use Visual Basic to complete the following steps:
a)
Create an AverageTemperature application. The application interface should look
similar to:
b)
Set the appropriate object properties from the Design window.
c)
Write the application code so that when Enter Temperatures is clicked the user is
prompted with input boxes for the high temperature each day for the past 5 days and
then an appropriate message with the average temperature is displayed in a label. Your
code should include comments with your name and today’s date and a loop that prompts
the user with input boxes for the temperature on each of the past five days.
d)
Save the modified AverageTemperature project.
e)
Print the code.
5. Use Visual Basic to complete the following steps:
a) Create a Names application. The application interface should look similar to:
b) Set the appropriate object properties from the Design window.
c) Write the application code so that when Enter Names is clicked the user is repeatedly
prompted to enter a first name until stop is entered. The application then displays the
number of names entered (not including “stop”) and the name with the most characters.
Your code should include comments with your name and today’s date and a loop
terminated by a flag.
d) Modify the Names application to display the name with the most characters in all
uppercase characters.
e) Save the modified Names project.
f)
Print the code.
Programming I Hands On Semester Review
Answer Section
CASE
1. ANS:
A sample answer file corresponding to MailingCost is stored on the Resource CD in the
ASSESSMENT\HANDS-ON ANSWERS\Ch03 Answer MailingCost folder.
PTS: 1
TOP: Declaring Variables | Using Variables | Obtaining a Value from the User | Using Named Constants |
Built-In Data Types | Variable Scope
NOT: Similar to the ShippingCost Case question in this Question Bank.
2. ANS:
A sample answer file corresponding to VanPool is stored on the Resource CD in the ASSESSMENT\HANDSON ANSWERS\Ch03 Answer VanPool folder.
PTS: 1
TOP: Obtaining a Value from the User | Using Named Constants | Special Division Operators
NOT: Similar to the CarPool Case question in this Question Bank.
3. ANS:
A sample answer file corresponding to MealOrder is stored on the Resource CD in the
ASSESSMENT\HANDS-ON ANSWERS\Ch04 Answer MealOrder folder.
PTS: 1
TOP: The If…Then…ElseIf Statement | Compound Boolean Expressions | Displaying a Message Box | The
CheckBox Control NOT: Similar to the SchoolItems Case question in this Question Bank.
4. ANS:
A sample answer file corresponding to AverageTemperature is stored on the Resource CD in the
ASSESSMENT\HANDS-ON ANSWERS\Ch05 Answer AverageTemperature folder.
PTS: 1
TOP: Using an Input Box | The For…Next Statement
NOT: Similar to the AverageAttendance Case question in this Question Bank.
5. ANS:
A sample answer file corresponding to Name is stored on the Resource CD in the ASSESSMENT\HANDS-ON
ANSWERS\Ch05 Answer Names folder.
PTS: 1
TOP: The Do…Loop Statement | Using an Input Box | Accumulator Variables | Using Flags | The String
Class NOT:
Similar to the Cities Case question in this Question Bank.
Download