Asked by Hollie
I haven't done this before and I need some help starting this:
A programmer is writing a total ticket price calculator for a theme park. The park offers the price of £13 per adults and £8 per child. There is a bulk purchase discount of 10% off the total price if there are more than 5 people.
Write an algorithm that:
Asks for the number of adult tickets
Asks for the number of child tickets
Calculate the total price
Checks to see if there are more than five people and applies the appropriate discount
Produces the appropriate ticket price
A programmer is writing a total ticket price calculator for a theme park. The park offers the price of £13 per adults and £8 per child. There is a bulk purchase discount of 10% off the total price if there are more than 5 people.
Write an algorithm that:
Asks for the number of adult tickets
Asks for the number of child tickets
Calculate the total price
Checks to see if there are more than five people and applies the appropriate discount
Produces the appropriate ticket price
Answers
Answered by
bobpursley
algorithm
Adults? Store Adults in Adults
Children? Store Children in Children
totaal price=13*ADULTS +8*Children
If Adults +children >5, then total price=.9*total price
otherwise go to finish
Finish: Print: Total price
Adults? Store Adults in Adults
Children? Store Children in Children
totaal price=13*ADULTS +8*Children
If Adults +children >5, then total price=.9*total price
otherwise go to finish
Finish: Print: Total price
Answered by
bobpursley
you could add this subroutine...
If Children > 7*Adults then
? That is quite a lot of children to supervise at once. Are you certain?
Input answer: if Yes, then go to total price. otherwise, go in Adults?
If Children > 7*Adults then
? That is quite a lot of children to supervise at once. Are you certain?
Input answer: if Yes, then go to total price. otherwise, go in Adults?
Answered by
guman poon
80% efficient
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.