-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVehicle.cs
32 lines (28 loc) · 968 Bytes
/
Vehicle.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
namespace PROG8051_Assign3
{
// Base class in which other classes will inherit
abstract class Vehicle
{
public abstract string Type { get; }
public readonly string ProductID;
public string Model { get; set; }
public string Manufacturer { get; set; }
public int Year { get; set; }
public double RentalPrice { get; set; }
public Vehicle()
{
ProductID = (System.Guid.NewGuid()).ToString();
}
// Display vehicle details
public virtual void DisplayDetails()
{
Console.WriteLine($"\nProduct Type - \"{Type}\"");
Console.WriteLine($"ProductID: \"{ProductID}\"");
Console.WriteLine($"Model: \"{Model}\"");
Console.WriteLine($"Manufacturer: \"{Manufacturer}\"");
Console.WriteLine($"Year: \"{Year}\"");
Console.WriteLine($"Rental Price: \"${RentalPrice}\"");
}
}
}