C++ Question #2 2. Design a class named Can to represent a cylindrical aluminum
ID: 3724670 • Letter: C
Question
C++
Question #2
2. Design a class named Can to represent a cylindrical aluminum can. Objects of this class should know their own (empty) weight in grams and their dimensions base radius and height-in centimeters. When given the volume (cm2) of 1 gram of a product to be canned, objects of this class should be ableo answe or question "How many whole grams of this product will fit in this can?" Do not get to include constructors, one that takes parameters for initializing compo nents and one that does not. Include in your answer an analysis docume patterned after Fig. 6.5, an object model patterned after Fig. 66, and a desa document in the format of Table 6.2. 0- an object model patterned after Fiq. 66, and a desExplanation / Answer
//this class is used to determine how many whole grams of product will fit in the can
const double PI = 3.141592653589793
class Drill{
private:
double diameter;
double feed;
double speed;
public:
double mrr(){
//Area = (PI*d*d)/4
//material remove rate = area * feed*speed
double area=(PI*diameter*diameter)/4;
return area*feed*speed;
}
double torque(double Power){
//torque=power/speed
return Power/speed;
}
Drill(){
diameter=0.0;
feed=0.0;
speed=0.0;
}
Drill(double dia, double fd, double spd){
diameter=dia;
feed=fd;
speed=spd;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.