Round The World travelling agency offered 3 types holiday packages to EGYPT during the school holidays. The rate for each package is shown in table 1.
Package Type 2 persons per room 4 persons per room
Adult Child Adult Child
A RM6500/adult RM6200/child RM4500/adult RM3000/child
B RM7300/adult RM7000/child RM5600/adult RM5100/child
C RM8500/adult RM7800/child RM5500/adult RM4900/child
Table 1: Rate for 3 types of holiday packages.
The agency wants to create a program that reads name of the booking person, the type of package, number of persons(adult and child),then calculates and prints the invoice. Only one package can be booked by a customer and 10% discount will be given if number of adults are more than 10 persons for a package of 2 persons per room.
You will have to use both looping and if-else I guess.
Loop to continuously read input till user wants to quit
if-else blocks to determine Package Type one or two, calculate based on the type then print the invoice
Logic will loop something like
//loop
//ask user to input name, type of package, number of adults, number of children
//Read input
//if package type = 1
//code for package type
//if number of adults >= 10
//code to apply discount
//if package type = 2
//package 2 code
//end loop - till (for example) user enters blank for name of the person