You are requested to create a java class named Honda Civic, which is one of the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
You are requested to create a java class named Honda Civic, which is one of the most demanded cars in the Canadian market. The Honda Civic class will have at least the following attributes: numberOfDoors(int): the number of doors, make sure it's 3 or 5. color(String): 6 possible case-insensitive String values for color are: silver, grey, black, white, blue, and red. price(double): The price of cars is subject to change, but you must ensure that it is between $20,000 and $40,000. The price of the car is common to all the Honda Civic objects created. If the price of a car changes, then the change applies automatically to all car objects. Print an appropriate error message for any invalid field. The class should have methods to set and get the attributes as follow: getNumberDoors() ⚫ setNumberDoors(int) getPrice() ⚫ setPrice(double) ⚫ getColor() setColor(String) The class should also include a toString() method to return all information of a Honda Civic. For example the toString() method should return a String in the following format: Number of doors: 3, color: red, price: 25000.0 Number of doors: 5, color: grey, price: 22000.0 Number of doors: 3, color: red, price: 22000.0 You are requested to create a java class named Honda Civic, which is one of the most demanded cars in the Canadian market. The Honda Civic class will have at least the following attributes: numberOfDoors(int): the number of doors, make sure it's 3 or 5. color(String): 6 possible case-insensitive String values for color are: silver, grey, black, white, blue, and red. price(double): The price of cars is subject to change, but you must ensure that it is between $20,000 and $40,000. The price of the car is common to all the Honda Civic objects created. If the price of a car changes, then the change applies automatically to all car objects. Print an appropriate error message for any invalid field. The class should have methods to set and get the attributes as follow: getNumberDoors() ⚫ setNumberDoors(int) getPrice() ⚫ setPrice(double) ⚫ getColor() setColor(String) The class should also include a toString() method to return all information of a Honda Civic. For example the toString() method should return a String in the following format: Number of doors: 3, color: red, price: 25000.0 Number of doors: 5, color: grey, price: 22000.0 Number of doors: 3, color: red, price: 22000.0
Expert Answer:
Answer rating: 100% (QA)
Attributes for the HondaCivic class numberOfDoors int Represents the number of doors Ens... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
create a java class named HondaCivic, which is one of the most demanded cars in the Canadian market. The HondaCivic class will have at least the following attributes: numberOfDoors(int): the number...
-
The following trial balance is taken from the General Fund of the City of Jennings for the year ending December 31, 2017. Prepare a condensed statement of revenues, expenditures, and other changes in...
-
Explain relationships between negligence and nuisance.
-
You own a 20- year, $ 1,000 par value bond paying 7 percent interest annually. The market price of the bond is $ 875, and your required rate of return is 10 percent. a. Compute the bonds expected...
-
Discuss why tax evasion is a significant issue for the federal government.
-
A car dealer specializing in late model used cars collected the following data on the selling price and mileage of five cars of the same make and model year at an auto auction: Mileage Price 43,890...
-
Vanessa is the Chief Financial Officer for a US company. It is a large multinational company whose annual revenues exceed $5.0B and its shares are trade on the New York Stock Exchange. The FCPA...
-
1. Since Mr. Snodgrass doesnt have any historical data, (only an estimate of the number of customers hell serve each month), which specific type of qualitative method is he using? What would be the...
-
You are an Audit Senior on the AUDIO Health Limited (AUDIO) audit engagement for the financial year ending 30 June 2019. AUDIO specializes in the design and manufacture of implantable hearing aids...
-
4. Consider the following set of functional dependencies on the relation schema R = (A, B, C, D, E, F, G): a) Find all candidate keys for R ABCDF BDCF B D E A DF G b) Remove extraneous attributes...
-
For each of the following sub-problems, output your results in an fprintf statement outside of your Matlab function files. Comment on the results you find. Do they make sense? Note, it may be a good...
-
Oil futures have a 1000 barrel contract size and an 8% initial margin requirement. If an investor takes a long position in one contract when the futures price is $32/barrel, what will be that...
-
If an individual owns only one security the most appropriate measure of risk is a.correlation. b.the risk-free rate. c.beta. d.covariance. e.standard deviation.
-
Banz and Reinganum found that small firms consistently outperformed large firms. This anomaly is referred to as the a.growth firm effect. b.small firm effect. c.size effect. d.large firm...
-
AITAM Public Library is the biggest library in Koforidua. Currently, it has about 300 members. A person who is 18 or above can become a member. There is a membership fee of GHC400 for a year. There...
-
1. Advertising for eyeglasses _________ (increases/decreases) the price of eyeglasses because advertising promotes _________. 2. An advertisement that succeeds in getting consumers to try the product...
-
Rentech owns all the share capital of Inced. The following intragroup transactions took place. 1. During the year ending December 31, 2013, Inced sold $50,000 worth of inventory to Rentech. Inced...
-
1. On December 1, 2013, a Canadian company purchased inventory for 500,000 payable on March 1, 2014 (the transaction is denominated in euros). It also entered into a forward contract on that date. 2....
-
The parent entity, JEZ, has purchased on the open market, for an amount less than par value, some bonds previously issued at par, by its wholly owned subsidiary, Northco. The group accountant for...
-
How is the legal infrastructure of a country significant for business?
-
What is legal liability?
-
We have a parliament to pass laws, a government to administer laws, and a police department to enforce laws. Ironically, these potent instruments for the restriction of liberty are necessary for the...
Study smarter with the SolutionInn App