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]
2 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]2 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
Effects of adding more insulation to a cylinder increases heat transfer area. a)-True b)-False
Xelga [282]

Answer:

a)-True

Hope this helps even tho theres no school right now

3 0
3 years ago
Brazing, Soldering and Adhesive Bonding are the types of • Liquid Solid System Welding Solid State Welding • Fusion Welding . No
olga_2 [115]

Answer: Solid state welding

Explanation: Solid state welding is the welding procedure which is based on the temperatures and pressure but without any liquid or vapor as aid for welding.This process is carried mainly cohesive forces and considering forces as less important. Brazing,soldering and adhesive is the process in which material are joint which the help of solid welding agent.Thus solid state welding is the correct option.

6 0
2 years ago
1). Mention any four operations that requires airlines. 2). Explain how airflow is applicable to the above mentioned operations.
vladimir2022 [97]

Answer:

Following are the answer to this question:

Explanation:

1)

Following the four operations in the airlines:

Landside operations:

In Airlines, the airports are divided into areas on the countryside and on the airside, in which landside region is available to the public, although strictly controlled access to the airside zone. Its area covers all areas of the airport across the aircraft, including parts of the buildings which can only be reached by customers and employees.

Airside Operations:

It's also committed to ensuring which air operations military exercises Ballarat airfields are safe and secure. It includes the provision of parking and flight escort services to itinerant and automates. Organizing operational response to incidents, accidents, or emergencies at the airport.

Billing and invoicing Operations:

This requires several steps, each of which must be performed with absolute accuracy to ensure that perhaps the airport operator is adequately paid for supplying passengers with all the services and infrastructure. After this, the receipts want to be produced and sent to customers on the airline.

Information management:

In this, it collects all the data about the customers and employees and it also helps in finding new routes and after collecting the data it processes on them.  

2)

It involves many activities in the airline, including dispatch, flight preparation, flight watch, weather information source, activities control, ground-to-air communications, and staff coordination, scheduling, and maintenance planning. Computing and expert programs are constantly being used to handle unpredictable activities.

4 0
3 years ago
4.116 The lid of a roof scuttle weighs 75 lb. It is hinged at corners A and B and maintained in the desired position by a rod CD
babunello [35]

Answer:

(a) The magnitude of force is 116.6 lb, as exerted by the rod CD

(b) The reaction at A is (-72.7j-38.1k) lb and at B it is (37.5j) lb.

Explanation:

Step by step working is shown in the images attached herewith.

For this given system, the coordinates are the following:

A(0, 0, 0)

B(26, 0, 0)

And the value of angle alpha is 20.95°

Hope that answers the question, have a great day!

5 0
3 years ago
A hypothetical metal alloy has a grain diameter of 2.4 × 10−2 mm. After a heat treatment at 575°C for 500 min, the grain diamete
Alex

Answer:

The time required is 10.078 hours or 605 min

Explanation:

The formula to apply here is ;

K=(d²-d²₀ )/t

where t is time in hours

d is grain diameter to be achieved after heating in mm

d₀ is the grain diameter before heating in mm

Given

d=5.5 × 10^-2 mm

d₀=2.4 × 10^-2 mm

t₁= 500 min = 500/60 =25/3 hrs

t₂=?

n=2.2

First find K

K=(d²-d²₀ )/t₁

K={ (5.1 × 10^-2 mm)²-(2.4 × 10−2 mm)² }/ 25/3

K=(0.051²-0.024²) ÷25/2

K=0.000243 mm²/h

Re-arrange equation for K ,to get the equation for d as;

d=√(d₀²+ Kt)  where now t=t₂

d=\sqrt{0.024^2+0.000243*t} \\\\0.055=\sqrt{0.024^2+0.000243t} \\\\0.055^2=0.024^2+0.000243t\\\\0.055^2-0.024^2=0.000243t\\\\0.002449=0.000243t\\\\0.002449/0.000243=t\\\\10.078=t\\\\t=605min

4 0
2 years ago
Other questions:
  • A 10-kg block A is released from rest 2 m above the 5-kg plate P, which can slide freely along the smooth vertical guides BC and
    6·1 answer
  • An isentropic steam turbine processes 5.5 kg/s of steam at 3 MPa, which is exhausted at 50 kPa and 100°C. Five percent of this f
    13·1 answer
  • After a 65 newton weight has fallen freely from rest a vertical distance of 5.3 meters, the kinetic energy of the weight is
    12·1 answer
  • Write a function called pyramid(height) that acceptsa parameter ""height"". It then prints a pyramid of that height
    10·1 answer
  • The mechanical advantage of a screw is always ____________________ than/to 1. Question 5 options: less, greater, equal, none of
    7·1 answer
  • A water agency stated that waterlines cannot have water flowing faster than 8 ft/s. What is the minimum standard pipe diameter t
    12·1 answer
  • Ball joints on a vehicle equipped with MacPherson struts are being inspected for wear. Which of the following would be the corre
    11·1 answer
  • PLEASE HELP
    15·2 answers
  • 3. A steel pipe of outside diameter 20 mm and thickness 3 mm is
    14·1 answer
  • You insert a dielectric into an air-filled capacitor. How does this affect the energy stored in the capacitor?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!