-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
33 lines (26 loc) · 1.04 KB
/
Copy pathProgram.cs
File metadata and controls
33 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using YourNamespace.Services;
using YourNamespace.Models;
namespace YourNamespace
{
class Program
{
static void Main(string[] args)
{
Console.Title = "Tuto C#";
Random random = new();
int randomAge = random.Next(18, 65);
// Utilisation de UserService pour gérer les utilisateurs
UserService userService = new();
userService.AddUser(new User { Name = "Alice", Age = randomAge });
userService.AddUser(new User { Name = "Bob", Age = 25 });
userService.DisplayAllUsers();
// Utilisation de Product pour gérer un produit
Product product = new("Laptop", 999.99m, 10);
product.DisplayProductInfo();
// Utilisation de CalculatorService pour effectuer des calculs
Console.WriteLine($"Résultat de l'addition: {CalculatorService.Add(5, 3)}");
Console.WriteLine("\nFin du programme. Appuyez sur une touche pour quitter.");
Console.ReadKey();
}
}
}