Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 3 (9 points) Evaluate the expressions in the left column. Match your answer to the correct value in the right column. (3.4) 13.5+ 2.0

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Question 3 (9 points) Evaluate the expressions in the left column. Match your answer to the correct value in the right column. (3.4) 13.5+ 2.0 4.0 / 4.0 1. 22 25+ 4 - 7 2. 2. 42 % 36 - 6 + 36/7.4 3. 14 20 - 13 % 2 + 18/9 4. 8 5/9* (32.6 - 4.5) 5. 7.00 7. 14 28 / 4.0 8. 0 13/3. 6. 10 9. 15.5 8/3 > x assigns the value 7 to x. (6) Oh) in an output statement, the newline character may be a part of the string(10) Oi) in C++, all variables must be initialized when they are declared. (7) | 1) In a mixed expression, all the operands are converted to floatingpoint numbers. (4) k) Suppose * = 5. After the statement y = x++; executesy is 5 and x is 6. (9) Suppose a = 5. After the statement +a; executes, the value of a is still 5 because the value of the expression is not saved in another variable. (9) 0 Question 18 (9 points) Suppose a, b, and c are int variables and a = 7 and b = 2. What value is assigned to each variable after each statement executes? If a variable is undefined at a particular statement, report UND (undefined). (6,9) a = (b++) + 3; a = A , b = A .C= A/ c=2* a + (++b); a = A b = A C = b = 2 * (++c) - (a++); A a = ,b= A A/ Ouestion 19 IR neintel What is printed by the following program? (8, 10, 11) Suppose the input is: 35 10.5 27 B #include using namespace std; const int NUM = 10; const double X = 20.5; int main() { int firstNum, secondNum; double z; char grade; firstNum = 62: cout > firstNum >> z>> secondNum; cout > grade; cout (static cast int>(grade) + 1) #include using namespace std; const double CONVERSION - 3.5; int maino const int TEMP = 23; string name; int id; int num; double decNum; double mystery Num; cout > name; cout > id; cout (CONVERSION)); cout > decNum; cout 7. 14 28 / 4.0 8. 0 13/3. 6. 10 9. 15.5 8/3 > x assigns the value 7 to x. (6) Oh) in an output statement, the newline character may be a part of the string(10) Oi) in C++, all variables must be initialized when they are declared. (7) | 1) In a mixed expression, all the operands are converted to floatingpoint numbers. (4) k) Suppose * = 5. After the statement y = x++; executesy is 5 and x is 6. (9) Suppose a = 5. After the statement +a; executes, the value of a is still 5 because the value of the expression is not saved in another variable. (9) 0 Question 18 (9 points) Suppose a, b, and c are int variables and a = 7 and b = 2. What value is assigned to each variable after each statement executes? If a variable is undefined at a particular statement, report UND (undefined). (6,9) a = (b++) + 3; a = A , b = A .C= A/ c=2* a + (++b); a = A b = A C = b = 2 * (++c) - (a++); A a = ,b= A A/ Ouestion 19 IR neintel What is printed by the following program? (8, 10, 11) Suppose the input is: 35 10.5 27 B #include using namespace std; const int NUM = 10; const double X = 20.5; int main() { int firstNum, secondNum; double z; char grade; firstNum = 62: cout > firstNum >> z>> secondNum; cout > grade; cout (static cast int>(grade) + 1) #include using namespace std; const double CONVERSION - 3.5; int maino const int TEMP = 23; string name; int id; int num; double decNum; double mystery Num; cout > name; cout > id; cout (CONVERSION)); cout > decNum; cout

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_2

Step: 3

blur-text-image_3

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions

Question

How can data visualisation aid in networking analysis?

Answered: 1 week ago