Skip to content

Commit 7cb3ed8

Browse files
authored
Create CarLoan.md
1 parent 76993fd commit 7cb3ed8

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed

CarLoan.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Lab 2 Car Loan
2+
3+
## Instructions:
4+
- OPEN BlueJ,
5+
- CREATE a new BlueJ project titled CarLoanAPP in your Computer Science folder (H:\Computer Science),
6+
- CREATE and open a new class,
7+
- DELETE BlueJ's starter code, and
8+
- TYPE in our code skeleton:
9+
```
10+
//Name:
11+
//Period:
12+
13+
public class CarLoanAPP
14+
{
15+
public static void main(String[] args)
16+
{
17+
//code goes here
18+
}
19+
}
20+
```
21+
At some point in your life, you will have to buy a car. It's a scary proposition if you're unprepared. That's why you are taking the time and writing an app to calculate an approximate car payment.
22+
23+
- Create a variable to store the "retail price" of the car. This amount will include taxes and fees. (When we are dealing with money, it's best to use data type double variables.)
24+
25+
- Create two more variables, one for the amount of the "trade-in" and your "down payment". A trade-in is the car you are going to exchange for the one you're buying. It has a value and the dealership will give you a value for it. There may be some haggling over this value. The down payment is how much cash (or a check) you intend to give the dealership in addition to the trade.
26+
27+
- Create a variable that is the "financed amount" of the car. This is calculated by taking the retail price of the car and subtracting the trade-in value AND down payment.
28+
29+
- Create a variable that contains how much "interest" you are going to have to pay. Best guess is to use about $800 per $10K borrowed. We are not ready to do a complex calculation of this nature. So, we will use our best guess.
30+
31+
- We have to add the interest to the financed amount of the car; create a "total financed" variable to hold this amount.
32+
33+
- Finally, in order to calculate the monthly payment, we need to know how many "months" to divide into the total financed amount.
34+
35+
- Print how many months and what the monthly payment is.
36+
37+
- Experiment with this calculation by altering the variables. See how the payment fluctuates by increasing or decreasing the months of the loan. Alter how much the car costs to see if perhaps you can afford the nicer car. Maybe you can afford a larger down payment to lower the monthly payments?
38+
39+
See below for sample output.
40+
41+
CAR LOAN PAYMENT APP
42+
```
43+
Retail price of car $25000.0
44+
Trade-in value (2000.0)
45+
Down payment (3000.0)
46+
Amount to finance $20000.0
47+
48+
Interest paid 1600.0
49+
50+
Total financing $21600.0
51+
52+
MONTHLY PAYMENT $ 360.0
53+
spread out over 60 months
54+
```

0 commit comments

Comments
 (0)