Question: Language is C# Purpose - Write a program that will keep track of various cars and determine their current value. Step 1 - Create a

Language is C#Language is C# Purpose - Write a program that will keep track

Purpose - Write a program that will keep track of various cars and determine their current value. Step 1 - Create a new class and call it Car. Car class will have the following non-static class level variables: 1. A public variable of type string called name. This variable represents the car anme 2. A public variable of type double called price. This variable represents the price of the car when purchased 3. A public variable of type int called odometer. This variable represents the amount of km the car currently has. Car class will have the following static class level variable: 1. A variable of type double called deprecRate. deprecate represents the rate at which cars depreciate. Step 2 - Car class has a constructor which will set the name, price, and odometer to whatever values are passed into it. Step 3 - From inside of main, use a literal value to set deprecRate to 0.15. Step 4 - From inside of main, create two instances (Objects) of Car. Use literal values when calling the constructor. Step 5- Change one of the objects odometer to 98000, then display to the console the name of that Car and its odometer value. Step 6 - From inside of the Car class create a function called Determine Value(): This function will have nothing passed to it and will return the current value of the Car Object which it belongs to. **Hint use deprecate, if you are struggling with this part please message me during the lab time.** Step 7- Call the Determine Value() of one the objects created in Step 4. Display the return value and that object's name to the console. Step 8- Repeat Step 7 with the other Car Object

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!