Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C#, and create the class Car, having 6 private fields, and 6 public Proprieties, public overloaded 2 Constructors (default and one

image text in transcribed
Write a program in C\#, and create the class Car, having 6 private fields, and 6 public Proprieties, public overloaded 2 Constructors (default and one with six arguments) and a public Method void Display() to display the information about the car (use placeholders). Use the following default constructor: public Car ()//default constructor cartype = "Ford"; model = "Focus"; color = "Blue"; year = 2020; weight =1500; length =2.45; \} The set of propriety Year use the condition: if (value 2019 ) { year =2019;; In the Main() create the 4 instances (objects): Car c1, c2, c3, c4; //object c1-c4 c1= new Car(); ///instantiate the object with default constructor Console.Writeline("Display from Display() Method "+c1.Display()); Ask for the data to be entered by the user for those other car objects (c2, c3, c4). Use try and catch to control the data entries from the user. Once you have the valid data for one particular car you can use the overloaded Constructor with six arguments, or the Properties to update the information of current object data generated by the Constructor

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions

Question

Describe the recruitment process.

Answered: 1 week ago