Program.cs 1.06 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace _13DateiverarbeitungKonto_SS2017
{
    class Konto
    {
        public Konto(string name, int kontonr, double guthaben)
        { }
        public double Zinsen()
        { return 0; }
        public void Kontenlesen(string dateiname, 
            out Konto[] kontofeld, out double zinsen)
        {
            StreamReader sr = new StreamReader(dateiname);
            int anz = Convert.ToInt32(sr.ReadLine());
            kontofeld = new Konto[anz];
            zinsen = 0;
            for (int i = 0; i < anz; i++)
            {
                string zeile = sr.ReadLine();
                string[] d = zeile.Split(';');
                kontofeld[i] = new Konto(d[0], 
                    Convert.ToInt32(d[1]), Convert.ToDouble(d[2]));
                zinsen += kontofeld[i].Zinsen();
            }
            sr.Close();
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
        }
    }
}