Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment Write two local classes named Pump and Cylinder as described below. Then, write a main function that reads the flowSpeed and area of a

image text in transcribed

Assignment Write two local classes named Pump and Cylinder as described below. Then, write a main function that reads the flowSpeed and area of a Pump object (p) both as double values, main will also read the radius and height of a cylinder object (fuelTank) both as double values. Finally, the inBuiltPump of fuelTank will be the p Pump object. Finally, the program should calculate the time it takes the fuelTank to be completely filled with fuel and prints it to the screen as a double value. Pump Class A private double field named "flowSpeed" representing the flow speed of the pump. A private double field named "area" representing the cross-section area (i.e., kesit alan) of the pump. A constructor that gets two double values and initializes the object. An empty constructor. A public function named calculateFlow Rate that does not get any parameter, multiplies the flowSpeed and area of the pump, and returns it as a double value. Cylinder Class A private double field named "radius representing the radius of the cylinder A private double field named "height" representing the height of the cylinder A private Pump field named "inBuiltPump' representing the pump that provides fuel to this cylinder. Assignment Write two local classes named Pump and Cylinder as described below. Then, write a main function that reads the flowSpeed and area of a Pump object (p) both as double values, main will also read the radius and height of a cylinder object (fuelTank) both as double values. Finally, the inBuiltPump of fuelTank will be the p Pump object. Finally, the program should calculate the time it takes the fuelTank to be completely filled with fuel and prints it to the screen as a double value. Pump Class A private double field named "flowSpeed" representing the flow speed of the pump. A private double field named "area" representing the cross-section area (i.e., kesit alan) of the pump. A constructor that gets two double values and initializes the object. An empty constructor. A public function named calculateFlow Rate that does not get any parameter, multiplies the flowSpeed and area of the pump, and returns it as a double value. Cylinder Class A private double field named "radius representing the radius of the cylinder A private double field named "height" representing the height of the cylinder A private Pump field named "inBuiltPump' representing the pump that provides fuel to this cylinder

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

What is IUPAC system? Name organic compounds using IUPAC system.

Answered: 1 week ago

Question

What happens when carbonate and hydrogen react with carbonate?

Answered: 1 week ago