kandjstephens6618 kandjstephens6618
  • 21-12-2020
  • Computers and Technology
contestada

Write a class that specify the characteristics of a car, like type (sedan, jeep, mini, SUV, etc), gear (auto, manual), maximum speed (mph), average fuel consumption (mpg), etc. Create few objects to illustrate your desired cars.

Respuesta :

Jamesanny20
Jamesanny20 Jamesanny20
  • 22-12-2020

Answer:

Answered below

Explanation:

This is written in Kotlin programming language.

//Creating the class Car. The primary //constructor declares car's properties which //are initialized when it's objects are created.

class Car(

val type: String,

val gear: String,

val maxSpeed: Double,

val avgFuelConsumption: Double)

//Creating several objects of car.

val sedan: Car = Car("sedan", "auto", 23.4, 500)

val jeep: Car = Car("jeep", "manual", 40, 350)

val mini: Car = Car("mini", auto, 26.7, 86, 234)

Answer Link

Otras preguntas

Determine the pH of a KOH solution made by mixing 0.251 g KOH with enough water to make 1.0 × 10 2 mL of solution
what is the product of 1/2x -1/4 and 5x^2 -2x +6 writhe your answer in standard form SHOW YOUR WORK
Does the graph represent a function?
Find the width of a rectangle is the perimeter is 56 cm and the length is 15 cm. help ? whats the formula for this
Which sentence is punctuated correctly? The students line up in the afternoon to wait, for the buses to arrive. The students, line up in the afternoon, to wait
What was problematic about the 1876 presidential election?
Humble is to modest as conceited is to?
Reading a source and then fast writing a summary is called
CAN YOU PLEASE HELP!
According to the essay, what are Paine’s views on monarchy and hereditary succession?