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
Cavitation usually occurs because:
IgorLugansk [536]

Answer:

B) the liquid accelerated to high velocities.

<em>I</em><em> </em><em>hope</em><em> </em><em>this helps</em><em> </em>

3 0
3 years ago
Witch truck company is better.<br><br> Ram <br> Ford <br> Toyoda<br> GMC
arlik [135]
Ram is the better truck company
7 0
3 years ago
Read 2 more answers
A stainless steel ball (=8055 kg/m3, Cp= 480 J/kgK) of diameter D =15 cm is removed from theoven at a uniform temperature of 3
aleksandrvk [35]

Answer:

i) 25.04 W/m^2 .k

ii) 23.82 minutes = 1429.2 secs

Explanation:

Given data:

Diameter of steel ball = 15 cm

uniform temperature = 350°C

p = 8055 kg/m^3

Cp = 480 J/kg.k

surface temp of ball drops to  250°C

average surface temperature = ( 350 + 250 ) / 2 = 300°C

<u>i) Determine the average convection heat transfer coefficient during the cooling process</u>

<em>Note : Obtain the properties of air at 1 atm at average film temp of 30°C from the table  " properties of air "  contained in your textbook</em>

average convection heat transfer coefficient = 25.04 W/m^2 .k

<u>ii) Determine how long this process has taken </u>

Time taken by the process = 23.82 minutes = 1429.2 seconds

Δt = Qtotal / Qavg = 683232 / 477.92 = 1429.59 secs

attached below is the detailed solution of the given question

3 0
3 years ago
Determine the design moment strength for a W21x73 steel beam with a simple span of 18 ft when lateral bracing for the compressio
SVETLANKA909090 [29]

This question is incomplete, the complete question is;

Determine the design moment strength (ϕMn) for a W21x73 steel beam with a simple span of 18 ft when lateral bracing for the compression flange is provided at the ends only (i.e., Lb = 18 ft). Report the result in kip-ft.

Use Fy=50 ksi and assume Cb=1.0 (if needed).

Answer: the design moment strength for the W21x73 steel beam is 566.25 f-ft

Explanation:

Given that;

section  W 21 x 73 steel beam;

now from the steel table table for this section;

Zx = Sx = 151 in³

also given that; fy = 50 ksi and Cb = 1.0

QMn = 0.9 × Fy × Zx

so we substitute

QMn = 0.9 × 50 × 151

QMn = 6795 k-inch

we know that;

12inch equals 1 foot

so

QMn = 6795 k-inch / 12

QMn = 566.25 f-ft

Therefore the design moment strength for the W21x73 steel beam is 566.25 f-ft

7 0
3 years ago
A disk is rotating around an axis located at its center. The angular velocity is 0.5 rad/s. The radius of the disk is 0.4 m. Wha
dimaraw [331]

Answer:

0.2 m/s

Explanation:

The velocity of a point on the edge of a disk rotating disk can be calculated as:

v=\omega*r

Where \omega is the angular velocity and r the radius of the disk. This leads to:

v=0.5\,rad/s\,*\,0.4\,m=0.2\,m/s

4 0
3 years ago
Read 2 more answers
Other questions:
  • Vending machine controller (adapted from Katz, "Contemporary Logic Design") Design and implement a finite state machine that con
    10·1 answer
  • An air-standard cycle with constant specific heats at room temperature is executed in a closed system with 0.003 kg of air and c
    15·1 answer
  • Air at atmospheric pressure and at 300K flows with a velocity of 1.5m/s over a flat plate. The transition from laminar to turbul
    13·1 answer
  • A motor cycle is moving up an incline of 1 in 30 at a speed of 80 km/h,and then suddenly the engine shuts down.The tractive resi
    11·1 answer
  • Filler metals range in diameter from 1/16" to 3/8"*<br> O<br> true<br> O False
    15·1 answer
  • Hi all, could you solve this please?<br> What is the value of the resistance R
    14·1 answer
  • The difference in quantity between the add and full marks on an engine oil dipstick is typically
    5·1 answer
  • A three-phase Y-connected 50-Hz two-pole synchronous machine has a stator with 2000 turns of wire per phase. What rotor flux wou
    11·1 answer
  • 1<br>M<br>A BLIND COOK WHO DEFEATED<br>OVER 30,000 HOME COOKS!<br>y of​
    13·1 answer
  • thanh thẳng AD có kích thước và chịu lực như hình.biết P1 = 10kn, p2=5kn,M=15kn*m,a=2m.Hãy xách định phản lực liên kết tại A,b
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!