Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedimage text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions