Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. using System;
  2.  
  3. namespace кпур
  4. {
  5. public class cat
  6. {
  7. public int thickness=50;
  8. public void meow()
  9. {
  10. Console.WriteLine("Meow!");
  11. Console.Write("I want eat!");
  12. eat();
  13.  
  14. }
  15. public void jump()
  16. {
  17. Console.WriteLine("Jumping \n*now hes thickness is:{0}*",thickness=thickness-5);
  18. }
  19. public void eat()
  20. {
  21. Console.WriteLine("Meow.. Thx,very tasty :3 \n*now hes thickness is:{0}*",thickness=thickness+5);
  22. }
  23. }
  24. class Program
  25. {
  26. public static void Main(string[] args)
  27. {
  28. cat cat=new cat();
  29. int a=0;
  30. do
  31. {
  32. Random rand=new Random();
  33. int t=rand.Next(1,4);
  34. a++;
  35. if (t==1) cat.jump();
  36. if (t==2) cat.eat();
  37. if (t==3) cat.meow();
  38.  
  39. }while(a<10);
  40. Console.ReadKey();
  41. }
  42.  
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement