oggetti_2/Calciatore.cs
La Programmatrice Verde d6b251aae7 Concluso
2025-04-05 11:54:10 +02:00

29 lines
837 B
C#

namespace oggetti_2;
class Calciatore {
readonly string name;
readonly string surname;
readonly int age;
readonly int weight;
readonly string role;
public readonly int number;
public Calciatore(string name, string surname, int age, int weight, string role, int number) {
this.name = name;
this.surname = surname;
this.age = age;
this.weight = weight;
this.role = role;
this.number = number;
}
public void MostraCalciatore() {
Console.WriteLine($"Nome: {this.name}");
Console.WriteLine($"Cognome: {this.surname}");
Console.WriteLine($"Età: {this.age}");
Console.WriteLine($"Peso: {this.weight}");
Console.WriteLine($"Ruolo: {this.role}");
Console.WriteLine($"Numero di maglia: {this.number}");
}
}