CS 177 Spring 2005 Exam I
CS 180 Fall 2005 Final Exam
There are 40 multiple choice questions. Each one is worth 2 points. There are 6 programming questions. Each one is worth 20 points.
Answer the multiple choice questions on the bubble sheet given and the programming questions on the exam booklet.
Fill in the Instructor, Course, Signature, Test, and Date blanks. For "Instructor" put your Recitation Instructor's last name. For "Course" put CS 180. For "Test" put Final.
08:30 recitation in REC 122: Matt Carlson
08:30 recitation in BRNG B254: Andy Scharlott
09:30 recitation in BRNG B268: Nick Sumner
11:30 recitation in REC 308: Rimma Nehme
01:30 recitation in UNIV 103: Alvin Law
Fill in the bubbles that correspond to your name, section and student ID in the bubble sheet. For your section number, use 0830, 0930,1130, or 0130 -- based on the start time of your Friday recitation.
For your student ID, use the 10 digit ID number on your student ID card. DO NOT USE YOUR SOCIAL SECURITY NUMBER!
Exams without names will be graded as zero. Only the answers on the bubble sheet will be counted. The questions will be discarded.
For the programming questions create a Java class that would compile without error. Comments are nice, but are not required.
Recitation Start Time: _________________________________
Student Last Name: __________________________________
Student First Name: __________________________________
Multiple Choice Questions (2 points each):
1. Which of the following statements regarding Java is false?
a. Java uses a compiler
b. A Java program compiles into machine language
c. Java uses an interpreter
d. Java is a programming language
2. Which of the following is a legal variable name in Java?
a. 1stInput
b. long
c. NumberOfPlayers
d. player.1
3. What is the output produced by the following code?
int n = 2;
System.out.print((++n) + " " + (n++) + "\n");
System.out.println(n);
a. 2 3 4
b. 3 3 4
c. 3 3
4
d. 2 3
4
4. What is the output produced by the following code?
String temp = "Hello CS180 Class";
System.out.print(temp.substring(8).trim());
a. 180Class
b. 180 Class
c. Hello CS
d. Nothing - this causes a compiler error
5. In a Java program, you read the following statement that compiles and executes.
Cookie cookie = new Cookie("chocolate chips");
What can you conclude?
a. Cookie is the name of a class.
b. cookie is a primitive type variable.
c. The Cookie class must have a constructor that has one formal parameter of type String.
d. a and c
6. Which of the following while loops is equivalent to the do-while loop? Hint: you may want to draw a flow chart to figure out the answer.
do
{
y = x + 7;
x++;
} while (x < 9);
a. y = x + 7;
x++;
while (x < 9)
{
y = x + 7;
x++;
}
b. while (x < 9)
{
y = x + 7;
x++;
}
y = x + 7;
x++;
c. while (x ................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- how to migrate from sap jco2 to sap jco3 and use
- elisp reference sheet github pages
- part i multiple choice questions 3 points each
- c monadic interface
- creating mysql user defined functions in c has
- 10 notes topics ii 1 stuff you may want use your
- programming in c assignment week 8
- optimizing away c exception handling
- statically scoped exceptions a typed foundation for
- c 6 vorlesung exceptions
Related searches
- cs ny employee benefits nyship
- 7 cs of communication ppt
- a p i final exam quizlet
- cs ny gov employee benefits
- 7 cs of effective communication
- the 7 cs of communication
- cs phd salary
- seven cs of communication
- project ideas for cs students
- 177 pellet trajectory chart
- oxford cs philosophy
- the 7 cs of communication definitions