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 RaceCar : SportsCar
- {
- public bool SafetyCage { get; set; }
- public string TireType { get; set; }
- public int PitStopCount { get; set; }
- public bool BoostMode { get; set; }
- public RaceCar(string _brand, string _model, string _color = "Blue",
- bool _safetyCage = true, string _tireType = "Medium")
- : base(_brand, _model, _color)
- {
- IsSportMode = true;
- SafetyCage = _safetyCage;
- TireType = _tireType;
- PitStopCount = 0;
- BoostMode = false;
- }
- public void ActivateBoost()
- {
- BoostMode = true;
- Console.WriteLine($"{brand} {model}: Boost Mode Activated! More power unleashed!");
- }
- public void PitStop()
- {
- PitStopCount++;
- Console.WriteLine($"{brand} {model}: Pit stop completed! Total stops: {PitStopCount}");
- }
- public override void PrintCarInfo()
- {
- base.PrintCarInfo();
- Console.WriteLine($"Cage: {SafetyCage}, Tires: {TireType}, Pit Stops: {PitStopCount}, Boost Mode: {(BoostMode ? "ON" : "OFF")}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement