Question
The price of a single pizza is 50 dirhams if you by less than 4 pizzas. For example, if you buy 2 pizzas then you
The price of a single pizza is 50 dirhams if you by less than 4 pizzas. For example, if you buy 2 pizzas then you will pay 100 dirhams. If you buy 4 to 10 pizzas then each pizza will cost 40 dirhams. If you buy more than 10 pizzas then each pizza will cost 30 dirhams. For example, if you buy 3 pizzas then you will pay 150 dirhams but buying 4 pizzas will cost 160 dirhams. If you buy 8 pizzas then you will pay 320 dirhams. Finally, if you buy 15 pizzas then you will pay 450 dirhams.
Write the algorithm to input the number of pizzas to buy and calculate the total cost. Write both the requirement analysis (input / output) and the algorithm in the answer box
note: using c++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started