1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SashulF [63]
3 years ago
5

Amanda and Tyler opened a business that specializes in shipping liquids, such as milk, juice, and water, in cylindrical containe

rs. The shipping charges depend on the amount of the liquid in the container. (For simplicity, you may assume that the container is filled to the top.) They also provide the option to paint the outside of the container for a reasonable amount. Write a program that does the following: Prompts the user to input the dimensions (in feet) of the container (radius of the base and the height). Prompts the user to input the shipping cost per liter. Prompts the user to input the paint cost per square foot. (Assume that the entire container including the top and bottom needs to be painted.) Separately outputs the shipping cost and the cost of painting. Your program must use the class cylinder Type (design in Programming Exercise 3) to store the radius of the base and the height of the container. (Note that 1 cubic feet = 28.32 liters or 1 liter = 0.353146667 cubic feet.)
Engineering
1 answer:
USPshnik [31]3 years ago
3 0

Answer:

circleType.h

#ifndef circleType_H

#define circleType_H

class circleType

{

public:

void print();

void setRadius(double r);

//Function to set the radius.

//Postcondition: if (r >= 0) radius = r;

// otherwise radius = 0;

double getRadius();

//Function to return the radius.

//Postcondition: The value of radius is returned.

double area();

//Function to return the area of a circle.

//Postcondition: Area is calculated and returned.

double circumference();

//Function to return the circumference of a circle.

//Postcondition: Circumference is calculated and returned.

circleType(double r = 0);

//Constructor with a default parameter.

//Radius is set according to the parameter.

//The default value of the radius is 0.0;

//Postcondition: radius = r;

private:

double radius;

};

#endif

circleTypeImpl.cpp

#include <iostream>

#include "circleType.h"

using namespace std;

void circleType::print()

{

cout << "Radius = " << radius

<< ", area = " << area()

<< ", circumference = " << circumference();

}

void circleType::setRadius(double r)

{

if (r >= 0)

radius = r;

else

radius = 0;

}

double circleType::getRadius()

{

return radius;

}

double circleType::area()

{

return 3.1416 * radius * radius;

}

double circleType::circumference()

{

return 2 * 3.1416 * radius;

}

circleType::circleType(double r)

{

setRadius(r);

}

cylinderType.h

#ifndef cylinderType_H

#define cylinderType_H

#include "circleType.h"

class cylinderType: public circleType

{

public:

void print();

void setHeight(double);

double getHeight();

double volume();

double area();

//returns surface area

cylinderType(double = 0, double = 0);

private:

double height;

};

#endif

cylinderTypeImpl.cpp

#include <iostream>

#include "circleType.h"

#include "cylinderType.h"

using namespace std;

cylinderType::cylinderType(double r, double h)

: circleType(r)

{

setHeight(h);

}

void cylinderType::print()

{

cout << "Radius = " << getRadius()

<< ", height = " << height

<< ", surface area = " << area()

<< ", volume = " << volume();

}

void cylinderType::setHeight(double h)

{

if (h >= 0)

height = h;

else

height = 0;

}

double cylinderType::getHeight()

{

return height;

}

double cylinderType::area()

{

return 2 * 3.1416 * getRadius() * (getRadius() + height);

}

double cylinderType::volume()

{

return 3.1416 * getRadius() * getRadius() * height;

}

main.cpp

#include <iostream>

#include <iomanip>

using namespace std;

#include "cylinderType.h"

int main()

{

double radius,height;

double shippingCostPerLi,paintCost,shippingCost=0.0;

 

cout << fixed << showpoint;

cout << setprecision(2);

cout<<"Enter the radius :";

cin>>radius;

 

cout<<"Enter the Height of the cylinder :";

cin>>height;

 

 

cout<<"Enter the shipping cost per liter :$";

cin>>shippingCostPerLi;

 

 

//Creating an instance of CylinderType by passing the radius and height as arguments

cylinderType ct(radius,height);

 

double surfaceArea=ct.area();

double vol=ct.volume();

 

 

shippingCost+=vol*28.32*shippingCostPerLi;

 

char ch;

 

cout<<"Do you want the paint the container (y/n)?";

cin>>ch;

if(ch=='y' || ch=='Y')

{

cout<<"Enter the paint cost per sq foot :$";

cin>>paintCost;    

shippingCost+=surfaceArea*paintCost;    

}    

cout<<"Total Shipping Cost :$"<<shippingCost<<endl;

 

return 0;

}

You might be interested in
Exceeding critical mach may result in the onset of compressibility effects such as:______.
klio [65]

Answer:

Sound barrier.

Explanation:

Sound barrier is a sudden increase in drag and other effects when an aircraft travels faster than the speed of sound. Other undesirable effects are experienced in the transonic stage, such as relative air movement creating disruptive shock waves and turbulence. One of the adverse effect of this sound barrier in early plane designs was that at this speed, the weight of the engine required to power the aircraft would be too large for the aircraft to carry. Modern planes have designs that now combat most of these undesirable effects of the sound barrier.

4 0
3 years ago
An electric power plant uses solid waste for fuel in the production of electricity. The cost Y in dollars per hour to produce el
andrew-mc [135]

Answer:

15.64 MW

Explanation:

The computation of value of X that gives maximum profit is shown below:-

Profit = Revenue - Cost

= 15x - 0.2x 2 - 12 - 0.3x - 0.27x 2

= 14.7x - .47x^2 - 12

After solving the above equation we will get maximum differentiate  for profit that is

14.7 - 0.94x = 0

So,

x = 15.64 MW

Therefore for computing the value of X that gives maximum profit we simply solve the above equation.

8 0
4 years ago
The metal control joints used to relieve stresses caused by expansion and contraction in large ceiling or wall expenses in inter
timurjin [86]

Answer:

It’s called Expansion Joints

6 0
3 years ago
What is the governing ratio for thin walled cylinders?
Ann [662]

Answer:

The governing ratio for thin walled cylinders is 10 if you use the radius. So if you divide the cylinder´s radius by its thickness and your result is more than 10, then you can use the thin walled cylinder stress formulas, in other words:

  • if \frac{radius}{thickness} >10 then you have a thin walled cylinder

or using the diameter:

  • if \frac{diameter}{thickness} >20 then you have a thin walled cylinder
3 0
3 years ago
Generally, final design results are rounded to or fixed to three digits because the given data cannot justify a greater display.
creativ13 [48]

Answer:

(a) 1.90 kpsi

(b) 0.40 kpsi

(c) 0.61 in.

(d) 0.009

(a) 8 MPa

(b) 1.30 cm⁴

(c) 2.04 cm⁴

(d) 62.2 MPa

Explanation:

(a) σ = M/Z, where M = 1770 lbf·in and Z = 0.943 in³.

1770/0.943 = 1876.988 lbf/in² = 1.90 kpsi

(b) σ = F/A, where F = 9440 lbf and A = 23.8 in².

9440 /23.8 = 396.639 lbf/in² = 0.4 kpsi

(c) y = Fl³/(3EI)

F = 270 lbf

l = 31.5 in.

E = 30 Mpsi

I = 0.154 in.⁴

y = 270×31.5³/(3×30×10⁶×0.154) = 0.61 in.

(d) θ = Tl/(GJ), where T = 9740 lbf·in, l = 9.85 in. G = 11.3 Mpsi, and d = 1.00 in.

J = π·d⁴/32 = π/32 in.⁴

∴ θ = 9740  × 9.85 /(11.3 × 10⁶× π/32) = 0.009

(a) σ = F/wt, where F = 1 kN, w = 25 mm, and t = 5 mm

∴ σ = 1000/(0.025 × 0.005) = 8 MPa

(b) I = bh³/12, where b = 10 mm and h = 25 mm.

10×25³/12 = 1.30 cm⁴

(c) I = π·d⁴/64 where d = 25.4 mm.

I = π × 25.4⁴/64 = 2.04 cm⁴

(d) τ = 16×T/(π×d³), where T = 25 N·m, and d = 12.7 mm.

16×25/(π×0.0127³) = 62.2 MPa.

8 0
3 years ago
Other questions:
  • The development team recently moved a new application into production for the accounting department. After this occurred, the Ch
    6·1 answer
  • a. Determine R for a series RC high-pass filter with a cutoff frequency (fc) of 8 kHz. Use a 100 nF capacitor. b. Draw the schem
    7·1 answer
  • Que es resistencia ?
    15·1 answer
  • As the impurity concentration in solid solution of a metal is increased, the tensile strength:________.a) decreasesb) increasesc
    9·1 answer
  • Do you think the mining process is faster when you know in advance that the land must be restored? Explain.
    14·1 answer
  • If you are a subcontractor in the leather and apparel industry, you might make any of the following items EXCEPT which
    7·1 answer
  • What is the most likely reason the rover won't travel in a straight line?
    9·1 answer
  • How do you explain the application of regulations in locations containing baths, showers and electric floor heating, including t
    10·1 answer
  • What is considered the greatest engineering achievement of the 20th century?
    10·1 answer
  • If a 110-volt appliance requires 20 amps, what is the total power consumed?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!