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 22:00
Business professionals of america, and future business leaders of america – phi beta lambda are both open to business students at which levels? check all that apply. elementary school middle school high school college
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 08:30
Helen's credit card has an apr of 15.32% and a grace period of 17 days and helen pays her balance in the full every month. if her last billing cycle ended on september 26, 2009, and she made her payment on october 11, 2009, did she owe any interest on her last statement's balance?
Answers: 3
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. Γ’β€“ΕŸ print out all positive integers from 1 to 100, inclusive and in order. Γ’β€“ΕŸ print messages to standard output, matching the sample output below. Γ’β€“ΕŸ in the output, state whether the each integer is 'odd' or 'even' in the output. Γ’β€“ΕŸ if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. Γ’β€“ΕŸ if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. Γ’β€“ΕŸ design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
You know the right answer?
Write a class called car. java with the following variables, constructor and methods. variables: al...
Questions
question
Biology, 05.05.2020 21:00
question
Chemistry, 05.05.2020 21:00
Questions on the website: 13722367