C++ Program Code

I have attached the instructions.  Need full C++ code.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

 

Thanks!

#4

CPT 232—C++ PROGRAMMING I

Program #4

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

Due Date: _________________


PROGRAM DESCRIPTION

Those pesky town officials are tough to please! And that means the design for Summerville SeaWorld™ is gonna take longer than expected. The town council is still a bit cranky over our plan to use so much water in a commercial enterprise. (Haven’t they heard of Lakes Marion and Moultrie?!) So, the principal feature of the park, the proposed porpoise pond (just had to say that for a bit of alliteration), is about to undergo some redesigning. Now, we will be informed as to the maximum amount of water we can use in the tank, after a possibly touchy town discussion scheduled at the next fortnightly meeting. (Wonder how often that really is? )

But we can’t afford to wait around without lining up some contractors to start making preparations for the tank’s support. So, what’s needed now is for you to revise the program you wrote and take the tank’s size in gallons as input, then plan the rest around that. The program will surely be done long before we have the final word, but we can use the program as an estimator for various options, cost figures, etc.

SPECIFIC DIRECTIONS

This time, your program must have an introduction that explains to the user how the program works and how to respond to your prompts—for example, what units of measure to use. But now you will be planning “backwards” from the original calculations. Ask for the user’s name—that’s always a good thing to do—and then ask for the volume of water for the tank in gallons. Once you have that, you are ready to convert it to an appropriate cubic measure. As before, assume we will fill the tank to the 11-foot level. Now, you can use the cylinder formula “in reverse” and calculate the radius of the proposed porpoise pond. (Sorry, that’s the last time I’ll do that!)

Remember that the surrounding dome is going to have a diameter three times the diameter of the pond, so you can calculate that easily. And as before, you will need to calculate the areas of the two circles, the pond and the dome, in order to figure out the area under each one.

Next, there are a couple of important decisions to make. We have been speculating about changing the kind of seats for the “splashees”, our paying customers. The original type of seat we thought about using, the 5.5 square foot seat, is similar to an upright wooden deck chair, and we’ve been getting nervous glances from our insurance team who think some customers might bolt from the waves of water coming at them and trip over flailing chairs. Maybe we need to rethink that. So, we are also considering a bolted down, plastic chair that takes up a bit less room, meaning more chairs could be installed in the same space. Seating more customers would be a good thing! As a new part of your program, you will ask for a decision on the seat type.

One other decision: we currently have quotes from five contractors to build the super-reinforced concrete support under the pond. So, you will present the quotes and ask for the final decision on that contractor. (For now, we won’t worry about deciding on the contractor for the concrete base under the seating area.)

Seat calculation. Remember that the seats can take up only one-half of the area under the dome and around the pond. (And of course remember that the pond area depends on the number of gallons inputted by the user.) Calculate and display to the user how many seats of each type will fit in the calculated area. For the wooden deck chairs, use the previous figure of 5.5 square feet per seat. For the fixed, bolted down plastic seats, use a figure of 4.8 square feet. After you have displayed the two seat numbers, ask the user which seat will be selected. Don’t ask them to input the number of seats or to type in a name like “wood”: give them a simple choice like 1 or 2 or a single letter to input for their choice. Once you have their choice, you can go about finalizing how many seats to install.

Base for the pond. There are currently five contractors who wish to bid on installing the concrete support under the pond, and each of them has provided a dollar cost per square foot of laying the super-reinforced concrete. What you need to do is to display a summary table of these costs. This is what the bid table needs to look like:

BID TABLE

BID

CONTRACTOR ID

BID AMOUNT ($ PRICE PER SQ FT)

TOTAL BID FOR JOB

1

11237

37.75

[computed value]

2

10979

38.95

3

21352

44.99

4

22976

45.35

5

33209

22.85

The contractor ID numbers and their bid cost per square foot are data we got from each of the contractors. What you need to do is compute the total bid amount for each one and list that in the fourth column for each of the five contractors. After displaying the table, ask the user to select their choice of contractor. (Do not ask the user to input the contractor’s ID number or the bid amount: you must accept only the line or bid number: 1…5. That makes for user-friendly software!) After the user makes a selection, you can determine the appropriate cost per sq ft and the total cost of the concrete support.

After you’ve computed all the information, display it to the user. Be sure to display all of the following in your final report: the pond and the dome diameters; the area and cost of the concrete under the pond; the area under the dome, not including the pond; the number of seats to be installed; and the number of gallons of water to fill the pond to the 11 foot level. (Of course, we inputted that at the beginning.) This information must be presented to the user as some sort of commercial plan. Don’t use a bunch of simple sentences with values at the end…boring! From now on your output will be graded for the professionalism of the final display. In all of your displays, use two decimals for all dollar figures and one decimal for any other floating point values. This sort of formatting will be graded for the remaining programs.

This C++ solution should be Program4 Solution name
. Zip the solution for submitting, as usual.

TURN IN: a data dictionary for this program, a complete flowchart, and the zipped solution directory. Submit everything using the Dropbox in D2L.

SOME FORMULAS/CONVERSIONS

Area of a circle: πr2 (where r is the circle’s radius)

Volume of a cylinder: πr2h (r is radius; h is the cylinder’s height)

Volume of a sphere: 4/3πr3 (again, r is radius)

Change gallons to cubic feet: multiply gallons (of water) by 0.13368 (EG 10 gallons = 1.3368 cubic feet)

FINDING THE SQUARE ROOT

By studying the formulas it should become obvious that you will need to calculate a square root to determine the radius of the pond, which is a cylinder. Here’s how. The formula for radius would be the square root of the value of volume divided by PI times the height. A simple way to get the square root is to use a function in the cmath library, so you will need to have this in your “include” area of the program: #include

Now, just call the math function “sqrt” for the square root and place the expression inside parentheses. Suppose that I have these variables declared: pradius for the pond radius; pvolume for the volume of the pond water in cubic feet (not gallons!); and pheight for the height of the pond water (assumed to be 11 feet). Then, the assignment statement to find the radius would look like this now:

pradius = sqrt (pvolume / (3.14159265 * pheight));

//You could use M_PI from the cmath library! To do that, don’t forget to also #define _USE_MATH_DEFINES

That’s all there is to it!

EXTRA CREDIT (10 pts):

Ask the user to choose between three different seat contractors. Right after the user selects the type of seat to install, give them the following information. Contractor #1 can install the seats for $39.95 per seat; Contractor #2 will do it for $34.50 per seat; and Contractor #3 has stated they can do it for $43.95 per seat. (Don’t worry about the two different types of seats—just go with the one cost figure per contractor.) Tell the user the total seat installation cost for each of the contractors, and then ask the user to choose between the 3 contractors. In the final report, then, display the total cost for installation of all the seats.

Example run for this program.
Let’s say the program starts out this way:

JONES PROGRAMMING, INC

DESIGN FOR SUMMERVILLE SEAWORLD

May I please have your name first: Dave

OK, Dave, we’ll need some important figures to get the planning done. Please input things when you are prompted. Most figures will be simple whole numbers. Please don’t use any commas in the numbers you input.

First, please input the number of gallons to be used in the porpoise pond: 200000

OK, if we fill the pond to the 11-foot level with 200,000 gallons of water, that will make the pond 55.6 feet in diameter. If you plan to tell the contractor a round number of feet, be sure to tell them a lower number! If you round up, the pond will use too much water, and that could cause legal troubles!

Now, Dave, let’s decide on what type of seats to buy. The two options are wooden deck chairs and bolted down plastic seats. Since the plastic seats are a bit smaller, you can put more of them in the available space. Here are the two options, showing how many seats of each type can be installed:

1 Wooden seats 1767

2 Plastic seats 2025

Please enter 1 for wooden and 2 for plastic: 2

OK, we will purchase the plastic seats.

Now, Dave, it’s time to decide on which contractor will lay the concrete under the pond. Here are the five bids:

BID

CONTRACTOR ID

BID AMOUNT ($ COST PER SQ FT)

TOTAL BID FOR JOB

1

11237

37.75

$91,753.09

2

10979

38.95

$94,669.75

3

21352

44.99

$109,350.24

4

22976

45.35

$110,225.24

5

33209

22.85

$55,537.96

Which concrete contractor will it be (1, 2, 3, 4, 5): 2

JONES DATA CONSULTANTS, INC

DESIGN FOR SUMMERVILLE SEAWORLD (V1.0)

POND VALUES

———————

Diameter: 55.6 feet

Area: 2430.5 square feet

Concrete cost: $94,669.75

Gallons of water: 200,000 (fills to the 11-foot mark)

DOME VALUES

———————

Diameter 166.9 feet

Area open under dome: 19,444.4 square feet

# seats: 2025 (to fill half of the available dome area)

Please let us know if you need any further information. It’s been a pleasure to meet your needs!

Page 1 of 4

Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER