Answer to Question #302406 in C++ for Imzi

Question #302406

Consider the following statements:


int num1, num2, num3;


double length, width, height;


double volume;


num1 = 6;


num2 = 7;


num3 = 4;


length = 6.2;


width = 2.3;


height = 3.4 and the function prototype: double box(double, double, double);


Which of the following statements are valid or invalid?


a. volume = box(length, width, height);


b. volume = box(length, 3.8, height);


c. cout << box(num1, num3, num2) << endl;


d. cout << box(length, width, 7.0) << endl;


e. volume = box(length, num1, height);


f. cout << box(6.2, , height) << endl;


g. volume = box(length + width, height);


h. volume = box(num1, num2 + num3);



1
Expert's answer
2022-02-25T03:39:53-0500
int num1, num2, num3;
double length, width, height;
double volume;


num1 = 6;
num2 = 7;
num3 = 4;


length = 6.2;
width = 2.3;
height = 3.4 and the function prototype: 


double box(double, double, double);


Which of the following statements are valid or invalid?
a. volume = box(length, width, height);			--> VALID
b. volume = box(length, 3.8, height);			--> VALID
c. cout << box(num1, num3, num2) << endl;		--> VALID
d. cout << box(length, width, 7.0) << endl;		--> VALID
e. volume = box(length, num1, height);			--> Valid
f. cout << box(6.2, , height) << endl;			--> Invalid as the function double box(double, double, double) requires 3 arguments to be passed
g. volume = box(length + width, height);		--> Invalid as the function double box(double, double, double) requires 3 arguments to be passed
h. volume = box(num1, num2 + num3);				--> Invalid as the function double box(double, double, double) requires 3 arguments to be passed

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog