Question: make a new class with the following public properties and methods: Car class Properties of Car class: Brand, Model, Year, Color, Price (Use appropriate

make a new class with the following public properties and methods:

 

Car class

Properties of Car class:

Brand, Model, Year, Color, Price (Use appropriate data types)

Methods of Car class:

Honk method that will print "Tuut tuut" when called and displays the brand, model, year, color and price of the car.

Constructor that takes in all properties.

In your program class, create the following instances of the Car class.

  1. Brand: Honda, Model: CR-V, Year: 2023, Color: Red, Price: 50,000
  2. Brand: Ford, Model: F-150, Year: 2020, Color: Black, Price: 25,000
  3. Brand: BMW, Model: X5, Year: 2022, Color: Green, Price: 60,000
  4. Brand: Mazda, Model: CX-5, Year: 2019, Color: White, Price: 15,000
  5. Brand: Audi, Model: Q7, Year: 2018, Color: Silver, Price: 52,000
  6. Brand: Kia, Model: Forte, Year: 2020, Color: Blue, Price: 21,000

Invoke the honk method for each instance of the car.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

using System public class Car public string Brand get set public ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!