Specific directions | Computer Science homework help

PROGRAM DESCRIPTION

RATS! You thought everything was going great in the painting design for Program #2’s small cabin, but as often happens, the user has changed his/her mind! Windows are to be added after all, so now you need less paint and have to buy some windows, instead.

SPECIFIC DIRECTIONS
In Program #2, you calculated the amount of wall & ceiling area to determine how much paint to buy, and you planned to paint the entire surface. Several changes are now needed: a specified number of windows will be planned for; and the ceiling will not be painted—too drab! Since your program will grow, there’s no better time than now to keep the design simple by incorporating functions wherever possible. Your new, improved version will use two functions to keep the logic as logical as possible!

The house specifics: still a simple rectangular structure, but now you’re only concerned with the wall surfaces—the ceiling will be handled elsewhere. You’ll still need to request the length, width, and height of the structure. Do that in main(). But, then, you’ll call two separate functions to calculate most of the details. We want to know what the total wall surface area is, how many windows are allowed/desired, and finally how much paint will be needed.

Use the following functions, by name, in your design for this program.

main: As usual. You may do all input and output in main.

calc_area: Calculate the total surface area of the walls and return the answer to main. (You’ll need

to decide which variable values need to be “sent in” to this function.)

calc_windows: Calculate and return how many windows are recommended for environmental reasons.

Use this rule: a maximum of one window for every 150 square feet of wall surface area.
(Do not recompute the area here—it was already done in calc_area.) (Hint: the answer certainly must be an even number of windows!)

Plan on installing as many windows as possible. For every window, subtract 18 square feet of area, then calculate the final paint requirements as in Program #2: 1 gallon covers 350 square feet.

After computing all the requirements, display the final painting plan for the house: the total wall surface area to be painted; number of windows to be installed; and number of gallons of paint required. In this program you must be realistic about your answers: if, for example, you calculate 4.7 windows, then certainly only 4 windows are allowed; and if you determine that 5.2 gallons of paint are needed, then 6 gallons must be purchased!

Save your program as: prog3-ii.cpp, where the letters “ii” are replaced by your own initials.

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more