hey guys, this is my assignment but i have no godly idea where to start. can anyone help?
the assignment:
A stock tank is a metal or plastic tank that ranchers and farmers use to provide water for their livestock. The tanks are usually made of metal or plastic, and come in three basic shapes; rectangular, “oval”, and circular. The rectangular and circular tanks are shaped as you expect, but the “oval” tank is actually a rectangle with ½-circles on each end.
In this program, you are going to write a StockTankCalcul ator class that can be used to calculate the volume of a stock tank. Your calculator class will work with all 3 types of tanks. Given the shape of the tank, pertinent dimensions, the calculator can tell you how many gallons of water it will hold (completely full) as well as if given a percentage of the tank capacity will report the resultant number of gallons.
The class should look like this and have these methods. Do not cout << anything from within the class. The gets and sets should be named using “get” and “set” in the name. You should use either floats or doubles for capacity values.
class StockTankCalcul ator
{
private:
//what is all the data that the calculator needs?
public:
StockTankCalcul ator();
set function for shape of the tank
three set function for pertinent data for all three tank shapes
get function for total capacity of tank
get function, give a percentage value of total capacity, i.e. 50%, 75%, etc.
string getTankData() //returns a string that describes the type of tank and its dimensions
};
The StockTankCalcul ator has a default constructor that sets the tank to circular type, with diameter of 72” and depth of 24”.
Pertinent data that you’ll need or assumptions to use: 1) dimensions of the tanks are in whole inches, 2) there are 231 cubic inches per gallon of water, 3) total capacity of the tank has the water level at the very top.
Your main method should write a header to the screen, and then create one StockTankCalcul ator object. Then present the user with the choice so that he may calculate the various tank sizes and capacities. Write all capacities in floating point data to two decimal places of accuracy.
thanks guys!
the assignment:
A stock tank is a metal or plastic tank that ranchers and farmers use to provide water for their livestock. The tanks are usually made of metal or plastic, and come in three basic shapes; rectangular, “oval”, and circular. The rectangular and circular tanks are shaped as you expect, but the “oval” tank is actually a rectangle with ½-circles on each end.
In this program, you are going to write a StockTankCalcul ator class that can be used to calculate the volume of a stock tank. Your calculator class will work with all 3 types of tanks. Given the shape of the tank, pertinent dimensions, the calculator can tell you how many gallons of water it will hold (completely full) as well as if given a percentage of the tank capacity will report the resultant number of gallons.
The class should look like this and have these methods. Do not cout << anything from within the class. The gets and sets should be named using “get” and “set” in the name. You should use either floats or doubles for capacity values.
class StockTankCalcul ator
{
private:
//what is all the data that the calculator needs?
public:
StockTankCalcul ator();
set function for shape of the tank
three set function for pertinent data for all three tank shapes
get function for total capacity of tank
get function, give a percentage value of total capacity, i.e. 50%, 75%, etc.
string getTankData() //returns a string that describes the type of tank and its dimensions
};
The StockTankCalcul ator has a default constructor that sets the tank to circular type, with diameter of 72” and depth of 24”.
Pertinent data that you’ll need or assumptions to use: 1) dimensions of the tanks are in whole inches, 2) there are 231 cubic inches per gallon of water, 3) total capacity of the tank has the water level at the very top.
Your main method should write a header to the screen, and then create one StockTankCalcul ator object. Then present the user with the choice so that he may calculate the various tank sizes and capacities. Write all capacities in floating point data to two decimal places of accuracy.
thanks guys!
Comment