1. Test the ternary if statement
Your program is to calculate a consultant’s invoice to their client. The consultant charges $85 per
hour, however there is a minimum of 5 hours to be billed regardless of the hours worked. Read the
amount of hours worked from the keyboard and calculate what the invoice total will be. You are to
use the ternary if statement to perform this calculation.
Page name: consultant.html
Decision structure: ternary or conditional operator
2. Test the switch statement using a single case
Your program is to prompt the user to enter X, Y or Z. Use a switch statement to display the
appropriate message: You entered X, You entered Y, or you entered Z.
Page name: Switch SingleCase.html
Decision structure: switch statement
3. Test the switch statement using mixed case
Your program is to read a price code from the user and display the appropriate price per kilogram
according to the following table:-
Price Code
A
B
C
Price / kg
$1.50
$2.85
$5.60
You program should also accept the price code in lower case. The output should be formatted to be
displayed as currency.
Class name: Switch MultiCase.html
Decision structure: switch statement

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER