C++ final exam

Ace your homework & exams now with Quizwiz!

what are the resulting value and type of the expression -23 + 7/2

-20, int

The expression 5 % 2 evaluates to

1

If the number has been defined as an int variable, both of the following statements will print out its; numeric value: cout << number; cout << "number";

False

The following is a valid identifier: 7up

False

The following is a valid identifier: first name

False

The following two C++ statements perform the same valid operation. regWaves = regPay + overTime; regPay + overTime = regWaves;

False

The purpose of the compiler is to convert objective code into source code

False

THe computers main memory is commonly known as

RAM

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

The beginning of a comment

__ causes a program to wait until information's is typed at the keyboard and the Enter key is pressed

The cin object

____ is/are used to display information on the computer's screen

The cout object/command

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

The data type of the varible

In any program that uses the cin object, you must #include ___

The iostream header file

The term hardware refers to

The physical components of a computer.

The purpose of a memory address is

To identify the location of a memory cell

A preprocessor/compiler directive does not require a semicolon at the end

True

C++ is a case-sensitive language. in other words, upper and lower case matters

True

The cin object can be sued to input more than one value in a single statement

True

The following is a valid identifier: Cout

True

The following is a valid identifier: NUM1

True

The following is a valid identifier: first_name

True

The following pair of C++ statements is legal double taxRate; taxRate = 0.2;

True

The following tow expressions will evaluate to the same result for all numbers a + b * c b * c + a

True

Variables represent storage locations in the computer's memory

True

When an operator's operands are of different data types, such as int and double, C++ automatically converts one of them so that they are the same data

True

For every opening brace a C++ program, there must be

a closing brace

What are the resulting value and resulting type of the expression 22.1 + 5.2

27.3, double

What is the resulting value and resulting type of the expression 18 % 5?

3, int

What is the results value and type of the expression 3/1?

3, int

The____ coordinates the computer's operations by fetching the next instruction and using control signals to regulate the other major computer components. it is the traffic cop so to speak

Control Unit

___ can override the rules of operator precedence

Parentheses

Creating a program requires many steps. Three of these are

Program design, writing source code, and testing

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

a definition

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

an algorithm nor pseudocode

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

constants

The ___ operators always follow the cin object, and the ___ operator follows the cout object

extraction, insetion

A variable called average should be declared as an integer data type because it will probably hold data that contains decimal places

false

Once a value has been stored in a variable it cannot be changed

false

The following is a valid identifier: first--name

false

At the heart of a computer is its" Central processing unit. The CPUs job is to

fetch insturctions, produce some outcome or resultant infromation, carry out the operations commanded by the instructions

C++ is an example of a

high-level language

The numeric data types in C++ are broken into two categories:

integer and float

If the variable letter has been defined as a char variable, which of the following is a valid assignment statement?

letter = 'w';

CHaracters or symbols that perform operations one or more operands are

operators

A statement that starts with a # is called

preprocessor directive/compiler directive

A _____ is a set of instructions that tells the computer how to solve a problem

program

A character constant (character literal) is enclosed in ____ quotation marks, whereas a string constant (string literal is enclosed in _____ quotations marks.

single, double

The statements written by the programmer are called

source code

In C++, a value is raised to a power by using

the pow function

most of the lines in a program contain something meaningful; however, some of the lines my contain nothing at all

true

Memory locations that can hold data are called

variables


Related study sets

Chapter 2 - Overview of the Data Mining Process

View Set

How Marlboro Changed Advertising Forever

View Set

Mental Health Chapter 19 NCLEX Questions

View Set