SlideShare uma empresa Scribd logo
1 de 10
#4CPT 232—C++ PROGRAMMING I
Program #4
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
ingallons. 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 <cmath>
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:
1Wooden seats1767
2Plastic seats2025
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
<Clear the screen, so the final report will look professional.>
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
---------------------
Diameter166.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

Mais conteúdo relacionado

Semelhante a #4CPT 232—C++ PROGRAMMING IProgram #4Due Date _______.docx

Multiple Choice1.There are fundamental challenges in managing.docx
Multiple Choice1.There are fundamental challenges in managing.docxMultiple Choice1.There are fundamental challenges in managing.docx
Multiple Choice1.There are fundamental challenges in managing.docxroushhsiu
 
FluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docx
FluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docxFluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docx
FluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docxvoversbyobersby
 
Delivery DroneVIDEODesign ProblemIn todays.docx
Delivery DroneVIDEODesign ProblemIn todays.docxDelivery DroneVIDEODesign ProblemIn todays.docx
Delivery DroneVIDEODesign ProblemIn todays.docxcargillfilberto
 
Calculator_Instructions_energy_maths_phy
Calculator_Instructions_energy_maths_phyCalculator_Instructions_energy_maths_phy
Calculator_Instructions_energy_maths_physsuzan2023
 
An Improved Personal Cellphone Fan
An Improved Personal Cellphone FanAn Improved Personal Cellphone Fan
An Improved Personal Cellphone FanpshsTECH
 
Die casting die design process
Die casting die design processDie casting die design process
Die casting die design processShuvamKumar9
 
introduction to plumbing Part 2
 introduction to plumbing Part 2 introduction to plumbing Part 2
introduction to plumbing Part 2vigyanashram
 
Elements of DesignCostume DesignLineLong lines.docx
Elements of DesignCostume DesignLineLong lines.docxElements of DesignCostume DesignLineLong lines.docx
Elements of DesignCostume DesignLineLong lines.docxSALU18
 
Introduction to plumbing part 2
 Introduction to plumbing part 2 Introduction to plumbing part 2
Introduction to plumbing part 2vigyanashram
 
The Role of CFD in Real Life Designs
The Role of CFD in Real Life DesignsThe Role of CFD in Real Life Designs
The Role of CFD in Real Life DesignsSOLIDWORKS
 
Use of Flow Simulation in designing a Suction Pump
Use of Flow Simulation in designing a Suction Pump Use of Flow Simulation in designing a Suction Pump
Use of Flow Simulation in designing a Suction Pump Kavita Aroor
 
Exercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docxExercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docxgitagrimston
 
10 Tips to Squeeze your Embedded Design or Product
10 Tips to Squeeze your Embedded Design or Product10 Tips to Squeeze your Embedded Design or Product
10 Tips to Squeeze your Embedded Design or ProductPallav Aggarwal
 
InRoads V8i Templates Library Creation
InRoads V8i Templates Library CreationInRoads V8i Templates Library Creation
InRoads V8i Templates Library CreationJoe Lukovits
 
Airless Spray Techniques
Airless Spray TechniquesAirless Spray Techniques
Airless Spray TechniquesTony Loup
 
Department of Mechanical Engineering ME 440 Project D
 Department of Mechanical Engineering ME 440 Project D Department of Mechanical Engineering ME 440 Project D
Department of Mechanical Engineering ME 440 Project Dtroutmanboris
 
Department of Mechanical Engineering ME 440 Project D.docx
 Department of Mechanical Engineering ME 440 Project D.docx Department of Mechanical Engineering ME 440 Project D.docx
Department of Mechanical Engineering ME 440 Project D.docxShiraPrater50
 

Semelhante a #4CPT 232—C++ PROGRAMMING IProgram #4Due Date _______.docx (20)

Multiple Choice1.There are fundamental challenges in managing.docx
Multiple Choice1.There are fundamental challenges in managing.docxMultiple Choice1.There are fundamental challenges in managing.docx
Multiple Choice1.There are fundamental challenges in managing.docx
 
FluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docx
FluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docxFluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docx
FluidFlowFluidFlow.pdfPROJECT FLUID FLOW  The u.docx
 
Matrix Bills
Matrix BillsMatrix Bills
Matrix Bills
 
Delivery DroneVIDEODesign ProblemIn todays.docx
Delivery DroneVIDEODesign ProblemIn todays.docxDelivery DroneVIDEODesign ProblemIn todays.docx
Delivery DroneVIDEODesign ProblemIn todays.docx
 
Calculator_Instructions_energy_maths_phy
Calculator_Instructions_energy_maths_phyCalculator_Instructions_energy_maths_phy
Calculator_Instructions_energy_maths_phy
 
