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
Explain three (3) modes of heat transfer in air conditioning system.
LenKa [72]

Answer:

1. Conduction

2. Convection

3. Radiation

Explanation:

The 3 modes of heat transfer i an air conditioning system:

1. Conduction:

The transfer of heat by conduction  takes place in solid and is when the conduction takes place as a result of direct contact in between the interacting material which transfer the heat energy from particle to particle thus conducting the heat through out the system.

2. Convection:

The other mode for the transfer of heat which takes place especially in fluids - gases and liquids is through the technique of convection in which the transfer of heat takes place by the circular motion of the atoms and molecules of the fluid which carries the heat energy and results in the distribution of the heated fluid in the entire system thus transferring all the heat energy in the entire system.

3. Radiation:

The third mode of heat transfer in the air conditioning system is through radiation. This method transfers the heat by making use of the electro-magnetic radiation in the infra red spectrum where the waves of the spectrum transfers the heat energy with the help of a medium or without any medium at all.

Thus making the radiation method of heat transfer as the only method out of the three methods which does not require the material medium for the transfer of heat energy.

4 0
3 years ago
How are the accelerator and brake pedal positioned in relation to each other? A. The brake pedal is to the right of the accelera
Lunna [17]

Answer:B

Explanation:

7 0
3 years ago
For a column that is pinned at both ends, the critical buckling load can be calculated as, Pcr = π2 E I /L^2 where E is Young's
gulaghasi [49]

When a slender member is subjected to an axial compressive load, it may fail by a ... Consider a column of length, L, cross-sectional Moment of Inertia, I, having Young's Modulus, E. Both ends are pinned, meaning they can freely rotate ... p2EI L2 ... scr, is the Euler Buckling Load divided by the columns cross-sectional area

6 0
3 years ago
(c) As Engineering and Computing students, you must be familiar, with the respective professional bodies, as well as, Rules of P
guajiro [1.7K]

The professional ethics for computer engineers are:

  • They will Contribute to society and to human well-being.
  • They will  Avoid harm.
  • Be honest and trustworthy.
  • They will be fair and take action that do to discriminate others.

<h3>What are the Characteristics of Code of Ethics?</h3>

The code of ethics are known to be a kind of a universal moral values, that is one that state that what a person expect of any given employee such as been trustworthy, respectful, responsible, and others.

Note that Rules of Practice, Professional Obligations and Codes of Ethics. are known to be put in place to avoid issues that may lead to conflict.

Therefore, i believe that  As Engineering and Computing students, the respective professional bodies, Rules of Practice, Professional Obligations and Codes of Ethics are good and acts as a check and balance to us.

Therefore, The professional ethics for computer engineers are:

  • They will Contribute to society and to human well-being.
  • They will  Avoid harm.
  • Be honest and trustworthy.
  • They will be fair and take action that do to discriminate others.

Learn more about Engineering rules from

brainly.com/question/17169621

#SPJ1

4 0
1 year ago
What are the transfer of energy for the 6 simple machine? Ex: inclined plane is gravitational potential energy to mechanical ene
lilavasa [31]

Answer:

I. Inclined plane: GPE to KE.

II. Screw: KE to GPE.

III. Wheel and axle: GPE to KE.

IV. Lever: GPE to KE.

V. Wedge: GPE to KE.

VI. Pulley: GPE to KE.

Explanation:

A simple machine can be defined as a type of machine with no moving parts but can be used to perform work.

Basically, a simple machine allows for the transformation of energy into work. The six simple machines are;

I. <u>Inclined plane</u>: gravitational potential energy to mechanical energy (kinetic energy). It is set at an angle and then used to lift an object.

II. <u>Screw</u>: kinetic energy to potential energy. It is held in position and then used to tighten two or more objects together.

III. <u>Wheel and axle</u>: gravitational potential energy to mechanical energy (kinetic energy). It comprises of two circular objects which aids in the motion of an object such as a car.

IV. <u>Lever</u>: gravitational potential energy to mechanical energy (kinetic energy). It comprises of a pivoted bar at a fixed point (fulcrum) that allows it to be used for lifting heavy objects.

V. <u>Wedge</u>: gravitational potential energy to mechanical energy (kinetic energy). It can be used to split objects into halves.

VI. <u>Pulley</u>: gravitational potential energy to mechanical energy (kinetic energy). It is made up of a wheel and rope which allows force to be multiplied such as in a drawing well.

Energy can be defined as the ability (capacity) to do work. The two (2) main types of energy are;

a. Gravitational potential energy (GPE): it is an energy possessed by an object or body due to its position above the earth.

b. Kinetic energy (KE): it is an energy possessed by an object or body due to its motion.

8 0
3 years ago
Other questions:
  • What are the causes of kickback on a table-saw?
    13·1 answer
  • Write a new ARMv8 assembly file called "lab04b.S" which is called by your main function. It should have the following specificat
    13·1 answer
  • The device whose operation closely matches the way the clamp-on ammeter works is
    8·1 answer
  • Current density is given in cylindrical coordinates as J = −106z1.5az A/m2 in the region 0 ≤ rho ≤ 20 µm; for rho ≥ 20 µm, J = 0
    13·1 answer
  • Number the statements listed below in the order that they would occur in engine operation. Then, label these stages as intake, c
    14·1 answer
  • Find the inductive reactance per mile of a single-phase overhead transmission line operating at 60 Hz, given the conductors to b
    6·1 answer
  • At a construction site, there are constant arguments and conflicts amongst workers of different contractors and sub-contractors.
    14·1 answer
  • An HVAC contracting company sent out three work crews to complete three
    10·1 answer
  • I need to solve for d
    11·2 answers
  • Which of the following statements about resistance is TRUE?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!