Name_______________________
Login___________________SID________
CS 010: Introduction to
Computer Science I
Quiz 1: 10 minutes
- An
algorithm is
a.
The inputs and outputs of a program
b.
The part of the computer that does the processing
c.
A
finite set of steps to solve a problem
d.
A complete computer program
- Which
of the following is NOT a valid identifier (i.e. will cause a
syntax error if used as a variable name).
- _student_name
- TAXRATE
- %correct
- double1
- A
and C are both invalid
- All
are invalid
- A
compiler translates source code written in a high-level language to object
code that a machine can understand.
- TRUE
- FALSE
- Programs
written in assembly do NOT need to be translated for the machine to
understand.
- TRUE
- FALSE
- RAM?
- Is
used to process data.
- Is a faster, more expensive
data storage device compared to secondary storage devices.
- Can
store data when the computer is turned off.
- Is
the only data storage device that can store programs.
- B
and D
- All
the above
- The
following code fragment has at least one syntax error in
line(s) ___________________. (The line number and colon at the beginning
of each line are for reference only and not part of the code.)
1: int num1; num2;
2: cout << “Enter two floating-point numbers: “;
3: cin >> num1; cin >> num2;
4: cout << num1
5: << num2;
- 1
- 3
- 4
and 5
- 1
and 4
- 1,
3, 4, and 5
- all
lines have at least one syntax error.
- The
compiler will find logic errors.
- TRUE
- FALSE
- There
is a logic error in the code fragment for question 6.
- TRUE
- FALSE
- What
is output to standard output (monitor) by the following statement?
cout << “Hello \nWorld!”
<< “Are you ready for me?”;
- Hello \nWorld!
Are you ready for me?
- Hello \nWorld! Are you ready for me?
- Hello\n
World!
Are you ready for me?
- Hello
World!Are you ready for me?
- Hello World! Are you ready for me?
- None of the above.
- What
is the value of the variable named quotient after the following
statements?
int num1 = 10;
int num2 = 20;
int quotient;
quotient = num1 /
num2;
- 10
- 0.5
- 0
- .5
- None
of the above (syntax error)