1/118
Yes
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
a binary digit
is a zero or a one
source code
The code that a programmer writes is
object code
compilers translate the instructions written by the program into
CPU
when a program runs on a computer, the part of the computer that carries out the instructions
software engineering is a field that encompasses designing, writing, testing, debugging, documenting, modifying, and maintaining computer programs.
true
in programming, the terms “line” and “statement” always mean the same thing.
false
in c++, key words are written in all lowercase letters.
true
the preprocessor executes after the compiler
false
machine language is an example of a high-level language
false
programs are often referred to as hardware
false
programming style refers to the way a programmer uses elements such as identifiers, spaces, and blank lines.
true
RAM is a volatile type of memory that is used for temporary storage
true
an input device can sometimes be an output device too
true
C++ is a specific purpose programming language
false
every C++ program must have a main function
true
the following code is a correct layout of a main function:
int main()
{
return 0;
}
true
in C++ rules of making identifiers, you are required to name your identifiers so they indicate the purpose for which they will be used for
false
there are eight bits in one byte. each bit stands for a binary digit. a binary digit is 0 or 1.
true
in c++, any Boolean value that is not zero is true.
true
internally, the CPU consists of
control unit and an arithmetic logic unit (ALU)
in the following statement, the characters Hello! are a(n)
string literal
#include directive
causes the content of another file to be inserted into a program
the header file iostream
must be included in any program that uses the cout object
none of these
fetch
the CPU’s control unit retrieves the next instruction in a sequence of program instructions from main memory in this stage
Roses are redand violets/nareblue
a variable definition tells the computer
the variable’s name, the type of data it will hold, and its value
requirements for identifiers:
the first character must be one of the letters a through z, A through Z, or an underscore character (_)
after the first character, you may use letters a through z or A through Z, the digits 0 through 9, or underscores.
uppercases and lowercase characters are distinct.
program
a set of instructions that the computer follows to solve a problem
none of these (correct answer is unsigned int value = 100;)
What will be the output after the following lines of code execute?
Your choice is1
What is the value of number after the following statements execute?
int number;
number = 18 / 4;
4
Given the following program, which line(s) cause(s) output to be displayed on the screen?
line 16
Suppose that the code segment in the below box were executed. What would be the value of z?
1
C++ is a general purpose programming language
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
the cin» statement will stop reading input when it encounters a newline character
true
if you want to know the length of the string that is stored in a string object, you can call the object’s sizeof() function
false
logic errors are discovered and reported by the compiler
false
some c++ programs may not have a main function
false
an identifier is a name that we assign to variables, constants, functions, classes, etc.
true
in c++,you are required to name your variables so they indicate the purpose they will be used for
false
int 88 = myValue; // This is a valid variable definition in C++
false
the if statement in c++ can exist without an else statement
true
if the expression on the left side of the following is true, the expression on the right side will not be checked
(a > = b) || (c == d)
true
a variable must have a valid name and data type
true
int dimes = 10, quarters = 25; // This is a valid c++ code
true
you should be careful when using the equality operator to compare floating point values because of potential round-off errors
true
for every open bracket, parentheses, and braces we must have a closing bracket, parentheses, and braces.
true
in c++, the two greater than symbol » is called stream insertion operator and is normally used with a cout statment.
false
the value of result in the following expression will be 0 if x has the value of 12.
result = x > 100 ? 0 : 1;
false
floating numbers are signed and unsigned
false
for compatibility purposes with C, false has a zero value and true is anything that is not zero
true
the purpose of a memory address is:
to identify the location of a byte in memory
Which of the following is not one of the major components of a computer system?
Secondary Storage
Main Memory
Input / Output Devices
The CPU
The preprocessor
The preprocessor
in the process of translating a source file into an executable file, which of the following is the correct sequence?
Source code, compiler, assembler, preprocessor, loader, linker.
Preprocessor, source code, compiler, assembler, linker, loader
Source code, preprocessor, compiler, assembler, linker, loader
Source code, preprocessor, assembler, linker, compiler, loader
None of these
Source code, preprocessor, compiler, assembler, linker, loader
variable
a named storage location in the computer’s memory that holds a piece of information
cout « endl; , cout « ‘\n’; , cout « “\n”;
will advance the output in a cout statement
compare numbers
relational operators allow you to
After the following code executes, what is the value of myValue if the user enters 0?
15
None of these
program
a set of instructions that the computer follows to solve a problem
type conversion
when c++ is working with an operator, it strives to convert operands to the same type
x<= y
what is the value of x after the following statements is executed?
int x = 0, y = 5, z = 10;
0
what is the value of the number after the following statements is executed?
int number;
number = 4 % 18
4
if you intend to place a block of statements within an if statement, you must place ___ around the block
curly braces { }
logical AND
&&
break
without this statement appearing in a switch construct, the program “falls through” all of the statements below the one with the matching case expression
literals or constants
data items whose value do not change while the program is running
a character literal is ______, whereas a string literal is _____
enclosed in single quotation marks, enclosed in double quotation mark
what is the value of x after the following code executes?
int x;
x = 3 / static_cast<int>(4.5 + 6.4);
0
The following code snippet has an error. The program is supposed to ask the user for the length and width of a rectangular room, and then display the room’s area. The program must multiply the width by the length in order to determine the area. Find the error
The error is in line 14 and line 19.
The following program has one or more errors. Find the error.
All the lines have at least one error.
Examine the following program and determine if there is an error. If there is an error, please select the line where you believe there is an error.
The error is in line 7.
Examine the following program and determine if there is an error. If there is an error, please select the line where you believe there is an error.
The error is in line 7.
Examine the following program and determine if there is an error. If there is an error, please select the line where you believe there is an error.
The error is in line 23.
Examine the following algorithm:
The variable x starts with the value 0.
The variable y starts with the value 5.
Add 1 to x .
Add 1 to y .
Add x and y , and store the result in y .
Subtract 3 from y .
Display the value in x on the screen.
What would be displayed on the screen if this was an actual program?
1
Examine the following code and determine the output of the program. What would be displayed on the screen once the program runs.
Syntax Error
Examine the following code and determine the output of the program:
What would be displayed on the screen if this was an actual program?
4
Examine the following code and determine the output of the program:
What would be displayed on the screen if this was an actual program?
0
Examine the following code and determine the output of the program:
What would be displayed on the screen if this was an actual program?
Santiago Canyon College is Proud of You!
output devices
a piece of computer hardware that displays or presents information to the user after it has been processed by the computer
bit
a binary digit, like 0 or 1
address
a byte in memory is identified by a unique number
key words
words that have a special meaning in a programming language
comment
uses // & can be anything the programmer wants to right
preprocessor
starts with # & directives carried out before the compiler
word in the brackets
a file containing code that is copied into the program at that point.
include<iostream> must be added before line 5
You are given a program designed to print out “Hello there!” on the screen. However, the #include directive allowing the use of IO objects such as cin and cout is missing. Where would you add the preprocessor directive (#include <iostream>)?
Which of the following is NOT a legal identifier in C++?
None of these
How may the double variables temp, weight, and age be defined in one statement?
double temp, weight, age;
What type of comment is the following:
/* This program was written by M. A. Codewriter */
multi-line comment
Assume result = 0, w=5, x=4, y=8. what value will be stored in result after the following statement is executed.
result = w % x + y;
9
What is the correct way to take an integer input using cin
?
int number; cin >> number;
cin >> int number;
cout >> number;
cin >> number;
None of these
int number; cin » number;
What will be the output of the following program if the user enters 10 3.5 B
?
You are 10 years old, 3.5 meters tall, and your first initial is B
What will be the value of result
after running the following code?
3
the == operator is used to assign a value to a variable
false
relational operators always return a boolean value (true or false)
yes
In an if statement, the condition inside the parentheses must be a boolean expression.
true