Professional Documents
Culture Documents
Interactive Programming Exercise 1
Interactive Programming Exercise 1
1. Write a program that formats product information entered by the user. A session
with the program should look like the following: ( the user's input has been
underlined )
Interactive Programming Exercise 1
2. Write a program to handle the calculation of GPA. The relevant formula is:
GPA=(Grade point 1 x Credit 1 + Grade point 2 x Credit 2 + Grade point 3 x Credit 3 ) / Total Credit
3. Write a program to process the details of some books purchase. The output
of the program should look like the following:
Interactive Programming Exercise 1
****************
One World Auto Rental
****************
Year Model : 2010
Make : Honda City
Plate Number : WGE7614
Enter Rental Days :3
Rental Rate Per Day : RM120.00
Promotional Discount Rate(%) :2
Summary Receipt
-------------
Total Payment for 3 days @ Rental Rate RM120.00 per day
Vehicle Details = => Honda City (2010) WGE7614
Promotional Discount Rate 2% = RM 7.20
PAYMENT
RM360.00 – RM7.20 = RM352.80
Reference :
total payment = rental rate x day
discount=promotional discount rate /100 X total payment
payment=total payment – discount