Fall 2019 1. (What will be printed by the following statements when wt is equal to 160, 220 or 240? if (wt > 220) cout <<"way too heavy !n"; else if (wt> 190) cout <<"too heavy n"; else cout <<"weight has been tested" ); a) wt 160 b) wt 220 c) wt = 240 2. How many times will the following do loop execute? Rewite this code as a for loop x = 3; do {x = x+ 1; cout <

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 7SA: Consider the following statements: Which of the following statements are valid? If they are...
icon
Related questions
Question
Fall 2019
1. (What will be printed by the following statements when wt is equal to 160, 220 or 240?
if (wt > 220)
cout <<"way too heavy !n";
else if (wt> 190)
cout <<"too heavy n";
else
cout <<"weight has been tested" );
a) wt 160
b) wt 220
c) wt = 240
2. How many times will the following do loop execute? Rewite this code as a for loop
x = 3;
do
{x = x+ 1;
cout <<x++ << endl;
}while (x < 10);
Transcribed Image Text:Fall 2019 1. (What will be printed by the following statements when wt is equal to 160, 220 or 240? if (wt > 220) cout <<"way too heavy !n"; else if (wt> 190) cout <<"too heavy n"; else cout <<"weight has been tested" ); a) wt 160 b) wt 220 c) wt = 240 2. How many times will the following do loop execute? Rewite this code as a for loop x = 3; do {x = x+ 1; cout <<x++ << endl; }while (x < 10);
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning