Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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:

image text in transcribed

image text in transcribed

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.4

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Watson Watson

5th Edition

0471715360, 978-0471715368

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago