<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Schulnotenprogramm in C++]]></title><description><![CDATA[<p>So! Will mal ein Schulnotenprogramm in C++ schreiben. Aber wie soll ich das jetzt anstellen?! Will das sich eine normal Konsole öffnet und man dann Fächer und Schüler anlegen kann.... Die Noten sollen in einer Externen Datei gespeichert werden und bei neustart des Programms wieder mit aufgerufen werden so das ich nicht immer alle Noten neu eingeben muss. Aber was muss jetzt alles in den Quelltext. Hab bis jetzt keine Ahnung..., denn ich habe immer nur kleine Programm ohne einlesen einer externen Datei geschrieben...!</p>
<p>Würde mich über Antworten freuen.</p>
<p>Gruß Angel</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/129509/schulnotenprogramm-in-c</link><generator>RSS for Node</generator><lastBuildDate>Wed, 26 Aug 2026 14:35:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/129509.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Dec 2005 11:35:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Wed, 14 Dec 2005 11:35:22 GMT]]></title><description><![CDATA[<p>So! Will mal ein Schulnotenprogramm in C++ schreiben. Aber wie soll ich das jetzt anstellen?! Will das sich eine normal Konsole öffnet und man dann Fächer und Schüler anlegen kann.... Die Noten sollen in einer Externen Datei gespeichert werden und bei neustart des Programms wieder mit aufgerufen werden so das ich nicht immer alle Noten neu eingeben muss. Aber was muss jetzt alles in den Quelltext. Hab bis jetzt keine Ahnung..., denn ich habe immer nur kleine Programm ohne einlesen einer externen Datei geschrieben...!</p>
<p>Würde mich über Antworten freuen.</p>
<p>Gruß Angel</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941799</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941799</guid><dc:creator><![CDATA[!!Angel!!]]></dc:creator><pubDate>Wed, 14 Dec 2005 11:35:22 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Wed, 14 Dec 2005 11:40:06 GMT]]></title><description><![CDATA[<p>Dann solltest du dir vorher doch nochmal fsream anschauen. Ein Projekt in dieser Art lohnt sich erst, wenn man die Grundlagen kennt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941805</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941805</guid><dc:creator><![CDATA[DocJunioR]]></dc:creator><pubDate>Wed, 14 Dec 2005 11:40:06 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Wed, 14 Dec 2005 11:40:26 GMT]]></title><description><![CDATA[<p>mach doch mal ne switch für das menü</p>
<p>und für jedes case eine eigene funktion</p>
<p>oder über ein Klasse</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941806</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941806</guid><dc:creator><![CDATA[jupp129998]]></dc:creator><pubDate>Wed, 14 Dec 2005 11:40:26 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Wed, 14 Dec 2005 11:41:44 GMT]]></title><description><![CDATA[<p>und schreib/mal dir am besten auf einem zettel auf was das dein programm alles können muss.<br />
dann noch die reihenfolge in der es ablaufen muss.</p>
<p>und dann fängst du eben an jeden einzelnen teil zu schreiben.<br />
und ggf. fragen hier zu stellen.<br />
die gesamtaufgabe ist an dieser stelle noch relativ unwichtig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941810</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941810</guid><dc:creator><![CDATA[asr]]></dc:creator><pubDate>Wed, 14 Dec 2005 11:41:44 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Wed, 14 Dec 2005 11:42:01 GMT]]></title><description><![CDATA[<p>Na prinzipiell würde ich um die Daten einzutragen über ein mehrdimensionales Array gehen und in eine Datei schreiben kannste ja mit den Funktionen<br />
fopen(), fwrite() und fclose()</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941811</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941811</guid><dc:creator><![CDATA[Melzmann]]></dc:creator><pubDate>Wed, 14 Dec 2005 11:42:01 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Wed, 14 Dec 2005 11:59:54 GMT]]></title><description><![CDATA[<p>bevor du ein mehrdimensionales array wählst, ist ein struktur-array wohl besser geeignet. zum beispiel:</p>
<pre><code class="language-csharp">struct Schueler
{
string Name;
int Mathe[y];      /* in diesem Array speicherst du die Mathe-Noten des
einzelnen Schuelers, y steht für die Anzahl der Noten*/
int Deutsch[y];
...
...
...
};
Schueler Noten[x];   /* dieses Array verwaltet die einzelnen Schueler, 
mitsamt Noten, Name, etc. was immer du willst. x steht für die Anzahl der
Schüler, wenn du nur einen Schüler verwalten willst, z.B. dich, dann mach kein
Array, sondern nur ne normale Variable.*/
</code></pre>
<p>zum thema struktur findest du bestimmt einen artikel hier im forum oder woanders im internet. ist eigentlich total einfach, der vorteil gegenüber einem mehrdim. array liegt darin, dass du hier verschiedene datentypen verwalten kannst, in einem mehrdim. array müssen alle daten vom gleichen typ sein.</p>
<p>ich hoffe, dir einen kleinen ansatz gegeben zu haben.<br />
ansonsten, wie die anderen schon sagen, mach erstmal ein nummern-geführtes menu. per zahleneingabe wählst du dann, was du machen willst.</p>
<p>ich weiß net, wie gut deine kenntnisse sind, aber mit ext. dateien zu arbeiten hat es ziemlich in sich. hast du dich schonmal mit zeigern beschäftigt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/941825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/941825</guid><dc:creator><![CDATA[sarah1986]]></dc:creator><pubDate>Wed, 14 Dec 2005 11:59:54 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Thu, 22 Dec 2005 10:50:38 GMT]]></title><description><![CDATA[<p>Hab jetzt mal was geschrieben..., aber es treten leider Linker fehler auf...! Was ist falsch?</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;		//standart :?
#include &lt;string&gt;		//die strings 
#include &lt;fstream&gt;		//laden speichern
#include &quot;klassen.h&quot;	//alle meine klassen

using namespace std;	//standart :?

void pau()	//gibt ja kein pause unter unix
{			//also selber eins machen
	#ifdef unix
	cout &lt;&lt; &quot;\n Bitte drücken Sie die Enter-Taste!&quot;;
	#else
	cout &lt;&lt; &quot;\n Bitte drcken Sie die Enter-Taste!&quot;;
	#endif
	cin.get();
	cin.get();
}

void cls()
{
     #ifdef unix //unix-konform
     system(&quot;clear&quot;);
     #else
     system(&quot;cls&quot;);
     #endif
}

void uberschrift(int i) //menüs
{
	if(i==1)
	{
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  ________________ &quot;
			 &lt;&lt; &quot;\n |Eintrag erfassen|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  ________________ &quot;
			 &lt;&lt; &quot;\n |Eintrag erfassen|&quot;
			 &lt;&lt; &quot;\n  îîîîîîîîîîîîîîîî \n&quot;;
		#endif
	}
	if(i==2)
	{
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  ________________ &quot;
			 &lt;&lt; &quot;\n |Eintrag ergänzen|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  ________________ &quot;
			 &lt;&lt; &quot;\n |Eintrag erg„nzen|&quot;
			 &lt;&lt; &quot;\n  îîîîîîîîîîîîîîîî \n&quot;;
		#endif
	}
	if(i==3)
	{
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  ________________ &quot;
			 &lt;&lt; &quot;\n |Eintrag anzeigen|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  ________________ &quot;
			 &lt;&lt; &quot;\n |Eintrag anzeigen|&quot;
			 &lt;&lt; &quot;\n  îîîîîîîîîîîîîîîî \n&quot;;
		#endif
	}
	if(i==4)
	{
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  _______________ &quot;
			 &lt;&lt; &quot;\n |Eintrag löschen|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  _______________ &quot;
			 &lt;&lt; &quot;\n |Eintrag l™schen|&quot;
			 &lt;&lt; &quot;\n  îîîîîîîîîîîîîîî \n&quot;;
		#endif
	}
	if(i==5)
	{
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  _______ &quot;
			 &lt;&lt; &quot;\n |Beenden|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  _______ &quot;
			 &lt;&lt; &quot;\n |Beenden|&quot;
			 &lt;&lt; &quot;\n  îîîîîîî \n&quot;;
		#endif
	}
	if(i==6)
	{		
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  ____ &quot;
			 &lt;&lt; &quot;\n |Info|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  ____ &quot;
			 &lt;&lt; &quot;\n |Info|&quot;
			 &lt;&lt; &quot;\n  îîîî \n&quot;;
		#endif
		cout &lt;&lt; &quot;\n Programmierung\t\t!!Angel!!&quot;;

		}
	if(i==0)
	{
		cls();
		#ifdef unix
		cout &lt;&lt; &quot;\n  ____ &quot;
			 &lt;&lt; &quot;\n |MENÜ|&quot;
			 &lt;&lt; &quot;\n  ¯¯¯¯ \n&quot;;
		#else
		cout &lt;&lt; &quot;\n  ____ &quot;
			 &lt;&lt; &quot;\n |MENš|&quot;
			 &lt;&lt; &quot;\n  îîîî \n&quot;;
		#endif
		cout &lt;&lt; &quot;\n 1 = Eintrag erfassen&quot;;

		#ifdef unix
		cout &lt;&lt; &quot;\n 2 = Eintrag ergänzen&quot;;
		#else
		cout &lt;&lt; &quot;\n 2 = Eintrag erg„nzen&quot;;
		#endif

		cout &lt;&lt; &quot;\n 3 = Eintrag ausgeben&quot;;

		#ifdef unix
		cout &lt;&lt; &quot;\n 4 = Eintrag löschen&quot;;
		#else
		cout &lt;&lt; &quot;\n 4 = Eintrag l™schen&quot;;
		#endif

		cout &lt;&lt; &quot;\n 5 = Beenden\n&quot;
			 &lt;&lt; &quot;\n i = Infos\n\n &quot;;
	}
}

int main()
{
	// Init's
	char janein, ein1;
	int ende=1;
	Schueler schueler;
	Fach fach;
	Note noten;
	// Ende Init's

	///////////////
	// HAUPTMENÜ //
	///////////////
	while(ende==1)
	{
		uberschrift(0);
		cin &gt;&gt; ein1;

		////////////////////////
		// Untermenü ERFASSEN //
		////////////////////////
		if(ein1=='1')
		{
			uberschrift(1);

			#ifdef unix
			cout &lt;&lt; &quot;\n Name Schüler: &quot;;
			#else
			cout &lt;&lt; &quot;\n Name Schler: &quot;;
			#endif

			cin &gt;&gt; schueler.NAME;
			cout &lt;&lt; &quot;\n Fach: &quot;;
			cin &gt;&gt; fach.NAME;
			cout &lt;&lt; &quot;\n Note: &quot;;
			cin &gt;&gt; noten.WERT;

			schueler.anlegen(schueler.NAME,fach.NAME,noten.WERT);
		}

		////////////////////////
		// Untermenü ERGÄNZEN //
		////////////////////////
		if(ein1=='2')
		{
			uberschrift(2);

			schueler.ist_da();

			#ifdef unix
			cout &lt;&lt; &quot;\n Name Schüler: &quot;;
			#else
			cout &lt;&lt; &quot;\n Name Schler: &quot;;
			#endif

			cin &gt;&gt; schueler.NAME;

			uberschrift(2);

			fach.ist_da(schueler.NAME);

			cout &lt;&lt; &quot;\n Fach: &quot;;
			cin &gt;&gt; fach.NAME;

			uberschrift(2);

			#ifdef unix
			cout &lt;&lt; &quot;\n Note für &quot; &lt;&lt; schueler.NAME &lt;&lt; &quot; im Fach &quot; &lt;&lt; fach.NAME &lt;&lt; &quot;: &quot;;
			#else
			cout &lt;&lt; &quot;\n Note fr &quot; &lt;&lt; schueler.NAME &lt;&lt; &quot; im Fach &quot; &lt;&lt; fach.NAME &lt;&lt; &quot;: &quot;;
			#endif

			cin &gt;&gt; noten.WERT;

			schueler.ergaenzen(schueler.NAME,fach.NAME,noten.WERT);
		}

		////////////////////////
		// Untermenü ANZEIGEN //
		////////////////////////
		if(ein1=='3')
		{
			uberschrift(3);

			schueler.ist_da();

			#ifdef unix
			cout &lt;&lt; &quot;\n Name Schüler: &quot;;
			#else
			cout &lt;&lt; &quot;\n Name Schler: &quot;;
			#endif

			cin &gt;&gt; schueler.NAME;

			uberschrift(3);

			fach.ist_da(schueler.NAME);

			cout &lt;&lt; &quot;\n Fach: &quot;;
			cin &gt;&gt; fach.NAME;

			uberschrift(3);

			#ifdef unix
			cout &lt;&lt; &quot;\n Noten für &quot; &lt;&lt; schueler.NAME &lt;&lt; &quot; im Fach &quot; &lt;&lt; fach.NAME &lt;&lt; &quot;:\n &quot;;
			#else
			cout &lt;&lt; &quot;\n Noten fr &quot; &lt;&lt; schueler.NAME &lt;&lt; &quot; im Fach &quot; &lt;&lt; fach.NAME &lt;&lt; &quot;:\n &quot;;
			#endif

			schueler.anzeigen(schueler.NAME, fach.NAME);
		}

		///////////////////////
		// Untermenü LÖSCHEN //
		///////////////////////
		if(ein1=='4')
		{
			uberschrift(4);

			schueler.ist_da();

			#ifdef unix
			cout &lt;&lt; &quot;\n Name Schüler: &quot;;
			#else
			cout &lt;&lt; &quot;\n Name Schler: &quot;;
			#endif

			cin &gt;&gt; schueler.NAME;

			uberschrift(4);

			schueler.loeschen(schueler.NAME);
		}

		///////////////////////
		// Untermenü BEENDEN //
		///////////////////////
		while(ein1=='5')
		{
			uberschrift(5);

			cout &lt;&lt; &quot;\n Wirklich beenden ? j/n &quot;;
			cin &gt;&gt; janein;
			if(janein=='j'){ein1='0';ende=0;}
			else {if(janein=='n'){ende=1;ein1='0';}}
		}

		///////////////////////////
		// Untermenü Information //
		///////////////////////////
		if(ein1=='i')
		{
			uberschrift(6);

			pau();
		}
	}
	cls();
	return 0;
}
</code></pre>
<p>dazu noch die devinierten Klassen</p>
<pre><code class="language-cpp">#include &lt;string&gt;

#ifndef KLASSEN_H
#define KLASSEN_H

struct Datum
{
	std::string jahr;
	std::string monat;
	std::string tag;
//	int schaltjahr;
	int jahr_int;
	int monat_int;
	int tag_int;

	bool istGueltig(std::string&amp; DATUM);
	void wandeln();
	std::string zusammenbauen(int tag_in2,int monat_in2,int jahr_in2);
};

struct Schueler
{
	std::string NAME;

	float durchschnitt(std::string NAME, std::string FACH);
	void anzeigen(std::string NAME, std::string FACH);
	void anlegen(std::string NAME, std::string FACH, std::string NOTE);
	void ergaenzen(std::string NAME, std::string FACH, std::string NOTE);

    void loeschen(std::string NAME);
	void ist_da();
};

struct Fach
{
	std::string NAME;
	void ist_da(std::string NAME);
};

struct Note
{
	std::string WERT;
};

#endif //KLASSEN_H
</code></pre>
<p>Hoffe ihr könnt mir helfen die Linker erros zu finden.</p>
<p>Gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947674</guid><dc:creator><![CDATA[!!Angel!!]]></dc:creator><pubDate>Thu, 22 Dec 2005 10:50:38 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Thu, 22 Dec 2005 10:54:56 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Hast du die Memberfunktionen deiner Klassen auch irgendwo definiert? Wenn ja ist diese cpp mit gelinkt?<br />
Du solltest übrigens deine Strings nicht als Kopie, sondern eher als konstante Referenz übergeben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947676</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947676</guid><dc:creator><![CDATA[Braunstein]]></dc:creator><pubDate>Thu, 22 Dec 2005 10:54:56 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Thu, 22 Dec 2005 10:58:08 GMT]]></title><description><![CDATA[<p>Du benötigst noch eine &quot;Klassen.cpp&quot;, in der du die Methoden deiner Klassen definierst.</p>
<p>PS: Für die uberschrift()-Funktion könntest du mal über switch-case nachdenken <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>PPS: Bei den Klassenmethoden bin ich gerade etwas unsicher, wie die funktionieren sollen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947678</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947678</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Thu, 22 Dec 2005 10:58:08 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Thu, 22 Dec 2005 13:02:12 GMT]]></title><description><![CDATA[<p>Ups.... Hab ichh ja vergessen zu Posten die Klassen.cpp</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;		//standart :?
#include &lt;string&gt;		//die strings 
#include &lt;fstream&gt;		//laden speichern
#include &lt;sstream&gt;		//_itoa ersatz
#include &quot;klassen.h&quot;	//alle meine klassen

using namespace std;

void cls();
void pau();

void Datum::wandeln()	//sichern dass man auch 
{						//buchstaben eintippen kann
	jahr_int=atoi(jahr.c_str());
	monat_int=atoi(monat.c_str());
	tag_int=atoi(tag.c_str());
}

string int2ascii(int WERT, string ruckgabe) //der int-zu-ascii
{											//konverter
	ostringstream wandler;
	wandler &lt;&lt; WERT;
	ruckgabe=wandler.str();
	return ruckgabe;
}

bool Datum::istGueltig(string&amp; DATUM)	//test ob datum gültig
{
	wandeln();
	DATUM = zusammenbauen(tag_int,monat_int,jahr_int);

	if(jahr_int == 0) return false;
	if(monat_int &gt; 0 &amp;&amp; monat_int &lt; 13)
	{
		//if(schaltjahr==1){if(monat == 2)
		//{if(tag &gt; 0 || tag &lt; 30) return true;}
		//else{
		if(monat_int == 2)
		{if(tag_int &gt; 0 || tag_int &lt; 29) return true;}
		//}

		if(monat_int == 4
		|| monat_int == 6
		|| monat_int == 9
		|| monat_int == 11)
		{if(tag_int &gt; 0 || tag_int &lt; 31) return true;}

		if(monat_int == 1 
		|| monat_int == 3 
		|| monat_int == 5 
		|| monat_int == 7 
		|| monat_int == 8 
		|| monat_int == 10 
		|| monat_int == 12)
		{if(tag_int &gt; 0 || tag_int &lt; 32) return true;}
	}
	return false;
}

string Datum::zusammenbauen(int tag_in2,int monat_in2,int jahr_in2)
{								//datum zusammenbauen
	string DATUM;

	// unnötig aber der vollständigkeit halber :
	if(tag_in2&lt;10){DATUM = &quot;0&quot;;DATUM += int2ascii(tag_in2, DATUM);}
	else{DATUM = int2ascii(tag_in2, DATUM);}
	DATUM +=&quot;.&quot;;
	if(monat_in2&lt;10){DATUM += &quot;0&quot;;DATUM += int2ascii(monat_in2, DATUM);}
	else{DATUM += int2ascii(monat_in2, DATUM);}
	DATUM +=&quot;.&quot;;
	if(jahr_in2 &gt; 99 &amp;&amp; jahr_in2&lt;1000){DATUM +=&quot;0&quot;;}
	if(jahr_in2 &gt; 9 &amp;&amp; jahr_in2&lt;100){DATUM +=&quot;00&quot;;}
	if(jahr_in2&lt;10){DATUM +=&quot;000&quot;;}
	DATUM += int2ascii(jahr_in2, DATUM);
	//datum zusammenbasteln ENDE

	return DATUM;
}

float Schueler::durchschnitt(string NAME, string FACH)
{								//durchschnitt berechnen
	int gesamt = 0;
	float durch = 0;
	string temp=&quot; &quot;;

	ifstream ifl((NAME+string(&quot;/&quot;)+FACH).c_str());

	while(temp!=&quot;&quot;)
	{
		getline(ifl,temp);
		durch+=(temp[0]-48);
		gesamt++;
	}
	ifl.close();
	durch+=48;
	gesamt--;
	durch/=gesamt;

	cout.precision(3);
	cout &lt;&lt; &quot;\n Durchschnitt: &quot; &lt;&lt;durch &lt;&lt; &quot;\n\n&quot;;

	return durch;
}

void Schueler::anzeigen(string NAME, string FACH)
{
	string ausgabe=&quot; &quot;;

	ifstream ifl((NAME+string(&quot;/&quot;)+FACH).c_str());

	while(ausgabe!=&quot;&quot;)
	{
		getline(ifl,ausgabe);
		cout &lt;&lt; &quot;\n &quot; &lt;&lt; ausgabe;
	}
	ifl.close();
	durchschnitt(NAME, FACH);

	pau();
}

void Schueler::anlegen(string NAME, string FACH, string NOTE)
{
//	ifstream ordner_da;
	string DATUM;
	Datum datums;

	if(NOTE==&quot;1&quot;||NOTE==&quot;2&quot;||NOTE==&quot;3&quot;||NOTE==&quot;4&quot;||NOTE==&quot;5&quot;||NOTE==&quot;6&quot;)
	{
		cout &lt;&lt; &quot;\n Tag: &quot;;
		cin &gt;&gt; datums.tag;
		cout &lt;&lt; &quot;\n Monat: &quot;;
		cin &gt;&gt; datums.monat;
		cout &lt;&lt; &quot;\n Jahr: &quot;;
		cin &gt;&gt; datums.jahr;

		if(datums.istGueltig(DATUM))
		{
		//	ordner_da.open((NAME+string(&quot;\\fach.txt&quot;)).c_str(), ios::in);
		//	if(ordner_da)
		//	{
	//		if(!(ordner_da.open((NAME + string(&quot;\\fach.txt&quot;)).c_str()))){
			//	system((string(&quot;mkdir &quot;)+NAME).c_str());
		//		cout &lt;&lt; &quot; test&quot;;
		//	}
		//	else
		//	{

			cout &lt;&lt; &quot;\n &quot;;
			system((string(&quot;mkdir &quot;)+NAME).c_str());

			pau();

			cls();

			fstream erfassenSch;
			erfassenSch.open(&quot;SchListe&quot;,ios::out | ios::app);
			erfassenSch &lt;&lt; (NAME + string(&quot;\n&quot;)).c_str();
			erfassenSch.close();

			fstream erfassenFach;
			erfassenFach.open((NAME + string(&quot;/FachListe&quot;)).c_str(),ios::out | ios::app);
			erfassenFach &lt;&lt; (FACH + string(&quot;\n&quot;)).c_str();
			erfassenFach.close();

			fstream erfassenEintrag;
			erfassenEintrag.open((NAME+string(&quot;/&quot;)+FACH).c_str(),ios::out | ios::ate);
			erfassenEintrag &lt;&lt; (NOTE + string(&quot; &quot;) + DATUM + string(&quot;\n&quot;)).c_str();
			erfassenEintrag.close();
			}
		else
		{
			#ifdef unix
			cout &lt;&lt; &quot;\n ungültiges Datum !\n &quot;;pau();
			#else
			cout &lt;&lt; &quot;\n ungltiges Datum !\n &quot;;pau();
			#endif
		}
	}
	else
	{
		#ifdef unix
		cout &lt;&lt; &quot;\n ungültige Note !\n &quot;;pau();
		#else
		cout &lt;&lt; &quot;\n ungltige Note !\n &quot;;pau();
		#endif
	}
}

void Schueler::ergaenzen(string NAME, string FACH, string NOTE)
{
	string DATUM;
	Datum datums;

	if(NOTE==&quot;1&quot;||NOTE==&quot;2&quot;||NOTE==&quot;3&quot;||NOTE==&quot;4&quot;||NOTE==&quot;5&quot;||NOTE==&quot;6&quot;)
	{
		cout &lt;&lt; &quot;\n Tag: &quot;;
		cin &gt;&gt; datums.tag;
		cout &lt;&lt; &quot;\n Monat: &quot;;
		cin &gt;&gt; datums.monat;
		cout &lt;&lt; &quot;\n Jahr: &quot;;
		cin &gt;&gt; datums.jahr;

		if(datums.istGueltig(DATUM))
		{
			pau();

			fstream ergaenzenFach;
			ergaenzenFach.open((NAME + string(&quot;/FachListe&quot;)).c_str(),ios::out | ios::app);
			ergaenzenFach &lt;&lt; (FACH + string(&quot;\n&quot;)).c_str();
			ergaenzenFach.close();

			fstream ergaenzenEintrag;
			ergaenzenEintrag.open((NAME+string(&quot;/&quot;)+FACH).c_str(),ios::out | ios::app);
			ergaenzenEintrag &lt;&lt; (NOTE + string(&quot; &quot;) + DATUM + string(&quot;\n&quot;)).c_str();
			ergaenzenEintrag.close();
		}
		else
		{
			#ifdef unix
			cout &lt;&lt; &quot;\n ungültiges Datum !\n &quot;;pau();
			#else
			cout &lt;&lt; &quot;\n ungltiges Datum !\n &quot;;pau();
			#endif
		}
	}
	else
	{
		#ifdef unix
		cout &lt;&lt; &quot;\n ungültige Note !\n &quot;;pau();
		#else
		cout &lt;&lt; &quot;\n ungltige Note !\n &quot;;pau();
		#endif
	}
}

void Schueler::loeschen(string NAME)
{
    #ifdef unix
    system((&quot;rm -r &quot; + NAME + &quot;/*&quot;).c_str());
    #else
    system((&quot;del &quot; + NAME + &quot;\\*&quot;).c_str());
    #endif
    system((&quot;rmdir &quot; + NAME).c_str());
}

void Schueler::ist_da()
{
    ifstream istda;  
    string eintraege;
    istda.open(&quot;SchListe&quot;, ios::in);
    if(istda)
    {
		#ifdef unix
		cout &lt;&lt; &quot;\n vorhandene Schüler\n&quot;;
		#else
		cout &lt;&lt; &quot;\n vorhandene Schler\n&quot;;
		#endif

		while (!istda.eof())          
		{
			getline(istda, eintraege);      
			cout &lt;&lt; &quot;\n &quot; &lt;&lt; eintraege;    
		}
	}
}

void Fach::ist_da(string NAME)
{
    ifstream istda;  
    string eintraege;

    istda.open((NAME+string(&quot;/FachListe&quot;)).c_str(), ios::in);

    if(istda)
    {
		#ifdef unix
		cout &lt;&lt; &quot;\n vorhandene Fächer von &quot; &lt;&lt; NAME &lt;&lt; &quot;\n&quot;;
		#else
		cout &lt;&lt; &quot;\n vorhandene F„cher von &quot; &lt;&lt; NAME &lt;&lt; &quot;\n&quot;;
		#endif

		while (!istda.eof())          
		{
			getline(istda, eintraege);      
			cout &lt;&lt; &quot;\n &quot; &lt;&lt; eintraege;    
		}
	}
}
</code></pre>
<p>Und über switch-case denke ich mal nach <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/947762</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947762</guid><dc:creator><![CDATA[!!Angel!!]]></dc:creator><pubDate>Thu, 22 Dec 2005 13:02:12 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Thu, 22 Dec 2005 13:12:16 GMT]]></title><description><![CDATA[<p>Die Schüler-Klasse sieht ja merkwürdig aus - legst du echt für jeden Schüler ein eigenes Verzeichnis auf Festplatte an?<br />
Und außerdem solltest du dort, wo du mit Zahlen rechnest, auch int's verwenden (z.B. für die Noten)</p>
<p>Ansonsten: Schau doch mal die Fehlermeldungen durch, welche Funktion(en) der Linker nicht findet - das könnte schonmal ein erster Ansatz sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947768</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947768</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Thu, 22 Dec 2005 13:12:16 GMT</pubDate></item><item><title><![CDATA[Reply to Schulnotenprogramm in C++ on Thu, 22 Dec 2005 14:34:48 GMT]]></title><description><![CDATA[<p>Das Programm läuft mitlerweile! Nun werde ich alles nochmal überarbeiten und über eure Vorschläge nachdenken!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/947852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/947852</guid><dc:creator><![CDATA[!!Angel!!]]></dc:creator><pubDate>Thu, 22 Dec 2005 14:34:48 GMT</pubDate></item></channel></rss>