Question
Exercise: Paintball Halloween Its Halloween. You hate Halloween. You decide to shoot unpleasant paintballs at people who enter your front gate. You have two laser-targeted
Exercise: Paintball Halloween
Its Halloween.
You hate Halloween.
You decide to shoot unpleasant paintballs at people who enter your front gate. You have two laser-targeted paintball turrets by your door. You call them Stinker and Red. Stinker shoots balls filled with liquid artificial skunk stench. Red shoots balls filled with artificial blood.
You decide every adult who enters your gate will get three skunkballs, and five bloodballs. Every teenage will get four skunkballs, and three bloodballs. Every tween will get one skunkball, and one bloodball. Younger kids wont be shot at. Their turn will come.
You use high-quality paintballs. Skunkballs cost you $0.25 each, and bloodballs $0.07 each.
Write a program to compute the number of each ball type youll need and their total cost, given a number of adults, teens, and tweens. Heres a screenshot:
Round the cost to the neatest cent. Its OK to leave off the last digit if its zero, as in the sample output above. Check the rounding numbers hint; it might be useful.
All inputs should be numeric, and not less than zero. Your program should show an error message and stop when theres an error. For example:
Your program can stop immediately when it detects an error, or show all applicable error messages and then stop. Your choice.
You must use subroutines. Use three at least: input, processing, and output. You may use more if you want.
The usual coding standards apply.
1 Halloween Planner 3 Adults: 12 32 4 Teenagers: 5 Tweens: 39 Run 9 Skunk balls: 203 10 Blood balls: 195 12 Total cost: 64.4Step 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