Part I Create a program class named TestLoops This class should have a main()method that behaves as
Fantastic news! We've Found the answer you've been seeking!
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 of the car.
- Perform error checking to ensure that the price is between $30,000 and $70,000.
- Prompt the user for the cost of the additional features for your car.
- Using a different looping structure, perform error checking to ensure the inputted value is between $10,000 and $25,000.
- Instantiate an object of the Vehicle class named myCar using the 2 verified inputs.
- Calculate the total price for the car.
- Instantiate another object of the Vehicle class with a base price of $25,000 named teachersCar.
- Assign $5,000 to the additional features of the object.
- Calculate the total price for the car.
- 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
- 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 )
- Modify the loop to run for 6 years
- Compile and execute the code to ensure correct results.
- Don't forget to include descriptive and detailed comments in your code!!!
Part II (if you have time)
- Create an amortization schedule for your vehicle.
- Create a method that creates an amortization schedule and call the method for both schedules.
- Create a class variable that stores the interest rate for the loans and make necessary modifications.
- Create a method that prompts the user for the inputs and instantiates the objects. Return the objects to the main() method.
Related Book For
Posted Date: