Answered step by step
Verified Expert Solution
Link Copied!

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 aet(atring, 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 (1)
Eoodiypa (etring,1rt, aoublo, int, dcuble, doublo);
privace:
string name;
Int caloriea;
double fat;
Int sugar,
double arbohydrate,
};
doub1o potang1un;
/Vartable doclatation
foodrype fruiti;
foodType fru1t2("banana",90,0.4,14,27,422);
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?
6
5
2
e. Which constructor is used to initialize the object fruit1? Which constructor is used to initialize the object fruit2?
ruitt is initialized by
rruit 2 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:
image text in transcribed

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

Modern Database Management

Authors: Jeffrey A. Hoffer Fred R. McFadden

4th Edition

0805360476, 978-0805360479

More Books

Students also viewed these Databases questions

Question

Describe a persuasive message.

Answered: 1 week ago

Question

Identify and use the five steps for conducting research.

Answered: 1 week ago

Question

List the goals of a persuasive message.

Answered: 1 week ago