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, 21.06.2019 18:00
Which of the following is a true statement about milestones
Answers: 1
question
Computers and Technology, 22.06.2019 03:10
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it must not appear in the factorization. sample runs are given below. note that if the power of a prime is 1, then that 1 must appear in t
Answers: 3
question
Computers and Technology, 22.06.2019 08:00
Digital information is stored using a series of ones and zeros. computers are digital machines because they can only read information as on or off –1 or 0. this method of computation is known as the system
Answers: 1
question
Computers and Technology, 23.06.2019 20:00
What multimedia system creates an immersive, real-life experience that the user can interact with?
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, 31.01.2022 01:00
question
Mathematics, 31.01.2022 01:00
question
Mathematics, 31.01.2022 01:00
question
Mathematics, 31.01.2022 01:00
Questions on the website: 13722362