How can we help?

You can also find more resources in our Help Center.

61 terms

c++ main

STUDY
PLAY
The physical components that a computer is made of
What does the term hardware refer to?
A text editor, A debugger,A compiler
An Integrated Development Environment (IDE) typically consists of:
To identify the location of a byte in memory
The purpose of a memory address is:
RAM
The computer's main memory is commonly known as
Control Unit
The ________ decodes an instruction and generates electrical signals
Compilers
_______________ are used to translate each source code instruction into the appropriate machine language instruction.
operating systems
Which type of software have direct access to computer hardware components?
Source code
The statements written by the programmer are called:
The Output Device and the Input Device
Internally, the CPU consists of two parts:
stored-program architecture
The fundamental architecture for all computers are called:
A hard disk
An example of a secondary storage device is:
Preprocessor
Which of the following is not one of the five major components of a computer system?
Source code, preprocessor, modified source code, compiler, object code, linker, executable code.
In the process of translating a source file into an executable file, which of the following is the correct sequence?
False
Machine language is an example of a high-level language
The beginning of a comment
In a C++ program, two slash marks ( // ) indicate
Preprocessor directive
A statement that starts with a # is called a
Closing brace
For every opening brace in a C++ program, there must be a
#include directive
The _____ causes the contents of another file to be inserted into a program.
cout object
The ______ is/are used to display information on the computer's screen.
Comments
_____________ represent storage locations in the computer's memory.
Literals
These are data items whose values do not change while the program is running
definition
You must have a ___________ for every variable you intend to use in a program
3dGraph
Which one of the following would be an invalid variable name?
single, double
A character literal is enclosed in ________ quotation marks, whereas a string literal is enclosed in ________ quotation marks.
Null terminator '\0'
C++ automatically places a ___________ at the end of each string literal.
12
What is the output of the following statement?
Semicolon
This is used to mark the end of a complete C++ programming statement.
The header file iostream
____________ must be included in any program that uses the cout object.
2
Given the following C++ statements int number = 38, children = 4, cookies; cookies = number % children; What is the value of the variable cookies after the execution of the statement?
sizeof()
Which one of the following functions allows you to identify how many bytes of storage on your computer system an integer data value requires.
bool
A variable whose value can be either true or false is of this data type.
int x = 7, y = 16, z = 28;
How would you consolidate the following declaration statements into one statement? int x = 7; int y = 16; int z = 28;
function named main
Every complete C++ program must have a _____________.
14
Look at the following program and answer the question that follows it. 11 // 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 }
MondayTuesdayWednesday
What will the following code display?
letter = 'Z';
Assume that a program has the following variable definition: char letter; Which of the following statements correctly assigns the character Z to the variable?
4
What will the value of x be after the following statements execute? int x; x = 18.0 / 4;
>>, <<
The ______ operator always follows the cin object, and the ______ operator follows the cout object.
iostream header file
In any program that uses the cin object, you must include the ___________.
cin object
If you are reading data from a keyboard and you wanted the computer to recognize the space, tab, or Enter key as the delimiter to separate two input values, you would use the _______.
cin.get()
If you want the computer to recognize the Enter key as the input, you would use the _______.
eleven characters and the null terminator
The character array company[12] can hold
2.5
What is the value stored at x, given the statements: float x; x = static_cast<double>10/4 ;
cmath
The function, pow(x, 5.0) requires which header file to be included
cin >> length >> width >> height;
You want the user to enter the length, width, and height from the keyboard. Which cin statement is correctly written?
3 * 2
In the following C++ statement, what will be executed first according to the order of precedence. result = 6 - 3 * 2 + 7 - 10 / 2 ;
setw
This manipulator is used to establish a field width for the value immediately following it.
left
This manipulator causes the field to be left-justified with padding spaces printed to the right.
cin.getline()
Which one of the following reads an entire line of text, until the [Enter] key is pressed.
fstream
To allow file access in a program, you must #include this header file.
cin >> names;
Which statement will read a string into the following char array? char names[20];
Nine
The statement cin >> setw(10) >> str; will read up to this many characters into str.
ofstream
To write data to a file, you define an object of which one of the following
outFile << number;
Assuming outFile is a file stream object and number is a variable, which statement writes the contents of number to the file associated with outFile?
closes a file
Assuming dataFile is a file stream object, the statement dataFile.close();
opened
A file must be ________ before data can be written to or read from it.
number = number + 1;
Which statement is equivalent to the following? number += 1;
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.
False
When a program uses the setw manipulator, the iosetwidth header file must be included in a preprocessor directive.
False
The fixed manipulator causes a number to be displayed in scientific notation.
False
The statement cout << setprecision(5) << dollars << endl; will output $5.00 to the screen.