Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Text;
- namespace Exam_Preparation_2_Fitness
- {
- public class Athlete
- {
- //име, възраст, сила
- private string name;
- private int age;
- private int strength;
- public Athlete(string name, int age, int strength)
- {
- Name = name;
- Age = age;
- Strenght = strength;
- }
- public string Name
- {
- get
- {
- return name;
- }
- set
- {
- name = value;
- }
- }
- public int Age
- {
- get
- {
- return age;
- }
- set
- {
- age = value;
- }
- }
- public int Strenght
- {
- get
- {
- return strength;
- }
- set
- {
- strength = value;
- }
- }
- public override string ToString()
- {
- //Athlete: name - <име>, age - <възраст> strength <сила>.
- return $"Athlete: name - {name}, age - {age} strenght {strength}.";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement