This repository has been archived on 2020-04-03. You can view files and clone it, but cannot push or open issues or pull requests.
ibz/oop/notenbewertung/notenbewertung/Student.cs

31 lines
720 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace notenbewertung
{
class Student : Person
{
public List<Testresultat> noten = new List<Testresultat>();
public Student(string _vorname, string _name) : base(_vorname, _name)
{
}
public void GetNotenDurchSchnitt()
{
if (noten.Count > 0)
{
double result = Math.Round(this.noten.Average(n => n.Note), 2);
Console.WriteLine(result);
}
else
{
Console.WriteLine("Der Student hat noch keine N0ten.");
}
}
}
}