Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

QUESTION 1 Examine the code. When will C be assigned 3? (Be careful.) if (A == B); C = 3; when A is equal to

QUESTION 1

Examine the code. When will C be assigned 3? (Be careful.) if (A == B); C = 3;

when A is equal to B

when A is not equal to B

never

every time the program is executed

not enough information is given

QUESTION 2

Given the following segment of code, what will be the output? int x = 5; if (x == 2) Write("Brown, brown, run aground. "); else Write("Blue, blue, sail on through. "); Write("Green, green, nice and clean.");

Brown, brown, run aground.

Blue, blue, sail on through.

Brown, brown, run aground. Blue, blue, sail on through.

Blue, blue, sail on through. Green, green, nice and clean.

none of the above

QUESTION 3

Complete the tables below for Logical And and Or (T and F denote true and false.) P Q P And Q T T T T F F T F F F P Q P Or Q T T T T F F T F F F

QUESTION 4

After execution of the following code, what will be the value of inputValue? int inputValue = 0; if (inputValue > 5) inputValue += 5; else if (inputValue > 2) inputValue += 10; else inputValue += 15;

15

10

25

0

5

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

Transactions On Large Scale Data And Knowledge Centered Systems Xxiv Special Issue On Database And Expert Systems Applications Lncs 9510

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Hendrik Decker ,Lenka Lhotska ,Sebastian Link

1st Edition

366249213X, 978-3662492130

More Books

Students also viewed these Databases questions