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
List and explain 4 factors you need to observe while stick welding to make a good “consistent” bead
ch4aika [34]

Answer:I don’t know this one

Explanation:

5 0
3 years ago
In the circuit below I 1=20mA V1=10 R1=400 R2=2000 R3=1000. Use node analysis to find R2
Hatshy [7]

Answer:0.2A

Explanation:

First, write KCL

i1-i2-i3=0

Then, replace currents with viltages and resistors.

V2-10v/100-v2/200-v2/400=0

V2-40=0

V2=40v

I hope it was helpful

6 0
3 years ago
The time to half-maximum voltage is how long it takes the capacitor to charge halfway. Based on your experimental results, how l
satela [25.4K]

Answer:

Time taken for the capacitor to charge to 0.75 of its maximum capacity = 2 × (Time take for the capacitor to charge to half of its capacity)

Explanation:

The charging of a capacitor/the build up of its voltage follows an exponential progression and is given by

V(t) = V₀ [1 - e⁻ᵏᵗ]

where k = (1/time constant)

when V(t) = V₀/2

(1/2) = 1 - e⁻ᵏᵗ

e⁻ᵏᵗ = 0.5

In e⁻ᵏᵗ = In 0.5 = - 0.693

-kt = - 0.693

kt = 0.693

t = (0.693/k)

Recall that k = (1/time constant)

Time to charge to half of max voltage = T(1/2)

T(1/2) = 0.693 (Time constant)

when V(t) = 0.75

0.75 = 1 - e⁻ᵏᵗ

e⁻ᵏᵗ = 0.25

In e⁻ᵏᵗ = In 0.25 = -1.386

-kt = - 1.386

kt = 1.386

t = 1.386(time constant) = 2 × 0.693(time constant)

Recall, T(1/2) = 0.693 (Time constant)

t = 2 × T(1/2)

Hope this Helps!!!

3 0
3 years ago
Read 2 more answers
A hydrauliic jack is rated at 5000 pound capacity. The area of the large piston on the jack is 4.45 Square inches. Calculate the
sergeinik [125]

Answer:

1123.6 pounds/ square inch.

Explanation:

Fluid pressure is the ratio of force or weight applied by the fluid per unit area.

i.e Fluid pressure = \frac{weight}{area}

The maximum load of the jack is obtained at its maximum capacity = 5000 pounds

Area of the large piston on the jack = 4.45 square inches

Thus,

Fluid pressure = \frac{5000}{4.45}

                        = 1123.5955

Fluid pressure = 1123.6 pounds/ square inch

Thu, the fluid pressure in the jack at maximum load is 1123.6 pounds/ square inch.

7 0
2 years ago
21.Why are throttling devices commonly used in refrigeration and air-conditioning<br> applications?
Sloan [31]

Answer is given below

Explanation:

we know that some common types of throttling devices are

  • Hard -throttling devices
  • Capillary valve
  • Constant pressure throttling devices
  • Thermostatic expansion valve
  • Float expansion valve

so here throttling devices commonly used in refrigeration and air-conditioning because

  • To reduce the coolant pressure, the high pressure of the refrigerant from the condenser is necessary to reduce the evaporation to obtain evaporation at the right temperature  
  • To meet the refrigerated load, the throttling valve flows through the coolant to cool the load at high temperatures.
5 0
4 years ago
Other questions:
  • I have a stream with three components, A, B, and C, coming from another process. The stream is 50 % A, and the balance is equal
    11·1 answer
  • A hydraulic jump is induced in an 80 ft wide channel.The water depths on either side of the jump are 1 ft and 10 ft.Please calcu
    5·2 answers
  • Help now please evaluate using the commutative property: 40 (32) (10) (25)
    8·1 answer
  • A wing generates a lift L when moving through sea-level air with a velocity U. How fast must the wing move through the air at an
    7·1 answer
  • 3.
    7·1 answer
  • Water is pumped from a lake to a storage tank 18 m above at a rate of 70 L/s while consuming 20.4 kW of electric power. Disregar
    13·1 answer
  • : A drive system using the electric motor is under load as 75Nm with an angular velocity of 100rad/s, then the electric motor is
    11·1 answer
  • Which type of system is being researched to deliver power to several motors to drive multiple systems in vehicles?
    10·1 answer
  • What is a beta testing ?
    15·2 answers
  • From the list of problems below, check all that are known to be NP-complete. You do not need to justify your answer. (Set cover)
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!