Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Studentas
- {
- private int[] Mas = null;
- public string Name { get; set; }
- public string Group { get; set; }
- public int Sum { get; set; }
- public Studentas(string Name, string Group, int[] M)
- {
- this.Name = Name;
- this.Group = Group;
- this.Mas = M;
- }
- public Studentas()
- {
- }
- public void CountCredits(int p) //Skaičiuoja studento kreditus
- {
- if (p>=Mas.Length-1)
- {
- return;
- }
- else
- {
- int num = GetNumber(p);
- p = p + 1;
- Sum = Sum + num;
- CountCredits(p);
- }
- }
- public int GetNumber(int i) //Grąžina studento kreditus
- {
- return Mas[i];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement