Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Reflection;
- using System.Text;
- using System.Threading.Tasks;
- namespace OOP_first_class
- {
- internal class SportsCar:Car
- {
- public bool IsSportMode { get; set; }
- public double Acceleration { get; set; }
- public string AerodynamicsLevel { get; set; }
- public SportsCar()
- {
- Acceleration = 3;
- AerodynamicsLevel = "High";
- IsSportMode = false;
- }
- public SportsCar(string _brand, string _model, string _color = "Black"): base (_brand, _model, _color)
- {
- Acceleration = 3;
- AerodynamicsLevel = "High";
- IsSportMode = false;
- }
- public void ActivateSportMode()
- {
- IsSportMode = true;
- Console.WriteLine($"{brand} {model}: Sport Mode Activated!");
- }
- public override void PrintCarInfo()
- {
- base.PrintCarInfo();
- Console.WriteLine($"Acceleration: 0-100 km/h in {Acceleration}s, Aerodynamics: {AerodynamicsLevel}, Sport Mode: {(IsSportMode ? "ON" : "OFF")}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement