Procedural Programming Chapter 2

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

The result of a logical expression cannot be assigned to an int variable, but it can be assigned to a bool variable.

False

#include <iostream> using namespace std; int main() { cout << "Hello World." return 0; } In the cout statement, the missing semicolon in the code above will be caught by the ____.

Compiler

The ____ rules of a programming language tell you which statements are legal, or accepted by the programming language.

Syntax

Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;

True

Which of the following is a legal identifier in C++? program! program_1 1program program 1

program_1

____ is a valid int value in C++. 46,259 46259 462.59 -32.00

46259

Suppose that alpha and beta are int variables. The statement alpha = ++beta; is equivalent to the statement(s) ____.

beta = beta + 1; alpha = beta;

Which of the following is a reserved word in C++? char Char CHAR character

char

An example of a floating-point data type is ____. pointer floatable double short int char

double

Which of the following is a valid command to compile a C++ file named hello.cpp from the CLI (Command Line Interface) ? g++ -Wextra -O output hello.cpp g++ -Wextra -o output hello.cpp g++ -Wextra -o output hello g++ -wextra -o output hello g++ -wextra -o output hello.cpp

g++ -Wextra -o output hello.cpp

The value of the expression 17 % 4 is ____.

1

____ is a valid char value. -129 '?' 128 129 A

'?'

In C++, the expression 33 / 10 will be evaluated to be the value ____.

3

Suppose that alpha and beta are int variables and alpha = 5 and beta = 10. After the statement alpha *= beta; executes, alpha equals ____.

50

The expression static_cast<int>(9.9) evaluates to ____.

9

Which of the following is used to terminate a statement in C++ ? endl // end of the line ; // semicolon : // colon . // period

; // semicolon

_________ is a keyword (reserved word) in C++? boolean false Double True string

False

// Insertion Point 1 using namespace std; const double PI = 3.142; int main() { // Insertion Point 2 double radius = 2.0; double area; area = PI * radius * radius; cout << "Area = " << area <<endl; return 0; } // Insertion Point 3 In this code, where does the include statement belong?

Insertion point 1

____ are executable statements that inform the user what to do.

Prompt lines

Choose the output of the following C++ statement: cout << "Sunny " << '\n' << "Day " << endl;

Sunny Day

Suppose that alpha and beta are int variables. The statement alpha = beta--; is equivalent to the statement(s) ____.

alpha = beta; beta = beta - 1;


Set pelajaran terkait

CS3310 Final Exam Review Question Canvas

View Set

Jensen Chapter 1: The Nurse's Role in Health Assessment

View Set

Neuromuscular Pharmacotherapeutics - Mehdi

View Set