Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) All variables must be declared before being used ( true or false ) 2) C++ con

ID: 3573513 • Letter: 1

Question

1) All variables must be declared before being used ( true or false )

2) C++ considers the variable number and NUMBER to be identical. ( true or false )

3) The arithmetic operators *, / , + and - have the same level of precedence. ( true of false )

4) The OR(||) operator has higher precedence that the AND (&&) operator. ( true or false )

5) The OR (||) operator stops after finding one condition to be true. ( true of false )

6) The AND (||) operator stops after finding onr condition to be true. (true or false )

7) And (&&) is a binary operator. ( true or false )

8) The statement cout<<"a=5;"; is a typical assignment statement. (true or false )

9) The default case is require in the switch statement. ( true or false )

Explanation / Answer

Answer :

1) All variables must be declared before being used ( true or false )

2) C++ considers the variable number and NUMBER to be identical. ( true or false )

3) The arithmetic operators *, / , + and - have the same level of precedence. ( true of false )

4) The OR(||) operator has higher precedence that the AND (&&) operator. ( true or false )

5) The OR (||) operator stops after finding one condition to be true. ( true of false )

6) The AND (||) operator stops after finding onr condition to be true. (true or false )

7) And (&&) is a binary operator. ( true or false )

8) The statement cout<<"a=5;"; is a typical assignment statement. (true or false )

9) The default case is require in the switch statement. ( true or false )

Answer :

1) All variables must be declared before being used ( true or false )

Answer :

true

Explanation :

Yes,It is true All variables must be declared before being used.A C++ compiler needs to know the type of a variable before it can figure out how it is being used in an expression. Technically, C++ compilers may assume that an undeclared variable is an int, but usually this assumption is either wrong or leads to problems later.

..........

2) C++ considers the variable number and NUMBER to be identical. ( true or false )

Answer :

false

Explanation :

C++ is case sensitive.

..........

3) The arithmetic operators *, / , + and - have the same level of precedence. ( true of false )

Answer :

false

Explanation :

It is false, The arithmetic operators *, / , + and - have the same level of precedence.

.................

4) The OR(||) operator has higher precedence that the AND (&&) operator. ( true or false )

Answer :

false

...........

7) And (&&) is a binary operator. ( true or false )

Answer:

false

............

9) The default case is require in the switch statement. ( true or false )

Answer:

False.

Explanation :

The default case is optional. If no default action is needed, then there is no need for a default case.

............