Programming Fundamentals 1: Exam 1 (Ch 1-3)

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

This is a complete instruction that causes the computer to perform some action: -line -variable -statement -None of these -key word

statement

Why were computer programming languages invented?

To ease the task of programming. Programs may be written in a programming language, and then converted to machine language.

A common practice for getting unique seed values is to call the time function which returns the number of seconds that have elapsed since midnight, Jan 1, 1970 -True/False

True

A named constant is like a variable, but it its content cannot be changed while the program is running. True/False

True

A value is stored in a variable with an assignment statement. -True/False

True

C++ does not have a built-in data type for storing strings of data. True/False

True

Escape sequences are always stored internally as a single character. -True/False

True

Floating point constants are normally stored in memory as doubles. -True/False

True

Floating point constants are normally stored in memory as doubles. True/False

True

In C++, key words are written in all lowercase letters. -True/False

True

In order to get results that are not pseudorandom, the rand() and srand() functions must be used. srand() accepts an unsigned int as a seed value for the algorithm -True/False

True

It is easier to write a program in a high-level language than in machine language because high-level languages are more like "natural" speech. -True/False

True

Programming style refers to the way a programmer uses elements such as identifiers, spaces, and blank lines. True/False

True

The CPU is the most important component in a computer because without it, the computer could not run software. -True/False

True

The arguments that you pass to the pow function as well as the variable used to store the pow's return value should be doubles -True/False

True

The cin >> statement will stop reading input when it encounters a newline character. -True/False

True

The only difference between the get function and the >> operator is that get reads the first character typed, even if it is a space, tab, or the [Enter] key. -True/False

True

The precedence of combined assignment operators is lower than that of regular math operators -True/False

True

The time function requires the <ctime> header file and 0 must be the argument of the function -True/False

True

Which of the following statements correctly defines a named constant named TAX_RATE that holds the value 0.075? -double TAX_RATE = 0.075; -const TAX_RATE; double TAX_RATE = 0.075; -const TAX_RATE = 0.075; -double TAX_RATE; const TAX_RATE = 0.075; -const double TAX_RATE = 0.075;

const double TAX_RATE = 0.075;

Why is the computer used by so many different people, in so many different professions?

Because the computer can be programmed to do so many different tasks

What will the following code display? cout << "Four\n" << "score\n"; cout << "and" << "\nseven"; cout << "\nyears" << " ago" << endl; -Four score and seven years ago -Four score and seven years ago -Four score and seven years ago -Four score and seven years ago

Four score and seven years ago

Which type of file is ready to run, containing the machine language code translated from the programmer's source file, as well as the code for any library routines.

Executable file

In C++, it is impossible to display the number 34.789 in a field of 9 spaces with 2 decimal places of precision. -True/False

False

Machine language is an example of a high-level language. -True/False

False

The preprocessor executes after the compiler. -True/False

False

When a program uses the setw manipulator, the iosetwidth header file must be included in a preprocessor directive. -True/False

False

_______________ languages are close to the level of humans in terms of readability _______________ languages are close to the level of the computer

High-level, Low-level

The ________ is(are) used to display information on the computer's screen. -opening and closing quotation marks -cout object -opening and closing braces -None of these -backslash

cout object

To use the rand()function, you must include the ________ header file? -cstdlib -cstring -iostream -cmath -iomanip

cstdlib

When a user types values at the keyboard, those values are first stored -as ASCII characters -in the header file iostream -in the keyboard buffer -as integers -None of these

in the keyboard buffer

The numeric data types in C++ can be broken into two general categories which are -numbers and characters -singles and doubles -integers and floating-point numbers -real and unreal numbers -numbers and literals

integers and floating-point numbers

Words that have special meaning in a programming language

key words

This manipulator causes the field to be left justified with padding spaces printed to the right: -left_justify -right -left -left_pad -None of these

left

Associativity is either right to left or -top to bottom -front to back -left to right -undeterminable -None of these

left to right

Which of the following statements correctly assigns the character M to the variable named letter? -letter = 'M'; -letter = "M"; -letter = (M); -letter = M -letter = M;

letter = 'M';

Data items whose values do NOT change while the program is running are -literals -characters -None of these -variables -integers

literals

In memory, C++ automatically places a(n) ________ at the end of string literals which ________. -bracket, marks the end of the string -None of these -null terminator, marks the end of the string -\n, indicates an escape sequence -semicolon, indicates the end of the statement

null terminator, marks the end of the string

When a variable is assigned a number that is too large for its data type, it -underflows -overflows -reverses -converts -None of these

overflows

A statement that starts with a hashtag (or pound) symbol (#) is called a -comment -header file -function -preprocessor directive -None of these

preprocessor directive

Which of the following functions will return the value of x, rounded to the nearest whole number? -abs(x) -fmod(x) -sqrt(x) -round(x) -whole(x)

round(x)

A variable's ________ is the part of the program that has access to the variable. -assignment -scope -None of these -value -data type

scope

You can control the number of significant digits in your output with the ________ manipulator. -setprecision -set_precision -to_fixed -setfixed() -None of these

setprecision

This manipulator is used to establish a field width for the value that follows it: -field_width -set_field -setw -iomanip -None of these

setw

Computer programs are also known as -firmware -software -Any of these -hardware -None of these

software

The general format for type cast expressions is _____________________

static_cast<DataType>(Value)

In the following statement, the characters Hello! are a(n) cout << "Hello!"; -variable -comment -None of these -object -string literal

string literal

Rules that must be followed when constructing a program

syntax

When the final value of an expression is assigned to a variable, it will be converted to -the smallest C++ data type -the largest C++ data type -the data type of the variable -the data type of the expression -None of these

the data type of the variable

When C++ is working with an operator, it strives to convert operands to the same type. This is known as -type correction -type conversion -promotion -demotion -None of these

type conversion

Which part of the following line is ignored by the compiler? double userName = "janedoe"; // user's name is janedoe -user's name is -"janedoe" -user's name is janedoe -// -None of these

user's name is janedoe

A named storage location in the computer's memory that holds a piece of information is a(n): -key word -variable -operator -statement -None of these

variable

You must have a ________ for every variable you intend to use in a program. -None of these -purpose -memory space -variable definition -literal value

variable definition

What is the value of x after the following code executes? int x; x = 3 / static_cast<int>(4.5 + 6.4); -0.3 -0 -0.275229 -3.3 -None of these

0

What is output of the following statement? cout << 4 * (15 / (1 + 3)) << endl; -12 -None of these -72 -63 -15

12

Because C++ is case-sensitive, all programs must have a function called main or Main. True/False

False

C++ 11 introduced an alternative way to define variables, using the template key word and an initialization value. -True/False

False

If you want to know the length of the string that is stored in a string object, you can call the object's size member function. -True/False

False

In C++ you are required to name your variables so they indicate the purpose they will be used for. -True/False

False

The programmer usually enters source code into a computer with -a text editor -a compiler -a hierarchy chart -None of these -pseudocode

a text editor

A _____________________ lets you manually promote or demote a value

type cast expression

Word processing programs, spreadsheet programs, e-mail programs, web browsers, and game programs belong to what category of software?

application software

The numbers or values inside the parentheses in a function are ______________________

arguments

A(n) ________ is a set of instructions that the computer follows to solve a problem. -None of these -linker -program -compiler -operator

program

Words or names defined by the programmer

programmer-defined symbols

A _________________ is a logical error that occurs while the program is running

runtime error

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 -flowchart -UML diagram -blueprint -None of these

hierarchy chart

Information a program gathers from the outside world

input

The header file that is needed for the setw, setprecision, fixed, showpoint, and left and right manipulators is_________________

iomanip

Mistakes that cause a running program to produce incorrect results are called: -logic errors -compiler errors -syntax errors -linker errors -None of these

logic errors

Mistakes that cause a running program to produce incorrect results are called: -syntax errors -None of these -linker errors -logic errors -compiler errors

logic errors

Character constants in C++ are always enclosed in -single quotation marks ( ' ' ) -braces ( { } ) -brackets (< >) -Any of these -pound sign and semicolon ( # ; )

single quotation marks ( ' ' )

The float data type is considered ________ precision and the double data type is considered ________ precision. -single, double -double, single -floating-point, double -floating-point, integer -None of these

single, double

A _______________ error is the misuse of a key word, operator, punctuation, or other part of the programming language. A ________________ error is a mistake that causes the program to produce the wrong results.

syntax, logical

The ________ operator always follows the cin object, and the ________ operator follows the cout object. -binary, unary -conditional, binary ->>, << -<> -None of these

>>, <<

An Integrated Development Environment (IDE) typically consists of -All of these -a text editor -None of these -a debugger -a compiler

All of these

Programs are often referred to as hardware. -True/False

False

Pseudocode is a form of a program statement that will always evaluate to "false." -True/False

False

The fixed manipulator causes a number to be displayed in scientific notation. -True/False

False

The following statement will output $5.00 to the screen: cout << setprecision(5) << dollars << endl; -True/False

False

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. -LONG LONG -<LONG> -LL -L -<L L>

LL

________________ is the only language computers really process.

Machine language

What will the following code display? cout << "Monday"; cout << "Tuesday"; cout << "Wednesday"; -"Monday" "Tuesday" "Wednesday" -"Monday" "Tuesday" "Wednesday" -Monday Tuesday Wednesday -Monday Tuesday Wednesday -MondayTuesdayWednesday

MondayTuesdayWednesday

The preprocessor reads a program before it is compiled and only executes those lines beginning with # symbol. -True/False

True

The setw manipulator only establishes a field width for the value immediately following it, and after that value is printed, cout goes back to its default method of printing -True/False

True

The term "bit" stands for binary digit. -True/False

True

When C++ is working with an operator, it strives to convert the operands to the same type. -True/False

True

cin requires the user to press the Enter key when finished entering data True/False

True

What do you call a program that performs a specialized task, such as a virus scanner, a file-compression program, or a data-backup program

a utility program

Arithmetic operators that share the same precedence have right to left associativity -True/False

False

A CPU only understands machine language instructions. -True/False

True

Which of the following lines must be included in a program that has string variables? -None of these -#include <string> -string var; -#include (string class) -#include namespace std;

#include <string>

The ________ causes the content of another file to be inserted into a program. -None of these -semicolon (;) -#include directive -cout object -double slash (//)

#include directive

Select all that apply. Using C++11: Which of the following can be used to initialize an integer variable named dozen with the value of 12? -int dozen(12); -int dozen = 12; -int dozen = (12); -int dozen = {12}; -int dozen {12};

-int dozen(12); -int dozen = 12; -int dozen {12};

What is the value of cube after the following code executes? double cube, side; side = 5.0; cube = pow(side, 3.0); -25.0 -15.0 -125.0 -8.0 -unknown

125.0

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; -18 -0 -13 -26 -unknown

13

What will the following code display? int x = 23, y = 34, z = 45; cout << x << y << z << endl; -xyz -23 34 45 -23 34 45 -233445

233445

What is the value stored in the variable myNum after the following assignment statement executes? myNum = 23 % 5 -115 -4 -3 -None of these -4.6

3

What will the following code display? cout << "Roses " << "are red"; cout << "and " << "violets/n" cout << "are" << "blue" << endl; -Roses are redand violets/nareblue -Roses are red and violets/n are blue -Roses are red and violets are blue -Roses are red and violets/nare blue

Roses are redand violets/nareblue

What will the following code display? int number = 23; cout << "The number is " << "number" << endl; -The number is -The number is null -The number is number -The number is 23 -The number is23

The number is number

The data type of a variable whose value can be either true or false is -T/F -binary -int -Boolean -bool

bool

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; -cin base, height; -cin >> base >> height; -cin base >> cin height; -None of these

cin >> base >> height;

The ________ causes a program to wait until information is typed at the keyboard and the [Enter] key is pressed. -output stream -cin object -cout object -preprocessor -None of these

cin object

A(n) _____________ is an example of a secondary storage device

disk

Using C++11: What data type does the compiler determine for the variable cost in the following statement? auto cost = 14.95; -int -char -double -bool -string

double

Using C++11: What data type does the compiler determine for the variable cost in the following statement? auto cost = 14.95; -int -string -double -char -bool

double

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

double payCheck;

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

double payCheck;

In memory, C++ automatically places a(n) ________ at the end of string literals which ________. -\n, indicates an escape sequence -semicolon, indicates the end of the statement -null terminator, marks the end of the string -None of these -bracket, marks the end of the string

null terminator, marks the end of the string

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 fractal -base 2 and binary -octal and hexadecimal -base 2 and base 4 -None of these

octal and hexadecimal

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 5 * 3 + 10 -The result is (num1 * num2 + 10) -The result is 25 -The result is 65 -None of these

The result is 25

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 choice -None of these -true -Your choice is 1 -Your choice is true

Your choice is 1

Which control sequence is used to skip over to the next horizontal tab stop? -\b -\n \' -end1 -\t

\t

Which step uncovers any syntax errors in your program? -executing -compiling -None of these -linking -editing

compiling

Which data type typically requires only one byte of storage? -char -float -string -int -short

char

Which of the following statements will pause the screen until the [Enter] key is pressed? -cin; -cin.getline(); -cin.get(); -cin.ignore(); -cin.input();

cin.get();

Which of the following statements will allow the user to enter three values to be stored in variables length, width, and height, in that order? -cin << length, width, height; -cin.get(height, width, length); -cin.get(length, width, height); -cin >> length; width; height; -cin.get(length >> width >> height);

cin.get(length, width, height);

Which of the following functions tells the cin object to skip one or more characters in the keyboard buffer? -cin.ignore -cin.jump -cin.hop -cin.skip -None of these

cin.ignore

The first step in writing a program is to -clearly define what the program is to do -visualize logical errors -None of these -type the code -visualize the program running on a computer

clearly define what the program is to do

For every opening brace ({) in a C++ program, there must be a -None of these -string literal -closing brace -function -comment

closing brace

The function pow(x, y), requires which header file? -cstdlib -cstring -iostream -cmath -iomanip

cmath

The header file needed for special mathematical library functions such as the pow, cos, abs, log, fmod, round, and sqrt functions is ________________

cmath

In a cout statement, which of the following will advance the output position to the beginning of the next line? -\n or \t -endl or \n -end1 or /n -\t or \b -\\ or \'

endl or \n

The CPU's control unit fetches the program's next instruction from main memory

fetch

The CPU's control unit retrieves the next instruction in a sequence of program instructions from main memory in the ________ stage. -decode -fetch -portability -execute

fetch

This manipulator forces cout to print digits in fixed-point notation: -setprecision(2) -setw(2) -fixed -setfixed(2) -None of these

fixed

The data type used to declare variables that can hold real numbers is -short -char -double -float -int

float

The way a value is printed is called its _______________

formatting

Every complete C++ program must have a -function named main -cout statement -symbolic constant -None of these -comment

function named main

________ reads a line of input, including leading and embedded spaces, and stores it in a string object. -cin.get -getline -cin.getline -get -None of these

getline

Which of the following statements will read an entire line of input into the string object, address? -cin << address; -cin address; -cin.get(address); -getline(cin, address); -cin.get(length >> width >> height);

getline(cin, address);

A debugging process where you, the programmer, pretend you are a computer and step through each statement while recording the value of each variable at each step is known as -error checking -hand writing -hand tracing -error handling -None of these

hand tracing

A diagram that graphically illustrates the structure of a program

hierarchy chart

A variable definition defines the name of a variable that will be used in a program, as well as: -the number of times it will be used in the program -None of these -the type of data it will be used to hold -the value it will hold -the operators that will be used on it

the type of data it will be used to hold

Which of the following is NOT a valid C++ identifier? -theLittleBrownFoxWhoRanAway -1user -_1user -employee_number -April2018

1user

What is the value of cookies after the following statements execute? int number = 38, children = 4, cookies; cookies = number % children; -.5 -2 -9 -4 -9.5

2

What is the value of number after the following statements execute? int number = 10; number += 5; number -= 2; number *= 3; -3 -30 -39 -2 -None of these

39

What is the value of number after the following statements execute? int number; number = 18 % 4 + 2; -4 -unknown -0 -3 -6.5

4

What is the value of number after the following statements execute? int number; number = 18 / 4; -0 -4.5 -4 -2 -unknown

4

What is the value of number after the following statements execute? int number; number = 18 / 4; -2 -4 -unknown -4.5 -0

4

What is the value of average after the following code executes? double average; average = 1.0 + 2.0 + 3.0 / 3.0; -2.0 -3.0 -4.0 -2 -unknown

4.0

How many characters will the following statement read into the variable myString? cin >> setw(10) >> myString; -9 -10 -11 -however many characters are in myString -None of these

9

Internally, the CPU consists of the _________________ and the _____________________

Arithmetic Logic Unit (ALU) and Control Unit

________________________, also known as compound operators and arithmetic assignment operators, are in such statements as number += 1 (number = number +1)

Combined assignment operators

What is TRUE about the following statement? cout << setw(4) << num4 << " "; -It allows four spaces for the value in num4. -It outputs "setw(4)" before the value in num4. -It is incorrect because it should use setw(10). -It is incorrect because it should use setw(num4).

It allows four spaces for the value in num4.

___________________ means to assign the same value to several variables with one statement such as a = b = c = 12;

Multiple assignment

When sending an expression that consists of an operator to cout, it is always a good idea to put parentheses around the expression b/c some advanced operators will yield unexpected results otherwise -True/False

True

When the fixed manipulator is used, the value specified by the setprecision manipulator will be the number of digits to appear after the decimal point. -True/False

True

When typing your source code into the computer, you should be careful since most of your C++ instructions, header files, and variable names are case sensitive. -True/False

True

With most compilers, trailing zeros are displayed when the setprecision and fixed manipulators are used together -True/False

True

You can limit the range of random numbers by using y = (rand() % (maxValue - minValue + 1)) + minValue; -True/False

True

Select all that apply. Which of the following statements is(are) TRUE about named constants? -The content of a named constant is read-only. -None of these -A named constant is defined using the const qualifier. -A named constant must be all uppercase. -The value of a named constant cannot be changed while the program is running.

-The content of a named constant is read-only. -A named constant is defined using the const qualifier. -The value of a named constant cannot be changed while the program is running.

How many operands does each of the following types of operators require? _____ Unary _____ Binary _____ Ternary

1, 2, 3

Place the steps for writing a program in the correct order. -Clearly define what the program is to do -Use design tools such as a hierarchy chart, flowcharts, or pseudocode to create a model of the program. -Check the model for logical errors. -Correct any errors found during compilation. Save, compile and correct additional errors as needed. -Type the code, save it, and compile it. -Visualize the program running on the computer. -Validate the results of the program. -Run the program with test data for input. -Correct any errors found while running the program. Repeat Steps 5 through 8 as many times as necessary.

1. Clearly define what the program is to do. 2. Visualize the program running on the computer. 3. Use design tools such as a hierarchy chart, flowcharts, or pseudocode to create a model of the program. 4. Check the model for logical errors. 5. Type the code, save it, and compile it. 6. Correct any errors found during compilation. Save, compile and correct additional errors as needed. 7. Run the program with test data for input. 8. Correct any errors found while running the program. Repeat Steps 5 through 8 as many times as necessary. 9. Validate the results of the program.

At the heart of a computer is its central processing unit. The CPU's job is: -None of these -to produce some outcome or resultant information -to fetch instructions -All of these -to carry out the operations commanded by the instructions

All of these

A multi-line comment -begins with /* and ends with */ -All of these are true -allows everything in the selected lines to be ignored -can be used to mark as many lines as desired as comments

All of these are true

What type of software controls the internal operations of the computer's hardware? -A database -An operating system -The computer's WYSIWYG system -The RAM

An operating system

What is the difference between system software and application software? -Application software must be installed at the factory before a computer is shipped. An operating system can be installed by consumers. -An operating system is specific to the brand of the computer being used. Application software can be installed on computers of any brand. -An operating system is a set of programs that manages the computer's hardware devices and controls their processes. Application software consists of programs that users use to solve specific problems or perform general operations. -Application Software is a set of programs that manages the computer's hardware devices and controls their processes. An operating system consists of programs that users use to solve specific problems or perform general operations.

An operating system is a set of programs that manages the computer's hardware devices and controls their processes. Application software consists of programs that users use to solve specific problems or perform general operations.

Which of the following best describes an operator? -An operator allows you to perform operations on one or more pieces of data. -An operator is a symbolic name that refers to a variable. -An operator marks the beginning or ending of a statement, or is used to separate items in a list. -An operator is a word that has a special meaning. -An operator is a rule that must be followed when constructing a program.

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

Which of the following best describes an operator? -An operator marks the beginning or ending of a statement, or is used to separate items in a list. -An operator is a symbolic name that refers to a variable. -An operator allows you to perform operations on one or more pieces of data. -An operator is a word that has a special meaning. -An operator is a rule that must be followed when constructing a program.

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

The job of the ______________ is to fetch instructions, carry out the operations commanded by the instructions, and produce some outcome or resultant information.

CPU

The ________ decodes an instruction and generates an electronic signal. -None of these -Main memory -Control Unit -BIOS -Arithmetic and Logic Unit

Control Unit

In programming, the terms "line" and "statement" always mean the same thing. -True/False

False

Both main memory and secondary storage are types of memory. Describe the difference between the two. -Main memory, or RAM, is volatile, which means its contents are erased when power is removed from the computer. Secondary memory, such as a disk, does not lose its contents when power is removed from the computer. -Secondary memory loses its contents when power is removed from the computer. Main memory does not lose its contents when power is removed from the computer. -Main memory has unlimited storage capabilities while secondary storage typically has less storage capability. -The differences that used to exist do not exist in modern computers.

Main memory, or RAM, is volatile, which means its contents are erased when power is removed from the computer. Secondary memory, such as a disk, does not lose its contents when power is removed from the computer.

Which type of file contains machine language instructions but no library routines that may be necessary to the program? -Executable file -Object file -Data file -XML file

Object file

A volatile type of memory that is used for temporary storage is -None of these -the ALU -RAM -a disk drive -an address

RAM

In the process of translating a source file into an executable file, which of the following is the correct sequence? -Source code, linker, object code, compiler, modified source code, preprocessor, executable code. -Source code, preprocessor, modified source code, compiler, object code, linker, executable code. -Source code, preprocessor, modified source code, linker, object code, compiler, executable code -Preprocessor, source code, compiler, executable code, linker, modified source code, object code -Source code, compiler, modified source code, preprocessor, object code, linker, executable code.

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

_______________ contains program statements written by the programmer. _______________ contains machine language instructions, generated by the compiler translated from the source file. _______________ contains code ready to run on the computer. Includes the machine language from an object file, and the necessary code from library routines.

Source file, Object file, Executable file

List the 5 major hardware components of a computer system.

The Central Processing Unit (CPU), main memory, secondary storage devices, input devices, output devices

On any computer, which data type uses more memory, an integer or an unsigned integer?

They both use the same amount of memory

Which of the following literals uses more memory? 20 or 20L

They both use the same amount of memory

Software engineering is a field that encompasses designing, writing, testing, debugging, documenting, modifying, and maintaining computer programs. -True/False

True

A set of well-defined steps for performing a task or solving a problem is known as a(n): -statement -instruction set -algorithm -hierarchy chart -None of these

algorithm

________ are used to translate each source code instruction into the appropriate machine language instruction. -preprocessor directives -None of these -modules -runtime libraries -compilers

compilers

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? -fetch -portability -decode -execute

decode

The control unit decodes the instruction, which is encoded in the form of a number. An electrical signal is generated

decode

The programming process consists of several steps, which include: -key words, operator definitions, punctuation -input, processing, output -None of these -design, creation, testing, debugging -syntax, logic, error handling

design, creation, testing, debugging

The term that refers to the programmer reading the program from the beginning and stepping through each statement is -spot checking -software engineering -pseudocoding -None of these -desk checking

desk checking

A character literal is ________, whereas a string literal is ________ -None of these -enclosed in brackets, enclosed in quotation marks -enclosed in quotation marks, enclosed in brackets -enclosed in single quotation marks, enclosed in double quotation marks -enclosed in double quotation marks, enclosed in single quotation marks

enclosed in single quotation marks, enclosed in double quotation marks

The signal is routed to the appropriate component of the computer, which causes a device to perform an operation

execute

A computer stores a program while it is running -in the CPU -in main memory -None of these -on a hard disk -on the computer monitor

in main memory

Three primary activities of a program are: -variable definitions, operators, lists of key words -None of these -integer, floating-point, character definitions -input, processing, output -lines, statements, punctuation

input, processing, output

A program is a set of____________

instructions

The numeric data types in C++ can be broken into two general categories which are -singles and doubles -real and unreal numbers -numbers and characters -integers and floating-point numbers -numbers and literals

integers and floating-point numbers

Words that have a special meaning and may be used only for their intended purpose are known as -None of these -operators -key words -syntax -programmer defined words

key words

Programs written in a high-level language must be translated into machine language before they can be run because they can only process___________________

machine language instructions

Assuming that a program has the following string object definition, which statement correctly assigns the string literal "Jane" to the string object? -string name = <Jane>; -string name = {Jane}; -name = 'Jane'; -name = "Jane"; -name = Jane;

name = "Jane";

The two general categories of software are __________ and __________.

operating systems (system software), application software

Characters or symbols that perform operations on one or more operands are: -key words -operators -op codes -None of these -separators

operators

Characters or symbols that perform operations on one or more operands.

operators

Information a program sends to the outside world

output

A computer monitor is a type of -storage device -software -input device -output device -None of these

output device

A program's ability to run on several different types of computer systems is called_________________

portability

Means that a program may be written on one type of computer and run on another type

portability

The _________________ reads the source file searching for commands that begin with the # symbol. These are commands that cause the preprocessor to modify the source file in some way. The ________________ translates each source code instruction into the appropriate machine language instruction, and creates an object file. The ______________ combines the object file with necessary library routines.

preprocessor, compiler, linker

Which of the following is NOT a common input device -mouse -printer -digital camera -keyboard -All are common input devices

printer

The two methods used by C++ to write computer programs are: -top-down programming and procedural programming -None of these -procedural programming and object-oriented programming -pseudocoding and object-oriented programming -flowcharting and procedural programming

procedural programming and object-oriented programming

Computers can do many different jobs because they can be________________

programmed

Characters or symbols mark the beginning or end of programming statements, or separate items in a list

punctuation

This is used in a program to mark the beginning or ending of a statement, or separate items in a list: -operators -punctuation -key words -None of these -separators

punctuation

A variable's ________ is the part of the program that has access to the variable. -scope -None of these -data type -value -assignment

scope

Programs are normally stored in ________ and loaded into main memory as needed -the output device -None of these -secondary storage -the input device -the CPU

secondary storage

When a programmer saves to a file the statements he or she writes to create a program, these statements are -source code -None of these -a preprocessor file -high level -object code

source code

This is a set of rules that must be followed when constructing a program: -operators -punctuation -identifiers -syntax -key words

syntax

The two parts of the CPU are -the single-task device and the multi-task device -the Control Unit and the Arithmetic and Logic Unit -the software and the hardware -None of these -the output device and the input device

the Control Unit and the Arithmetic and Logic Unit

In a C++ program, two slash marks (//) indicate -the beginning of a comment -None of these -the beginning of a block of code -the end of a statement -the end of a program

the beginning of a comment

Which of the following must be included in any program that uses the cout object? -None of these -the header file iostream -comments -opening and closing braces -a namespace

the header file iostream

What does the term hardware refer to? -the logical flow of instructions -the relative difficulty of writing computer programs -None of these -the way a computer's storage space is organized -the physical components that make up a computer

the physical components that make up a computer

Which of the following is NOT one of the major components of a computer system? -main memory -secondary storage -input/output devices -the CPU -the preprocessor

the preprocessor

The purpose of a memory address is: -to prevent multitasking -to improve the speed of processing -to obtain an algorithm -to identify the location of a byte in memory -None of these

to identify the location of a byte in memory

A named storage location

variable


Kaugnay na mga set ng pag-aaral

Algebra 2: Line Graphs by Two Points

View Set

Unit 2: Chapter 8 Theoretical and Conceptual Frameworks

View Set

Gel Electrophoresis, Gel Electrophoresis

View Set

Physics Study Guide Chapters 1.1-1.6

View Set

Quiz 10 - Chapter 10: Fiscal Policy and Debt

View Set

ap psychology- chapter 14 and 15 test

View Set