This page is intended to answer Frequently Asked Questions on the first assignment of APS101.
The page will be updated constantly until the due date of the assignment.
Office hours for Assignment 1:
Location: BA2200
* Thu, Jan 29, 1 - 2pm
* Mon, Feb 2, 12 - 2pm
Posted: Jan 25, 2009
When dealing with mathematical formulas, such as for the calculateInsurance() method,
you must use the Math appopriate functions (e.g. for logarithm log10(double)).
Here are the descriptions for the general math functions:
Java API - Math
Please read carefully the sections on:
- Restrictions
- Marking
- What to hand in
which are located after the assignment description.
If you have questions, please consult the Discussion Board first and post your questions.
I will update this page as well with the most relevant problems encountered that may help
you in programming the assignment.
Posted: Jan 25, 2009
Here's a few examples to help you check that your program calculated the insurance correctly:
Car cost: 15000
Driver's age: 35
Demerit points: 0
Insurance: 485.73
Car cost: 15000
Driver's age: 36
Demerit points: 0
Insurance: 481.91
Car cost: 15000
Driver's age: 35
Demerit points: 3
Insurance: 785.73
Here's a few examples for the bankersRound method:
bankersRound(3.513) = 3.51
bankersRound(3.518) = 3.52
Posted: Jan 25, 2009
You can assume that functions with parameters like:
- makeMoney
- getParkingTicket
- getSpeedingTicket
have correct inputs.
For example, no negative income, no negative parking ticket or negative speeding points.
You can also assume we won't be testing tricky situations, like repaintCar when a driver does not own any car.
Also, we won't be running buyCar when a driver already has a car.
Posted: Jan 25, 2009