Advertisement
vencinachev

OOP1

Jan 12th, 2021
1,054
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace SoftUniiii
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Student st1 = new Student("Sergei");
  14.             Student st2 = new Student("Vladimir Putin");
  15.             Student st3 = new Student("Boiko Borisov");
  16.             Student st4 = new Student("Joseph Stalin");
  17.  
  18.             Console.WriteLine(Student.money);
  19.             st1.AddMoney(2.5m);
  20.             st2.AddMoney(10.5m);
  21.             try
  22.             {
  23.                 st3.GetMoney(50.0m);
  24.             }
  25.             catch(Exception)
  26.             {
  27.                 Console.WriteLine("Try again...");
  28.             }
  29.             st4.AddMoney(100m);
  30.  
  31.             Student.Info();
  32.         }
  33.     }
  34. }
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement