Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ASSIGNMENT This assignment is to write a program to calculate car purchase information. The program will require the use of Strings (including the substring method
ASSIGNMENT This assignment is to write a program to calculate car purchase information. The program will require the use of Strings (including the substring method which you must learn about via the Java API), escape characters, the formatting of numbers using the printf (or String.format) method, calculating values and the Scanner class. NewCar Create a class called Newcar whose constructor accomplishes the following: 1. Takes in three String arguments for a car's year, make and model. 2. Creates a String that has the full car description in it. e.g. 2014 Ford Fusion 3. Creates an abbreviation for the car that has the last two digits of year and the first letters of the make and model. e.g. 14FF 4. Initializes all other attributes to an initial value (0 or null). Create a method called calcFinalPrice that does the following: 1. Takes three double arguments for the sticker price, discount and sales tax rate. 2. Returns final price calculated as: sticker price - discount + sales tax The sales tax is applied to (sticker_price - discount). Often, car dealers offer zero interest loans for the purchase of a new car. Create a method called calczeroPctMonpayt that takes in an int argument for the number of months and returns the calculated monthly payment based on the final price. Create a toString method that takes in no arguments and returns the following string: You want to purchase a Abbreviation: Full car and were calculated in the constructor
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started