subject

Write a class called car. java with the following variables, constructor and methods. variables: all variables given below must be declared as private except the color variable. color is a string value indicating the color of the car. brand is a string value indicating the brand name of the car. model is a string value indicating the model name of the car. year is an integer value indicating the production year of the car. kilometerslnk is a double value indicating how many kilometers the car has travelled. fueltype is a boolean value indicating if the car uses gasoline (true) or diesel (false). write a constructor which gets color of the car as parameter and sets the related variable. first, write get and set methods for private variables. read information reads user inputs as in the sample output given below and assigns them to related variables. brand: nissan model: juke year: 2013 kilometers (in thousand): 61.3 fuel type (gasoline/diesel): diesel priceofcar gets an integer value (1 for sale or 2 for rent) as parameter and calculates the price of the car according to the equations, and it prints the result as in sample output given below. (you should write either 'price for sale' or 'price for rent according to provided parameter.) price for sale of this car is 214750.0 tl. sale = 1 - (kilometersitxk * 10) - (ageofcar * 1000) also, add 1 to this amount if fuel type of the car is diesel. rent = 200 - (kilometersink * 0.5) - (ageofcar * 2) also, subtract 10 from this amount if fuel type of the car is gasoline. printinformation prints information as given in the sample output below. (if car uses gasoline, you should write 'using gasoline as fuel", otherwise you should write 'using diesel as fuel'.) this red car is nissan's "duke". it has travelled 61300.0 km since 2013 using diesel as fuel. arecarsequal gets one car object as parameter and compares two cars in terms of their brand, model, year. kilometersink and fueltype variables. finally, it returns a boolean value indicating whether all are same or not.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:00
What is the first step in creating a maintenance ?
Answers: 2
question
Computers and Technology, 23.06.2019 00:30
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
You know the right answer?
Write a class called car. java with the following variables, constructor and methods. variables: al...
Questions
question
Mathematics, 20.05.2020 21:00
question
Mathematics, 20.05.2020 21:00
question
History, 20.05.2020 21:00
question
Mathematics, 20.05.2020 21:00
question
English, 20.05.2020 21:00
question
Biology, 20.05.2020 21:00
Questions on the website: 13722367