An Improved Personal Cellphone Fan
An Improved Personal Cellphone FanAn Improved Personal Cellphone Fan
An Improved Personal Cellphone Fan
 
Die casting die design process
Die casting die design processDie casting die design process
Die casting die design process
 
introduction to plumbing Part 2
 introduction to plumbing Part 2 introduction to plumbing Part 2
introduction to plumbing Part 2
 
Elements of DesignCostume DesignLineLong lines.docx
Elements of DesignCostume DesignLineLong lines.docxElements of DesignCostume DesignLineLong lines.docx
Elements of DesignCostume DesignLineLong lines.docx
 
Introduction to plumbing part 2
 Introduction to plumbing part 2 Introduction to plumbing part 2
Introduction to plumbing part 2
 
The Role of CFD in Real Life Designs
The Role of CFD in Real Life DesignsThe Role of CFD in Real Life Designs
The Role of CFD in Real Life Designs
 
Use of Flow Simulation in designing a Suction Pump
Use of Flow Simulation in designing a Suction Pump Use of Flow Simulation in designing a Suction Pump
Use of Flow Simulation in designing a Suction Pump
 
Exercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docxExercise Problems for Chapter 5Numerical example on page 203Pe.docx
Exercise Problems for Chapter 5Numerical example on page 203Pe.docx
 
LINEAR OPTIMIZATION
LINEAR OPTIMIZATIONLINEAR OPTIMIZATION
LINEAR OPTIMIZATION
 
10 Tips to Squeeze your Embedded Design or Product
10 Tips to Squeeze your Embedded Design or Product10 Tips to Squeeze your Embedded Design or Product
10 Tips to Squeeze your Embedded Design or Product
 
CFD & ANSYS FLUENT
CFD & ANSYS FLUENTCFD & ANSYS FLUENT
CFD & ANSYS FLUENT
 
InRoads V8i Templates Library Creation
InRoads V8i Templates Library CreationInRoads V8i Templates Library Creation
InRoads V8i Templates Library Creation
 
Airless Spray Techniques
Airless Spray TechniquesAirless Spray Techniques
Airless Spray Techniques
 
Department of Mechanical Engineering ME 440 Project D
 Department of Mechanical Engineering ME 440 Project D Department of Mechanical Engineering ME 440 Project D
Department of Mechanical Engineering ME 440 Project D
 
Department of Mechanical Engineering ME 440 Project D.docx
 Department of Mechanical Engineering ME 440 Project D.docx Department of Mechanical Engineering ME 440 Project D.docx
Department of Mechanical Engineering ME 440 Project D.docx
 

Mais de katherncarlyle

After reading chapter 4, evaluate the history of the Data Encryp.docx
After reading chapter 4, evaluate the history of the Data Encryp.docxAfter reading chapter 4, evaluate the history of the Data Encryp.docx
After reading chapter 4, evaluate the history of the Data Encryp.docxkatherncarlyle
 
After reading Chapter 2 and the Required Resources please discuss th.docx
After reading Chapter 2 and the Required Resources please discuss th.docxAfter reading Chapter 2 and the Required Resources please discuss th.docx
After reading Chapter 2 and the Required Resources please discuss th.docxkatherncarlyle
 
After reading chapters 16 and 17 post a short reflection, approximat.docx
After reading chapters 16 and 17 post a short reflection, approximat.docxAfter reading chapters 16 and 17 post a short reflection, approximat.docx
After reading chapters 16 and 17 post a short reflection, approximat.docxkatherncarlyle
 
After reading chapter 3, analyze the history of Caesar Cypher an.docx
After reading chapter 3, analyze the history of Caesar Cypher an.docxAfter reading chapter 3, analyze the history of Caesar Cypher an.docx
After reading chapter 3, analyze the history of Caesar Cypher an.docxkatherncarlyle
 
After having learned about Cognitive Psychology and Humaistic Psycho.docx
After having learned about Cognitive Psychology and Humaistic Psycho.docxAfter having learned about Cognitive Psychology and Humaistic Psycho.docx
After having learned about Cognitive Psychology and Humaistic Psycho.docxkatherncarlyle
 
Advisory from Professionals Preparing Information .docx
Advisory from Professionals Preparing Information .docxAdvisory from Professionals Preparing Information .docx
Advisory from Professionals Preparing Information .docxkatherncarlyle
 
After completing the assigned readings and watching the provided.docx
After completing the assigned readings and watching the provided.docxAfter completing the assigned readings and watching the provided.docx
After completing the assigned readings and watching the provided.docxkatherncarlyle
 
Advocacy is a vital component of the early childhood professiona.docx
Advocacy is a vital component of the early childhood professiona.docxAdvocacy is a vital component of the early childhood professiona.docx
Advocacy is a vital component of the early childhood professiona.docxkatherncarlyle
 
After completing this weeks assignment...   Share with your classma.docx
After completing this weeks assignment...   Share with your classma.docxAfter completing this weeks assignment...   Share with your classma.docx
After completing this weeks assignment...   Share with your classma.docxkatherncarlyle
 
African Americans men are at a greater risk for developing prostate .docx
African Americans men are at a greater risk for developing prostate .docxAfrican Americans men are at a greater risk for developing prostate .docx
African Americans men are at a greater risk for developing prostate .docxkatherncarlyle
 
Advances over the last few decades have brought innovative and c.docx
Advances over the last few decades have brought innovative and c.docxAdvances over the last few decades have brought innovative and c.docx
Advances over the last few decades have brought innovative and c.docxkatherncarlyle
 
Advocacy is a vital component of the early childhood professional’s .docx
Advocacy is a vital component of the early childhood professional’s .docxAdvocacy is a vital component of the early childhood professional’s .docx
Advocacy is a vital component of the early childhood professional’s .docxkatherncarlyle
 
Advocacy Through LegislationIdentify a problem or .docx
Advocacy Through LegislationIdentify a problem or .docxAdvocacy Through LegislationIdentify a problem or .docx
Advocacy Through LegislationIdentify a problem or .docxkatherncarlyle
 
Advanced pathoRespond to Stacy and Sonia 1 day agoStacy A.docx
Advanced pathoRespond to  Stacy and Sonia 1 day agoStacy A.docxAdvanced pathoRespond to  Stacy and Sonia 1 day agoStacy A.docx
Advanced pathoRespond to Stacy and Sonia 1 day agoStacy A.docxkatherncarlyle
 
After completing the reading this week, we reflect on a few ke.docx
After completing the reading this week, we reflect on a few ke.docxAfter completing the reading this week, we reflect on a few ke.docx
After completing the reading this week, we reflect on a few ke.docxkatherncarlyle
 
Adopting Enterprise Risk Management inToday’s Wo.docx
Adopting Enterprise Risk Management inToday’s Wo.docxAdopting Enterprise Risk Management inToday’s Wo.docx
Adopting Enterprise Risk Management inToday’s Wo.docxkatherncarlyle
 
Addisons diseaseYou may use the textbook as one reference a.docx
Addisons diseaseYou may use the textbook as one reference a.docxAddisons diseaseYou may use the textbook as one reference a.docx
Addisons diseaseYou may use the textbook as one reference a.docxkatherncarlyle
 
AdultGeriatric DepressionIntroduction According to Mace.docx
AdultGeriatric DepressionIntroduction According to Mace.docxAdultGeriatric DepressionIntroduction According to Mace.docx
AdultGeriatric DepressionIntroduction According to Mace.docxkatherncarlyle
 
Adopt-a-Plant Project guidelinesOverviewThe purpose of this.docx
Adopt-a-Plant Project guidelinesOverviewThe purpose of this.docxAdopt-a-Plant Project guidelinesOverviewThe purpose of this.docx
Adopt-a-Plant Project guidelinesOverviewThe purpose of this.docxkatherncarlyle
 
Adolescent development is broad and wide-ranging, including phys.docx
Adolescent development is broad and wide-ranging, including phys.docxAdolescent development is broad and wide-ranging, including phys.docx
Adolescent development is broad and wide-ranging, including phys.docxkatherncarlyle
 

Mais de katherncarlyle (20)

After reading chapter 4, evaluate the history of the Data Encryp.docx
After reading chapter 4, evaluate the history of the Data Encryp.docxAfter reading chapter 4, evaluate the history of the Data Encryp.docx
After reading chapter 4, evaluate the history of the Data Encryp.docx
 
After reading Chapter 2 and the Required Resources please discuss th.docx
After reading Chapter 2 and the Required Resources please discuss th.docxAfter reading Chapter 2 and the Required Resources please discuss th.docx
After reading Chapter 2 and the Required Resources please discuss th.docx
 
After reading chapters 16 and 17 post a short reflection, approximat.docx
After reading chapters 16 and 17 post a short reflection, approximat.docxAfter reading chapters 16 and 17 post a short reflection, approximat.docx
After reading chapters 16 and 17 post a short reflection, approximat.docx
 
After reading chapter 3, analyze the history of Caesar Cypher an.docx
After reading chapter 3, analyze the history of Caesar Cypher an.docxAfter reading chapter 3, analyze the history of Caesar Cypher an.docx
After reading chapter 3, analyze the history of Caesar Cypher an.docx
 
After having learned about Cognitive Psychology and Humaistic Psycho.docx
After having learned about Cognitive Psychology and Humaistic Psycho.docxAfter having learned about Cognitive Psychology and Humaistic Psycho.docx
After having learned about Cognitive Psychology and Humaistic Psycho.docx
 
Advisory from Professionals Preparing Information .docx
Advisory from Professionals Preparing Information .docxAdvisory from Professionals Preparing Information .docx
Advisory from Professionals Preparing Information .docx
 
After completing the assigned readings and watching the provided.docx
After completing the assigned readings and watching the provided.docxAfter completing the assigned readings and watching the provided.docx
After completing the assigned readings and watching the provided.docx
 
Advocacy is a vital component of the early childhood professiona.docx
Advocacy is a vital component of the early childhood professiona.docxAdvocacy is a vital component of the early childhood professiona.docx
Advocacy is a vital component of the early childhood professiona.docx
 
After completing this weeks assignment...   Share with your classma.docx
After completing this weeks assignment...   Share with your classma.docxAfter completing this weeks assignment...   Share with your classma.docx
After completing this weeks assignment...   Share with your classma.docx
 
African Americans men are at a greater risk for developing prostate .docx
African Americans men are at a greater risk for developing prostate .docxAfrican Americans men are at a greater risk for developing prostate .docx
African Americans men are at a greater risk for developing prostate .docx
 
Advances over the last few decades have brought innovative and c.docx
Advances over the last few decades have brought innovative and c.docxAdvances over the last few decades have brought innovative and c.docx
Advances over the last few decades have brought innovative and c.docx
 
Advocacy is a vital component of the early childhood professional’s .docx
Advocacy is a vital component of the early childhood professional’s .docxAdvocacy is a vital component of the early childhood professional’s .docx
Advocacy is a vital component of the early childhood professional’s .docx
 
Advocacy Through LegislationIdentify a problem or .docx
Advocacy Through LegislationIdentify a problem or .docxAdvocacy Through LegislationIdentify a problem or .docx
Advocacy Through LegislationIdentify a problem or .docx
 
Advanced pathoRespond to Stacy and Sonia 1 day agoStacy A.docx
Advanced pathoRespond to  Stacy and Sonia 1 day agoStacy A.docxAdvanced pathoRespond to  Stacy and Sonia 1 day agoStacy A.docx
Advanced pathoRespond to Stacy and Sonia 1 day agoStacy A.docx
 
After completing the reading this week, we reflect on a few ke.docx
After completing the reading this week, we reflect on a few ke.docxAfter completing the reading this week, we reflect on a few ke.docx
After completing the reading this week, we reflect on a few ke.docx
 
Adopting Enterprise Risk Management inToday’s Wo.docx
Adopting Enterprise Risk Management inToday’s Wo.docxAdopting Enterprise Risk Management inToday’s Wo.docx
Adopting Enterprise Risk Management inToday’s Wo.docx
 
Addisons diseaseYou may use the textbook as one reference a.docx
Addisons diseaseYou may use the textbook as one reference a.docxAddisons diseaseYou may use the textbook as one reference a.docx
Addisons diseaseYou may use the textbook as one reference a.docx
 
AdultGeriatric DepressionIntroduction According to Mace.docx
AdultGeriatric DepressionIntroduction According to Mace.docxAdultGeriatric DepressionIntroduction According to Mace.docx
AdultGeriatric DepressionIntroduction According to Mace.docx
 
Adopt-a-Plant Project guidelinesOverviewThe purpose of this.docx
Adopt-a-Plant Project guidelinesOverviewThe purpose of this.docxAdopt-a-Plant Project guidelinesOverviewThe purpose of this.docx
Adopt-a-Plant Project guidelinesOverviewThe purpose of this.docx
 
Adolescent development is broad and wide-ranging, including phys.docx
Adolescent development is broad and wide-ranging, including phys.docxAdolescent development is broad and wide-ranging, including phys.docx
Adolescent development is broad and wide-ranging, including phys.docx
 

Último

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxElton John Embodo
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataBabyAnnMotar
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 

Último (20)

HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
EMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docxEMBODO Lesson Plan Grade 9 Law of Sines.docx
EMBODO Lesson Plan Grade 9 Law of Sines.docx
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
Measures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped dataMeasures of Position DECILES for ungrouped data
Measures of Position DECILES for ungrouped data
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 

#4CPT 232—C++ PROGRAMMING IProgram #4Due Date _______.docx

  • 1. #4CPT 232—C++ PROGRAMMING I Program #4 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
  • 2. 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 ingallons. 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
  • 3. 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
  • 4. “ 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
  • 5. 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
  • 6. 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 <cmath> 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.
  • 7. (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
  • 8. 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: 1Wooden seats1767 2Plastic seats2025 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
  • 9. $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 <Clear the screen, so the final report will look professional.> JONES DATA CONSULTANTS, INC DESIGN FOR SUMMERVILLE SEAWORLD (V1.0)
  • 10. 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 --------------------- Diameter166.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