Programming Worksheet 2
Programming Worksheet 2
D. Based on the IPO charts created last week for the questions listed below, please
convert each solution into both pseudocode and a corresponding flowchart.
2
5. Calculate the final bill for a meal. The program should take the meal's subtotal and
calculate the tax (10%) and a tip (15% of the subtotal). The final bill is the sum
of the subtotal, tax, and tip.
6. A store gives a 15% discount on the cost of items. Read the total cost of an item
purchased, calculate the discount amount and the final price after discount.
7. A student’s final score is calculated as follows:
a. Assignments = 20% of total
b. Midterm Exam = 30% of total
c. Final Exam = 50% of total
Read the three scores and calculate the final weighted score.
8. A car rental company charges a daily rate of $5000 for each rental. An insurance fee
of $1000 is charged per day and service tax of 12% of total charges are added. Read
the number of days rented and calculate the final amount to pay.
9. A university charges students tuition and other fees as follows:
a. Tuition fee = number of credits per credit
b. Registration fee = $5,000 (fixed)
c. Library fee = $2,000 (fixed)
d. Technology fee = 8% of tuition fee
e. Development fee = 5% of tuition fee
Design an IPO chart to calculate and display the total university fee for a student,
given the number of credits and the cost per credit.
In the Laboratory
Complete any unfinished questions from the previous sections.
Your tutors should introduce the phases associated with implementing a C program:
creating source code, compiling, the C preprocessor with preprocessor directives, linking,
and loading. This should be accompanied by a walkthrough of the basic program
structure before students begin writing complete source code.