Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Text;
- namespace SoftUniParking
- {
- public class Car
- {
- public Car(string make,string model,int horsePower,string registrationNumber)
- {
- this.Make = make;
- this.Model = model;
- this.HorsePower = horsePower;
- this.RegistrationNumber = registrationNumber;
- }
- public string Make { get; set; }
- public string Model { get; set; }
- public int HorsePower { get; set; }
- public string RegistrationNumber { get; set; }
- public override string ToString()
- {
- StringBuilder sb = new StringBuilder();
- sb.AppendLine($"Make: {this.Make}");
- sb.AppendLine($"Model: {this.Model}");
- sb.AppendLine($"HorsePower: {this.HorsePower}");
- sb.AppendLine($"RegistrationNumber: {this.RegistrationNumber}");
- return sb.ToString().Trim();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement