Advertisement
Guest User

Untitled

a guest
Mar 6th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 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 ConsoleApplication1
  8. {
  9. class Studentas
  10. {
  11. private int[] Mas = null;
  12. public string Name { get; set; }
  13. public string Group { get; set; }
  14. public int Sum { get; set; }
  15.  
  16. public Studentas(string Name, string Group, int[] M)
  17. {
  18. this.Name = Name;
  19. this.Group = Group;
  20. this.Mas = M;
  21. }
  22.  
  23. public Studentas()
  24. {
  25. }
  26.  
  27. public void CountCredits(int p) //Skaičiuoja studento kreditus
  28. {
  29. if (p>=Mas.Length-1)
  30. {
  31. return;
  32. }
  33. else
  34. {
  35. int num = GetNumber(p);
  36. p = p + 1;
  37. Sum = Sum + num;
  38. CountCredits(p);
  39. }
  40. }
  41.  
  42. public int GetNumber(int i) //Grąžina studento kreditus
  43. {
  44. return Mas[i];
  45. }
  46.  
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement