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

How many groups of 100 pennies are in 100 pennies
Prophylactic rifampin is indicated for individuals in close contact with patients infected by
Instructions:Select the correct answer from each drop-down menu. The volume of the pyramid shown in the figure is cubic centimeters. If the slant height of the
What is the average speed of a walker who walks 500 m in 400 seconds
what is the least 10 digit wholle number
What impact did Emperor Constantine's establishment of the "New Rome" (Constantinople) have on the Roman Empire? a. the expense of building the new city impovri
In democratic societies, citizens get to choose their leaders and make other choices about how they are governed.
Identify the leading alcohol-related cause of death in the u.s.:q
I need help please thanks
The first europeans to sail around africa and on to india were the: