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
A surveyor knows an elevation at Catch Basin to be elev=2156.77 ft. The surveyor takes a BS=2.67 ft on a rod at BM Catch Basin a
fenix001 [56]

Answer:

the elevation at point X is 2152.72 ft

Explanation:

given data

elev = 2156.77 ft

BS = 2.67 ft

FS = 6.72 ft

solution

first we get here height of instrument that is

H.I = elev + BS   ..............1

put here value

H.I =  2156.77 ft + 2.67 ft  

H.I = 2159.44 ft

and

Elevation at point (x) will be

point (x)  = H.I - FS   .............2

point (x)  = 2159.44 ft  - 6.72 ft

point (x)  = 2152.72 ft

3 0
3 years ago
The entire system of components that produces power and transmits it to the road is called the vehicle's _____.
IrinaK [193]

Answer:

Powertrain

Explanation:

6 0
3 years ago
Determine the required dimensions of a column with a square cross section to carry an axial compressive load of 6500 lb if its l
ycow [4]

Answer: 0.95 inches

Explanation:

A direct load on a column is considered or referred to as an axial compressive load. A direct concentric load is considered axial. If the load is off center it is termed eccentric and is no longer axially applied.

The length= 64 inches

Ends are fixed Le= 64/2 = 32 inches

Factor Of Safety (FOS) = 3. 0

E= 10.6× 10^6 ps

σy= 4000ps

The square cross-section= ia^4/12

PE= π^2EI/Le^2

6500= 3.142^2 × 10^6 × a^4/12×32^2

a^4= 0.81 => a=0.81 inches => a=0.95 inches

Given σy= 4000ps

σallowable= σy/3= 40000/3= 13333. 33psi

Load acting= 6500

Area= a^2= 0.95 ×0.95= 0.9025

σactual=6500/0.9025

σ actual < σallowable

The dimension a= 0.95 inches

3 0
3 years ago
Read 2 more answers
Using the results of the Arrhenius analysis (Ea=93.1kJ/molEa=93.1kJ/mol and A=4.36×1011M⋅s−1A=4.36×1011M⋅s−1), predict the rate
uysha [10]

Answer:

k = 4.21 * 10⁻³(L/(mol.s))

Explanation:

We know that

k = Ae^{-E/RT} ------------------- euqation (1)

K= rate constant;

A = frequency factor = 4.36 10^11 M⁻¹s⁻¹;

E = activation energy = 93.1kJ/mol;

R= ideal gas constant = 8.314 J/mol.K;

T= temperature = 332 K;

Put values in equation 1.

k = 4.36*10¹¹(M⁻¹s⁻¹)e^{[(-93.1*10^3)(J/mol)]/[(8.314)(J/mol.K)(332K)}

k = 4.2154 * 10⁻³(M⁻¹s⁻¹)

here M =mol/L

k = 4.21 * 10⁻³((mol/L)⁻¹s⁻¹)

 or

k = 4.21 * 10⁻³((L/mol)s⁻¹)

or

k = 4.21 * 10⁻³(L/(mol.s))

3 0
3 years ago
This problem has been solved!
lisov135 [29]

Answer: a) 135642 b) 146253

Explanation:

A)

1- the bankers algorithm tests for safety by simulating the allocation for predetermined maximum possible amounts of all resources, as stated this has the greatest degree of concurrency.

3- reserving all resources in advance helps would happen most likely if the algorithm has been used.

5- Resource ordering comes first before detection of any deadlock

6- Thread action would be rolled back much easily of Resource ordering precedes.

4- restart thread and release all resources if thread needs to wait, this should surely happen before killing the thread

2- only option practicable after thread has been killed.

Bii) ; No. Even if deadlock happens rapidly, the safest sequence have been decided already.

5 0
2 years ago
Other questions:
  • You are comparing distillation column designs at 1 atm and 3 atm total pressure for a particular separation. You have the same f
    5·1 answer
  • You just purchased a 400-L rigid tank for a client who works in the gas industry. The tank is delivered pre-filled with 3 kg of
    8·1 answer
  • One of our wifi network standards is IEEE 802.11ac. It can run at 6.77 Gbit/s data rate. Calculate the symbol rate for 801.11ac
    5·1 answer
  • A vehicle is moving at a velocity, v, given by v =12t - 3t2 ms-1. Use
    7·1 answer
  • A subsurface exploration report shows that the average water content of a fine-grained soil in a proposed borrow area is 22% and
    9·1 answer
  • Consider a standard room thermostat. Determine the sensor, transducer, output, and control stages for this measurement system.
    13·1 answer
  • What ic engine for mechanic
    15·1 answer
  • A machine raises 20kg of water through a height of 50m in 10secs. What is the power of the machine.​
    5·1 answer
  • The reversible and adiabatic process of a substance in a compressor begins with enthalpy equal to 1,350 kJ/kg, and ends with ent
    15·1 answer
  • Agricultural economics is a study of how agriculture and business are related.<br> False<br> True
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!