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
For a turbulent flow of a fluid in 0.6 m diameter pipe, the velocity 0.15 m from the wall is 2.7 m/s. Estimate the wall shear st
MAVERICK [17]

Answer:

If the turbulent velocity profile in a pipe of diameter 0.6 m may be approximated by u/U=(y/R)^(1/7), where u is in m/s and y is in m and 0.15 m from the pipe.

Explanation:

hope it helps

3 0
2 years ago
The total solids production rate in an activated sludge aeration tank is 7240 kg/d on a dry mass basis. It is necessary to maint
snow_lady [41]

Answer:

volume of biological sludge = 28.566 m³ per day

Explanation:

given data

mass of solid = 7240 kg/day

initial moisture content = 78%

solution

here percentage of solid will be

% of solid = 100 - initial moisture content

% of solid = 100 - 78 = 22 %

so that

mass of sludge produced = \frac{100}{100 - P} M kg  per day

put her value

mass of sludge produced = \frac{100}{100 - 78} 7240 kg

mass of sludge produced = 32909.09 kg

so

specific gravity of sludge =  \frac{\rho sludge}{\rho water }

and as we know that

\frac{100}{S sludge} = \frac{solid percentage}{S solid} = \frac{water percentage}{S water}

\frac{100}{S sludge} = \frac{22}{2.5} = \frac{78}{1}

S sludge = 1.152

so that

density of sludge = S sludge × density of water

density of sludge = 1.152 × 1000

density of sludge = 1152 kg/m³

so that

volume of biological sludge = \frac{mass sludge produce}{\rho sludge}

volume of biological sludge = \frac{32909.09}{1152}

volume of biological sludge = 28.566 m³ per day

6 0
3 years ago
What is noise definition in physics<br><br>​
Bess [88]

Answer:

Noise or sound is the energy produced by sounding object which can be felt by our hearing organs .

Explanation:

Noise is produced by vibration in a body.

4 0
2 years ago
A 20-mm-diameter steel bar is to be used as a torsion spring. If the torsional stress in the bar is not to exceed 110 MPa when o
ch4aika [34]

Answer:

1.887 m

Explanation:

(15 *pi)/180

= 0.2618 rad

Polar moment

= Pi*d⁴/32

= (22/7*20⁴)/32

= 15707.96

Torque on shaft

= ((22/7)*20³*110)/16

= 172857.14

= 172.8nm

Shear modulus

G = 79.3

L = Gjθ/T

= 79.3x10⁹x(1.571*10^-8)x0.2618/172.8

= 1.887 m

The length of the bar is therefore 1.887 meters

5 0
3 years ago
If the tank is designed to withstand a pressure of 5 MPaMPa, determine the required minimum wall thickness to the nearest millim
dmitriy555 [2]

Answer: hello some aspects of your question is missing below is the missing information

The gas tank is made from A-36 steel and has an inner diameter of 1.50 m.

answer:

≈ 22.5 mm

Explanation:

Given data:

Inner diameter = 1.5 m

pressure = 5 MPa

factor of safety = 1.5

<u>Calculate the required minimum wall thickness</u>

maximum-shear-stress theory ( σ allow ) = σγ / FS

                                                  = 250(10)^6 / 1.5  = 166.67 (10^6) Pa

given that |σ| = σ allow  

3.75 (10^6) / t = 166.67 (10^6)

∴ t ( wall thickness ) = 0.0225 m   ≈ 22.5 mm

4 0
2 years ago
Other questions:
  • The difference between ideal voltage source and the ideal current source​
    7·2 answers
  • Not much of a question :/ dont answer
    9·1 answer
  • You are preparing to work with Chemical A. You open the appropriate storage cabinet, and notice Chemical B, as well as Chemical
    9·1 answer
  • You are using a Geiger counter to measure the activity of a radioactive substance over the course of several minutes. If the rea
    6·1 answer
  • Why does an aeroplane smoke in the air​
    14·1 answer
  • A room is kept at −5°C by a vapor-compression refrigeration cycle with R-134a as the refrigerant. Heat is rejected to cooling wa
    7·2 answers
  • A specimen of some metal having a rectangular cross section 10.4 mm × 12.8 mm is pulled in tension with a force of 15900 N, whic
    6·1 answer
  • Match the military operation to the category of satellite that would perform it.
    15·1 answer
  • In multi-grade oil what is W means?
    11·1 answer
  • Question 40 and the next Question 41
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!