Advertisement
Abdula_2314124

Untitled

Feb 26th, 2024
978
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.16 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Looper
  6. {
  7.     class Car
  8.     {
  9.         private string _model;
  10.         public string Model
  11.         {
  12.             get
  13.             {
  14.                 return _model;
  15.             }
  16.             set
  17.             {
  18.                 if (value == "12344") return;
  19.                 _model = value;
  20.             }
  21.         }
  22.         private int _maxSpeed;
  23.         public int MaxSpeed
  24.         {
  25.             get
  26.             {
  27.                 return _maxSpeed;
  28.             }
  29.             set
  30.             {
  31.                 if (value > 0 && value < 500)
  32.                 {
  33.                     _maxSpeed = value;
  34.                 }
  35.             }
  36.         }
  37.         private int _healthBumper;
  38.         private int _healthCusov;
  39.         private int _healthBack;
  40.         //TAB}
  41.         public Car(string model, int maxSpeed, int healthBumper, int healthCusov, int healthBack)
  42.         {
  43.             _model = model;
  44.             _maxSpeed = maxSpeed;
  45.             _healthBumper = healthBumper;
  46.             _healthCusov = healthCusov;
  47.             _healthBack = healthBack;
  48.         }
  49.     }
  50. }
  51.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement