Question: Part I Create a program class named TestLoops This class should have a main()method that behaves as follows: Prompt the user for the base price

  1. Part I
  2. Create a program class named TestLoops This class should have a main() method that behaves as follows:
  3. Prompt the user for the base price of the car.
  4. Perform error checking to ensure that the price is between $30,000 and $70,000.
  5. Prompt the user for the cost of the additional features for your car.
  6. Using a different looping structure, perform error checking to ensure the inputted value is between $10,000 and $25,000.
  7. Instantiate an object of the Vehicle class named myCar using the 2 verified inputs.
  8. Calculate the total price for the car.
  9. Instantiate another object of the Vehicle class with a base price of $25,000 named teachersCar.
  10. Assign $5,000 to the additional features of the object.
  11. Calculate the total price for the car.
  12. To help your instructor finance her vehicle, create an amortization schedule using the following guidelines:
  • Initial Amount borrowed = total price of the teacher's car
  • Monthly payment = $532.00.
  • Interest rate = 8.4%
  • Years = 6.
  • Interest calculation = (interest rate / 12 months) * current balance
  • Applied principal = payment - interest 
  • Current balance = current balance - applied principal
  1. Create a loop that runs for 5 months to ensure you are getting the results below

(This is the image link provided: https://www.linkpicture.com/view.php?img=LPic620dad84aebea1683280695 )

Month Starting balance Repayment Interest Principal New paid paid balance 1 $30,000

  1. Modify the loop to run for 6 years
  2. Compile and execute the code to ensure correct results.
  3. Don't forget to include descriptive and detailed comments in your code!!!

 

Part II (if you have time)

  1. Create an amortization schedule for your vehicle.
  2. Create a method that creates an amortization schedule and call the method for both schedules.
  3. Create a class variable that stores the interest rate for the loans and make necessary modifications.
  4. Create a method that prompts the user for the inputs and instantiates the objects. Return the objects to the main() method.
     

Month Starting balance Repayment Interest Principal New paid paid balance 1 $30,000 $532 $210 $322 $29,678 2 $29,678 $532 $207.75 $324.25 $29,353.75 3 $29,353.75 $532 $205.48 $326.52 $29,027.23 4 $29,027.23 $532 $203.19 $328.81 $28,698.42 5 $28,698.42 $532 $200.89 $331.11 $28,367.31

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!