Flowchart Group Project - Drawio

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Start

calculateAdultFee (int quantityAdult)

adultFee

adultFee =quantityAdult * 10.0

return adultFee

calculateChildFee (int quantityChild)

childFee

childFee =quantityChild * 10.0

return childFee

applyDiscount (entranceFee)
weekDiscount

weekDiscount = (entranceFee * 5) / 100

return weekDiscount

quantityAdult, quantityChild, entryTime,


isMember
display "=============================================="
display "Price for an adult : RM10.00", newline
Yes
display "Price for a child : RM5.00", newline
display "5% discount for member", newline
display "15% discount only on weekdays", newline
display "=============================================="

No display "Are you a member? (Y for yes, N for no)


read isMember

Yes

display "Enter the number of adults : "


read quantityAdult

display "Enter the number of children : "


read quantityChild

display "Enter the entry time (in 24-hours format) : "


read entryTime

isMember == 'Y"
||
isMember == "y'

Yes

fee1 = calculateAdultFee (quantityAdult)


fee2 =calculateChildFee (quantityChild)
entranceFee = fee1 + fee2

discount
discount1
discount2
totalDiscount

discount = (entranceFee * 5) / 100

entryTime >= 12
&&
entryTime <= 18

discount1 = (entranceFee * 5) / 100

dayOfWeek

No
display "Enter the day of the week (Weekday / Weekend) : "
read dayOfWeek

No
dayOfWeek == 'Weekday'

Yes

discount2 = applyDiscount (entranceFee)

finalPrice = entranceFee - discount2 - discount - discount1


totalDiscount = entranceFee - finalPrice
member = 'yes'

display "\n============Receipt=============", newline


dsiplay "Number of adults : ", quantityAdult, newline
display "Number of children : ", quantityChild, newline Yes
display "Entry Time : ", entryTime, ".00", newline
display "Membership : ", isMember, newline
display "Day of the week : ", dayOfWeek, newline
display fix, setprecision(2)
display "Total discount : RM" , totalDiscount, newline
display "Final price : RM" , finalPrice, newline
display "=================================", newline

display "Enter the number of adults : "


read quantityAdult

display "Enter the number of children : "


read quantityChild

display "Enter the entry time (in 24-hours format) : "


read entryTime

isMember == 'N"
||
isMember == "n'

Yes

fee1 = calculateAdultFee (quantityAdult)


fee2 = calculateChildFee (quantityChild)
entranceFee = fee1 + fee2

discount
discount1
discount2
totalDiscount

discount = (entranceFee * 5) / 100

dayOfWeek

display "Enter the day of the week (Weekday / Weekend) : "


read dayOfWeek

No
dayOfWeek == "Weekday"

Yes

discount2 = applyDiscount(entranceFee)

finalPrice = entranceFee - discount2 - discount - discount1


totalDiscount = entranceFee - finalPrice
member = 'no'

display "\n============Receipt=============", newline


dsiplay "Number of adults : ", quantityAdult, newline
display "Number of children : ", quantityChild, newline
display "Entry Time : ", entryTime, ".00", newline
display "Membership : ", isMember, newline
display "Day of the week : ", dayOfWeek, newline
display fix, setprecision(2)
display "Total discount : RM" , totalDiscount, newline
display "Final price : RM" , finalPrice, newline
display "=================================", newline

char response
Yes
display "Do you want to calculate entrance fee again? (Y for yes, N for no) : "
read response

No

display "Thank you for using the program. Goodbye!", newline

End

You might also like