README
These are questions culled from the written part of the weekly tests from
Fall 2010 to form an 80 minute sample midterm (more or less).
You will not see any multiple choice questions on this year's midterm,
and the midterm will be on paper (not electronic like these questions).
Chapter 1: Introduction to Programming
For Questions 2-5 consider following fragment of Java code:
double f = 1.0 / 49.0;
int one = (int) (f * 49);
Chapter 2: Delegation
For Questions 2-5 consider the contract for the static method
daysInYear
in a utility
class named PlanetEarth
.
daysInYear
int daysInYear(long year)
- Returns the number of days in the given year.
- Parameters:
year
- the year.
- Returns:
- the number of days.
- Throws:
IndexOutOfBoundsException
- If the year < 0
Chapter 3: APIs
Load the java.lang.Integer API into your browser and answer the following
questions:
Chapter 4: Using Objects
Chapter 5: Control
Chapter 6: Strings