Computing Fundamentals Practice Quiz (1-3)

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/149

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 8:58 PM on 10/4/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

150 Terms

1
New cards

What does the term hardware refer to?

The physical components that make up a computer

2
New cards

A(n) __________ is a set of instructions that the computer follows to solve a problem.

program

3
New cards

Computer programs are also known as

software

4
New cards

At the heart of a computer is its central processing unit. The CPU's job is:

All of these

5
New cards

A computer stores a program while it is running

in main memory

6
New cards

The __________ decodes an instruction and generates an electronic signal

Control Unit

7
New cards

The CPU's control unit retrieves the next instruction in a sequence of program instructions from main

memory in the __________ stage.

fetch

8
New cards

During which stage does the central processing unit analyze the instruction and encode it in the form of

a number, and then generate an electronic signal?

decode

9
New cards

The two parts of the CPU are

the Control Unit and the Arithmetic and Logic Unit

10
New cards

A volatile type of memory that is used for temporary storage is

RAM

11
New cards

The purpose of a memory address is:

to identify the location of a byte in memory

12
New cards

Programs are normally stored in __________ and loaded into main memory as needed

secondary storage

13
New cards

A computer monitor is a type of

output device

14
New cards

Which of the following is not a common input device

printer

15
New cards

Which of the following is not one of the major components of a computer system?

the preprocessor

16
New cards

A set of well-defined steps for performing a task or solving a problem is known as a(n):

algorithm

17
New cards

When a programmer saves to a file the statements he or she writes to create a program, these statements are

source code

18
New cards

The programmer usually enters source code into a computer with

text editor

19
New cards

In the process of translating a source file into an executable file, which of the following is the correct sequence?

Source code, preprocessor, modified source code, compiler, object code, linker, executable code.

20
New cards

An Integrated Development Environment (IDE) typically consists of

All of the above

21
New cards

________ are used to translate each source code instruction into the appropriate machine language instruction.

compilers

22
New cards

This is a set of rules that must be followed when constructing a program

syntax

23
New cards

Words that have a special meaning and may be used only for their intended purpose are known as

Key words

24
New cards

Which of the following best describes an operator?

An operator allows you to perform operations on one or more pieces of data.

25
New cards

This is used in a program to mark the beginning or ending of a statement, or separate items in a list:

punctuation

26
New cards

Characters or symbols that perform operations on one or more operands are:

operators

27
New cards

This is a complete instruction that causes the computer to perform some action:

statement

28
New cards

A named storage location in the computer's memory that holds a piece of information is a(n):

variable

29
New cards

A variable definition defines the name of a variable that will be used in a program, as well as:

the type of data it will be used to hold

30
New cards

Three primary activities of a program are:

input, processing, output

31
New cards

Which step uncovers any syntax errors in your program?

compiling

32
New cards

Mistakes that cause a running program to produce incorrect results are called

logic errors

33
New cards

The programming process consists of several steps, which include

design, creation, testing, debugging

34
New cards

The first step in writing a program is to

clearly define what the program is to do

35
New cards

A model often used when creating a program that begins with the overall task and refines it into smaller subtasks is a(n)

hierarchy chart

36
New cards

A model often used when creating a program that begins with the overall task and refines it into smaller subtasks is a(n)

desk checking

37
New cards

The two methods used by C++ to write computer programs are:

procedural programming and object-oriented programming

38
New cards

In a C++ program, two slash marks (//) indica

the beginning of a comment

39
New cards

A statement that starts with a hashtag (or pound) symbol (#) is called a

a preprocessor directive

40
New cards

For every opening brace ({) in a C++ program, there must be

closing brace

41
New cards

The __________ is(are) used to display information on the computer's screen.

cout object

42
New cards

In the following statement, the characters Hello! are a(n)

cout << "Hello!";

string literal

43
New cards

The __________ causes the content of another file to be inserted into a program

#include directive

44
New cards

Which of the following must be included in any program that uses the cout object?

the header file iostream

45
New cards

Character constants in C++ are always enclosed in

single quotation marks ( ' ' )

46
New cards

Every complete C++ program must have a

function names main

47
New cards

In a cout statement, which of the following will advance the output position to the beginning of the next line?

endl or \n

48
New cards

What will the following code display?

cout << "Monday";

cout << "Tuesday";

cout << "Wednesday";

MondayTuesdayWednesday

49
New cards

What will the following code display?

int number = 23;

cout << "The number is " << "number" << endl;

The number is number

50
New cards

What will the following code display?

cout << "Four\n" << "score\n";

cout << "and" << "\nseven";

cout << "\nyears" << " ago" << endl;

Four

score

and seven

years ago

51
New cards

What will the following code display?

cout << "Roses " << "are red";

cout << "and " << "violets/n"

cout << "are" << "blue" << endl;

Roses are red and violets/nare blue

52
New cards

Which control sequence is used to skip over to the next horizontal tab stop?

\t

53
New cards

A(n) __________ represents a storage location in the computer's memory.

variable

54
New cards

Data items whose values do not change while the program is running are

literals

55
New cards

A variable definition tells the computer

the variable's name and the type of data it will hold

56
New cards

You must have a _____________ for every variable you intend to use in a program.

variable definition

57
New cards

Which of the following is not a valid C++ identifier?

1user

58
New cards

What will the following code display?

int x = 23, y = 34, z = 45;

cout << x << y << z << endl;

233445

59
New cards

The numeric data types in C++ can be broken into two general categories which are

integers and floating-point numbers

60
New cards

Besides the decimal number system that is most common (base 10), two other number systems that can be used in C++ programs are

octal and hexadecimal

61
New cards

A character literal is __________, whereas a string literal is __________

enclosed in single quotation marks, enclosed in double quotation marks

62
New cards

Which data type typically requires only one byte of storage?

char

63
New cards

In C++11, if you want an integer literal to be treated as a long long int, you can append__________ at the end of the number.

LL

64
New cards

The data type used to declare variables that can hold real numbers is

double

65
New cards

The float data type is considered ___________ precision and the double data type is considered__________ precision

single, double

66
New cards

Which of the following statements correctly assigns the character M to the variable named letter?

letter = ‘M’;

67
New cards

Which of the following lines must be included in a program that has string variables?

#include<string>

68
New cards

Assuming that a program has the following string object definition, which statement correctly assigns the string literal "Jane" to the string object? string name;

name = "Jane";

69
New cards

In memory, C++ automatically places a(n) __________ at the end of string literals which __________.

null terminator, marks the end of the string

70
New cards

Which of the following defines a double-precision floating-point variable named payCheck?

double payCheck;

71
New cards

The data type of a variable whose value can be either true or false is

bool

72
New cards

What will be the output after the following lines of code execute?

bool choice;

choice = true;

cout << "Your choice is " << choice << endl;

Your choice is 1

73
New cards

Using C++11: What data type does the compiler determine for the variable cost in the following

statement?

auto cost = 14.95;

double

74
New cards

A variable's __________ is the part of the program that has access to the variable.

scope

75
New cards

What is the value stored in the variable myNum after the following assignment statement executes? myNum = 23 % 5

3

76
New cards

What is the value of cookies after the following statements execute?

int number = 38, children = 4, cookies;

cookies = number % children;

2

77
New cards

What is the value of number after the following statements execute?

int number;

number = 18 / 4;

4

78
New cards

What is the value of number after the following statements execute?

int number;

number = 18 % 4 + 2;

4

79
New cards

What is output of the following statement?

cout << 4 * (15 / (1 + 3)) << endl;

12

80
New cards

Which part of the following line is ignored by the compiler?

double userName = "janedoe"; // user's name is janedoe

//user’s name is janedoe

81
New cards

A multi-line comment

all are true

82
New cards

Which of the following statements correctly defines a named constant named TAX_RATE that holds

the value 0.075?

const double TAX_RATE = 0.075;

83
New cards

Given the following program, which line(s) cause(s) output to be displayed on the screen?

1 // This program displays my gross wages.

2 // I worked 40 hours and I make $20.00 per hour.

3 #include <iostream>

4 using namespace std;

5

6 int main()

7 {

8 int hours;

9 double payRate, grossPay;

10

11 hours = 40;

12 payRate = 20.0;

13 grossPay = hours * payRate;

14 cout << "My gross pay is $" << grossPay << endl;

15 return 0;

16 }

line 14

84
New cards

The __________ causes a program to wait until information is typed at the keyboard and the [Enter] key is pressed.

cin object

85
New cards

The __________ operator always follows the cin object, and the __________ operator follows the cout object.

>>, <<

86
New cards

Which of the following must be included in any program that uses the cin object?

the header file iostream

87
New cards

When a user types values at the keyboard, those values are first stored

in the keyboard buffer

88
New cards

Which of the following will allow the user to input the values 15 and 20 and have them stored in variables named base and height, respectively?

cin >> base >> height;

89
New cards

What will be displayed after the following statements execute?

int num1 = 5;

int num2 = 3;

cout << "The result is " << (num1 * num2 + 10) << endl;

The result is 25

90
New cards

What is the value of result after the following statement executes?

result = (3 * 5) % 4 + 24 / (15 - (7 - 4));

5

91
New cards

In the following statement, what will be executed first according to the order of precedence?

result = 6 - 3 * 2 + 7 - 10 / 2;

3 * 2

92
New cards

Associativity is either right to left or

left to right

93
New cards

What is the value of x after the following code executes?

int x = 0;

int y = 5;

int z = 4;

x = x + y + z * 2;

13

94
New cards

What is the value of average after the following code executes?

double average;

average = 1.0 + 2.0 + 3.0 / 3.0;

4.0

95
New cards

What is the value of cube after the following code executes?

double cube, side;

side = 5.0;

cube = pow(side, 3.0);

125.0

96
New cards

When the final value of an expression is assigned to a variable, it will be converted to

the data type of the variable

97
New cards

When C++ is working with an operator, it strives to convert operands to the same type. This is known as

type conversion

98
New cards

When a variable is assigned a number that is too large for its data type, it

overflows

99
New cards

What is the value of x after the following code executes?

int x;

x = 3 / static_cast<int>(4.5 + 6.4);

0

100
New cards

Which statement is equivalent to the following?

number += 1;

number = number +1;