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

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 19:40, queenskyyt
Write the quartstogallons java class that declares a named constant to hold the number of quarts in a gallon (4). also declare a variable to represent the number of quarts needed for a painting job, and assign an appropriate value—for example, 18. compute and display the number of gallons and quarts needed for the job. display explanatory text with the values, for example:
Answers: 2
image
Computers and Technology, 23.06.2019 09:00, jeremytheprimerapper
Which best compares appointments and events in outlook 2010appointments have a subject man, and events do notappointments have a specific date or range of dates, and events do notappointments have a start and end time of day, and events do notappointments have a location option, and events do not
Answers: 2
image
Computers and Technology, 23.06.2019 23:40, dudedude1593
Which of the following calculates the total from the adjacent cell through the first nonnumeric cell by default, using the sum function in its formula? -average -autosum -counta -max
Answers: 1
image
Computers and Technology, 24.06.2019 00:30, bsonicx
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
You know the right answer?
Write a class called car. java with the following variables, constructor and methods. variables: al...

Questions in other subjects: