Class Marker Test Bank

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is => ? A) has no meaning in C++ B) operator C) punctuation mark D) symbol

A) has no meaning in C++

What does the A in RAM stand for? Be careful with the spelling.

Access

What does the A in ASCII stand for?

American

In C++ you can have a keyword that contains capital letters. A) True B) False

B) False

What does the C in CPU stand for? Be careful with the spelling.

Central

= is the ______ operator. Be careful with the spelling.

assignment

What is the result of the following code: double grade = 100; switch (grade) { case 100: case 99: cout << "Good Job!"; default: cout << "You could have done better."; } Assume it is part of a complete C++ program. A) Nothing will print on the monitor. B) "Good Job! You could have done better." will print on the monitor in two lines. C) depends on the compiler D) run time error E) syntax error F) "You could have done better." will print on the monitor. G) "Good Job!" will print on the monitor. H) "Good Job!You could have done better." will print on the monitor in one line.

E) syntax error

What does the E in IDE stand for? Be careful with the spelling!

Environment

Name the third stage of the CPU's cycle.

Execute

What is the result of the following code: cout << 3 % 9; Assume it is part of a complete C++ program. A) 0 B) depends on the compiler C) run time error D) 6 E) 9 F) 3 G) syntax error

F) 3

What is the result of the following statements: char ch = 65; cout << ch + 1; Assume it is part of a complete C++ program. A) ch B) the character A C) syntax error D) run time error E) depends on the compiler F) 66 G) ch 1 H) the character B

F) 66

What type of operator is &&? Select ALL that apply. A) relational B) ternary C) comparison D) This operator doe not exist in C++ E) unary F) logical G) binary

F) logical

Name the first stage of the CPU's cycle.

Fetch

How do you indicate the END of multi-line comments in C++?

*/

In Visual Studio what is the file name extension of the file in which you type your code?

.cpp

What is the file name extension of the program that you sell to your customers?

.exe

What is the file name extension of the file you need to open in order to open the whole Visual Studio IDE?

.sln

How do you indicate the BEGINNING of multi-line comments in C++?

/*

What indicates the beginning of a comment line in C++?

//

How many ternary operators are there. Write a number.

1

1. [ ] << 2. [ ] >> A. stream object B. stream extraction object C. stream insertion operator D. stream command E. stream extraction operator F. stream insertion object

1. C) stream insertion operator 2. B) stream extraction operator

How many bits are needed to store the string "A"? Write a number.

16

How many bytes are needed to store the string "A" ? Write a number.

2

What is the ASCII value of '0' (the character zero)? Write a number.

48

What is the ASCII value of capital A? Write a number.

65

How many bits is a byte? Type an number.

8

What is the ASCII value of lower case a? Write a number.

97

What makes a C++ statement?

;

Which library do you need to include if you want to use formatting stream manipulators? Give ONLY the library name.

<iomanip>

What is the result of the following statements: char ch = 65; while ( ch = 'A' ) cout << ch++; cout << "ch = " << ch; Assume it is part of a complete C++ program. A) depends on the compiler B) Bch= B C) infinite loop. Prints BBBBBBBB... for ever D) infinite loop. Prints AAAAAA... for ever E) syntax error F) Ach=B G) ch = 65 H) 65ch = A I) 66 ch = A J) ch = A

D) infinite loop. Prints AAAAAA... for ever

What is include? Select ALL that apply. A) keyword B) string C) reserved word D) pre-processor directive E) a library name F) has no meaning in C++

D) preprocesser directive

A variable must be _____ before it is used in a program.

Declared

Name the second stage of the CPU's cycle.

Decode

What does the D in IDE stand for? Be careful with the spelling!

Development

What does the A in ALU stand for? Be careful with the spelling.

Arithmetic

What is the result of the following statements: int x = 8; if ((x = 3) && (x > 88)) cout << x; cout << "x = " << x; Assume it is part of a complete C++ program. A) run time error B) 8x = 8 C) x = 3 D) 8x = 3 E) syntax error F) depends on the compiler G) 3x = 3 H) x = 8

C) x = 3

What does the C in ASCII stand for? Be careful with the spelling!

Code

Parts of the CPU are the ALU and the _____ _____?

Control Unit

What is the result of this statement: cout << 5%3; Assume it is part of a complete C++ program. A) syntax error B) depends on the compiler C) 1 D) 2 E) 5 F) 3 G) run time error

D) 2

What will be the result of the following code int x = 3.6; if typed in a complete C++ program. A) the result will depend on the compiler you are using B) 4 will be stored in the memory location x C) syntax error D) 3 will be stored in the memory location x E) run time error F) 3.6 will be stored in the memory location x

D) 3 will be stored in the memory location x

What does the P in CPU stand for? Be careful with the spelling.

Processing

What does the R in RAM stand for? Be careful with the spelling.

Random

Another term for keywords is ____ words. (note that only one word is missing). Be careful with the spelling.

Reserved

What does the S in USB stand for? Be careful with the spelling.

Seriel

What does the S in ASCII stand for? Be careful with the spelling!

Standard

In what software category do utility programs belong to?

System software

Give the escape sequence that makes the computer beep.

\a

Give the escape sequence that moves the cursor to the beginning of the next line

\n

Give the full and proper name of cin Must give ALL terms in correct order. Be careful with the spelling.

console input stream object

What is the full and proper name of cout? Must give ALL terms in correct order. Be careful with the spelling.

console output stream object

Give the stream manipulator that moves the cursor to the next line.

endl

\n is a ______ ______. (note that you need to write two words). Be careful with the spelling.

escape sequence

In C++ main is a _______. (note that only one word is missing). Be careful with the spelling.

function

What is the name of the % operator?

modulus

Write the C++ statement that assigns the character backslash to an already declared character variable named myChar. Be careful with the formatting.

myChar = '\\';

Write the function call that calculates n^k (k is the exponent). You need to write the function call ONLY and NOT the statement. Be careful with the formatting.

pow

In C++ return is a _______. (note that only one word is missing). Be careful with the spelling.

statement

Give the full and proper name of << Must give ALL terms and in correct order. Be very careful with the spelling.

stream insertion operator

How do you call operators that take 3 operands? Give the name of the category.

ternary

How do you call operators that take 1 operand? Give the category name.

unary

What category does the = operator belong to when the classification is done by the number of operands?

binary

What is the result of the following statements: int x = 0; while (x++ < 10) { cout << ++x; } cout << "x = " << x; Assume it is part of a complete C++ program. A) 246810x = 11 B) depends on the compiler C) 0246810x = 12 D) 13579x = 11 E) 0246810x = 11 F) 13579x = 10 G) 246810x = 12 H) syntax error I) 02468x = 10 J) 0246810x = 10

A) 246810x = 11

'\n' is .... Select ALL that apply. Note the quotes! A) escape sequence B) character C) literal D) variable E) object F) stream G) keyword H) reserved word I) string J) stream manipulator

A) escape sequence B) character

What is the result of the following statements: int x = 10; while ( 1 > x > 20 ) cout << x++; cout << "x = " << x; Assume it is part of a complete C++ program. A) x = 10 B) syntax error C) run time error D) 1011121314151617181920x = 21 E) 10111213141516171819x = 20 F) depends on the compiler G) 11121314151617181920x = 20 H) infinite loop I) 111213141516171819x = 20 J) 1011121314151617181920x = 20

A) x = 10

What will happen if you have the following condition in an if statement in C++: x > 20 && x <= 10 A) syntax error B) The condition will be always false C) run time error D) true if x is in the (10, 20) range - both ends of the range are EXclusive E) depends on the compiler F) true if x is in the [10, 20) range - beginning of range is INclusive end is EXclusive G) true if x is in the [10, 20] range - both ends of the range are INclusive H) The condition will be always true I) The magic ball will tell you! J) true if x is in the (-5, -1] range - beginning of range is EXclusive end is INclusive

B) The condition will always be false

In the statement cout << "a"; the "a" is ... Select ALL that apply. A) character B) literal C) string D) the name of a variable E) object F) the name of a constant G) keyword H) reserved word I) comment

B) literal C) string

What is << ? A) punctuation mark B) operator C) symbol D) has no meaning in C++

B) operator

What type of operator is <=. Select ALL that apply. A) combination B) relational C) arithmetic D) shortcut E) ternary F) unary G) binary H) logical I) This operator does not exist in C++

B) relational

The statement char letterA = "C"; will result in ..... Select ALL that apply. A) storing the ASCII value of C represented in binary in the memory location letterA B) syntax error C) storing the character C in the memory location letterA D) run time error E) logical error

B) syntax error

What is the result of the following statements: char c = 65; cout << c; Assume it is part of a complete C++ program. A) syntax error B) the character A C) 65 D) run time error E) the character a F) depends on the compiler G) the character c

B) the character A

What is the result of the following statement: cout << 13 % 0; Assume it is part of a complete C++ program. A) 0 B) 1 C) syntax error D) run time error E) depends on the compiler F) 13

C) syntax error

What does the B in USB stand for? Be careful with the spelling.

Bus

What is the result of the following statement: cout << 0 % 11; Assume it is part of a complete C++ program. A) 1 B) depends on the compiler C) 0 D) syntax error E) 11 F) run time error

C) 0

What is the result of the following statements: i int main() { int x, y, c; char ch; cin >> x; c = cin.get(); cin >> y; cout << y; system("pause"); return 0; } Assume it is part of a complete C++ program and IF it runs the user will enter 36.25. A) depends on the compiler B) The ASCII value of '.' C) 25 D) 36 E) 2 F) syntax error G) the ASCII value of '2' H) run time error

C) 25

What is the result of the following statements: int x = 1; if ((x = 3) && (x > 2)) cout << x; cout << "x = " << x; Assume it is part of a complete C++ program. A) syntax error B) x = 1 C) 3x = 3 D) depends on the compiler E) x = 3 F) 3x = 1 G) run time error H) 1x = 1

C) 3x = 3

What is the result of this code: int x = 3; cout << ( x > 3 ? '\t' : "false"); Assume it is part of a complete C++ program. A) depends on the compiler B) run time error C) false will be printed on the monitor D) the cursor will be move forward 8 spaces E) the cursor will moved to the next tab stop F) t will be printed on the monitor G) syntax error

C) false will be printed on the monitor

In the statement cout << "Delta"; "Delta" is ____. Select ALL that apply. A) the name of a variable B) keyword C) literal D) stream E) comment F) the name of a constant G) reserved word H) string

C) literal H) string

What is the result of the following statements: int main () { int i = 3.5, y = 0.5; cout << i/y; system("pause"); return 0; } Assume it is part of a complete C++ program. A) 0 B) 6 C) run time error D) syntax error E) 3 F) 1 G) 7 H) depends on the compiler

C) runtime error

What is the result of the following code: cout << 7.0 % 5; Assume it is part of a complete C++ program. A) 7 B) run time error C) syntax error D) depends on the compiler E) 2 F) 5 G) 1

C) syntax error

What is the result of the following statements: int x = 180; if ( (x > 88) && (x = 3) ) cout << x; cout << "x = " << x; Assume it is part of a complete C++ program. A) depends on the compiler B) xx = x C) 8x = 8 D) syntax error E) x = 8 F) 180x = 180 G) 3x = 3 H) 180x = 3 I) 88 = 8 J) run time error

G) 3x = 3

What is the result of the following statements: int x = 54.99; cout << ( x > 54 ? x+2 : x); Assume they are part of a complete C++ program. A) run time error B) syntax error C) depends on the compiler D) 56.99 will print on the monitor E) 54.99 will print on the monitor F) 56 will print on the monitor G) 54 will print on the monitor

G) 54 will print on the monitor

What is cout? If more than one applies select all that apply. A) command B) Keyword C) function name D) class E) statement F) string G) operator H) object

H) object

What is the result of the following statements: int x = 8; if ( (x > 88) && (x = 3) ) cout << x; cout << "x = " << x; Assume it is part of a complete C++ program. A) xx = x B) depends on the compiler C) 8x = 3 D) 8x = x E) run time error F) 3x = 3 G) 8x = 8 H) x = 8 I) syntax error J) x = 3

H) x = 8

A(n) ______ is a diagram that graphically illustrate the structure of a program.

Hierarchy chart

What does the FIRST I in ASCII stand for? Be careful with the spelling!

Information

What are the three primary activities of a program? Write them in order with just a space between them (no , or and). Be careful with the spelling.

Input processing output

What does the I in IDE stand for? Be careful with the spelling!

Integrated

What does the SECOND I in ASCII stand for? Be careful with the spelling!

Interchange

What does the L in ALU stand for? Be careful with the spelling.

Logic

What does the M in RAM stand for? Be careful with the spelling.

Memory

What does the U in CPU stand for? Be careful with the spelling.

Unit

What does the U in USB stand for? Be careful with the spelling.

Universal

How do you call operators that take 2 operands? Give the category name.

binary


Ensembles d'études connexes

Chapter 12: The Postpartum Woman

View Set

The Language of Medicine chapter 7

View Set

Finding Area of Squares and Rectangles

View Set

Intro to Phycology- Chapter 1 Quiz

View Set

Unit 2: Nutrition, Metabolism, and Thermoregulation (Connect)

View Set

child, older adult, and intimate partner violence quiz 1116 (not finished)

View Set

CH 27 - Assessment of the Respiratory System

View Set