30 Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to each variable after each statement executes? Suppose a = 6, b = 3, and c = 2.2. (14)                                                                                  a           b           c            sum sum = static_cast(a + b + c);                     __          __         __          __ b += c * a;                                                               __          __         __          __ c -= a;                                                                       __          __         __          __ a *= 2 * b - c;                                                           __          __         __          __

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter5: Making Decisions
Section: Chapter Questions
Problem 19RQ
icon
Related questions
Question

30 Suppose a, b, and sum are int variables and c is a double variable.

What value is assigned to each variable after each statement executes?

Suppose a = 6, b = 3, and c = 2.2. (14)

                                                                                 a           b           c            sum

sum = static_cast<int>(a + b + c);                     __          __         __          __

b += c * a;                                                               __          __         __          __

c -= a;                                                                       __          __         __          __

a *= 2 * b - c;                                                           __          __         __          __

30 Suppose a, b, and sum are int variables and c is a double variable.
What value is assigned to each variable after each statement executes?
Suppose a = 6, b = 3, and c = 2.2. (14)
%3D
%3D
a
b
sum
sum = static_cast<int>(a + b + c);
b += c * a;
с -- а;
a *= 2 * b - c;
Transcribed Image Text:30 Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to each variable after each statement executes? Suppose a = 6, b = 3, and c = 2.2. (14) %3D %3D a b sum sum = static_cast<int>(a + b + c); b += c * a; с -- а; a *= 2 * b - c;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
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