Question: foodType ( ) ; foodType ( string , int, double, int, double, double ) ; private: string name; int calories; double fat; Int sugar; double

foodType () ;
foodType (string, int, double, int, double, double) ;
private:
string name;
int calories;
double fat;
Int sugar;
double carbohydrate;
};
double potassium;
//variable declaration
foodType fruit1;
foodType fru1t2("banana",90,0.4,14,27,422);
a. How many members does class foodType have?
Answer:
b. How many private members does class foodType have?
Answer:
c. How many constructors does class foodType have?
Answer:
d. How many constant functions does class foodType have?
Answer:
e. Which constructor is used to initialize the object fruit1? Which constructor is used to initialize the object fruit 2?
fruit 1 is initialized by
Fruit2 is initialized by
f. Fill in the underlines below to rewrite the definition of the class foodType so that each data member can be set individually.
Answer:
 foodType () ; foodType (string, int, double, int, double, double) ;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!