Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Consider the following declarations class foodrype { public: yold aet ( atring , Int, dowie, Int, double, double ) , vold print ( ) conat,
Consider the following declarations
class foodrype
public:
yold aetatring Int, dowie, Int, double, double
vold print conat,
atring getName const;
int getcaloriesif conet:
double getrat l conet,
Int getsugar conet;
double getcarbohydrate const;
double getpotassium const,
roodrype
Eoodiypa etringrt aoublo, int, dcuble, doublo;
privace:
string name;
Int caloriea;
double fat;
Int sugar,
double arbohydrate,
;
doubo potangun;
Vartable doclatation
foodrype fruiti;
foodType frutbanana;
a How many members does class foodType have?
b How many private members does class foodType have?
c How many constructors does class foodiype have?
Answer:
Answer:
Answer:
Answer:
d How many constant functions does class fogdtype have?
e Which constructor is used to initialize the object fruit Which constructor is used to initialize the object fruit
ruitt is initialized by
rruit is initialized by
f: Fill in the underlines below to rewrite the definition of the class foodTyRe so that each data member can be set individually.
Answer:
class EogdTups
i
public:
void set string int, double, int, double, double;
yoid print const:
void sethame
string getName const:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started