<?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[Brauche Hilfe bei meinem Programm, das will nich wies soll]]></title><description><![CDATA[<p>Ich moechte Passwort eingeben...solange das falsch is soll er immer passwort abfragen,...wenns dann richtig is, soll er eifnach weiter machen...</p>
<pre><code class="language-cpp">// PROJEKT BANK
#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;conio.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#include &lt;windows.h&gt;

using namespace std;

struct girokonto
{
	double	kontostand;
	int	maxkontostand;
	double	dispo;
	int	kontonummer;
	char	kontoinhaber[20];
	double	einzahlen;
	int	auszahlen;
	int	kontenzaehler;
	int	PIN;
};

void anlegenKonto(girokonto&amp;);
void eingabeDaten();
void ausgabeDaten(girokonto);
void einzahlen(girokonto&amp;, girokonto&amp;);
void auszahlen(girokonto&amp;, girokonto&amp;);
void beratung(girokonto);
void dispoOut(girokonto&amp;);
void kundendatenEingabe(girokonto&amp;);
//void kontouebersicht();
void speichern(girokonto&amp;);

void anlegenKonto(girokonto &amp;a)
{
	srand(time(NULL));
	a.PIN = rand ();

	cout&lt;&lt;&quot;NEUES KONTO ANLEGEN\n\n&quot;;
	cout&lt;&lt;&quot;Konto-Nr.:\t&quot;;			cin&gt;&gt;a.kontonummer;
	cout&lt;&lt;&quot;\nName:\t\t&quot;;			cin&gt;&gt;a.kontoinhaber;
	cout&lt;&lt;&quot;\nEinzahlen:\t&quot;;			cin&gt;&gt;a.kontostand;
	//cout&lt;&lt;&quot;\nKontostand:\t&quot;;		cout&lt;&lt;a.kontostand&lt;&lt;&quot; Euro&quot;;

	cout&lt;&lt;&quot;\n\nPIN wird generiert...&quot;;      cout&lt;&lt;&quot;\n\nneue PIN:\t&quot;&lt;&lt;a.PIN;

	_getch();
	system(&quot;cls&quot;);
}

void ausgabeDaten(girokonto a)
{
	cout&lt;&lt;&quot;Ihr Kontostand: &quot;&lt;&lt;a.kontostand&lt;&lt;&quot; Euro\n&quot;;
}

void einzahlen(girokonto &amp;a, girokonto &amp;b)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;Wieviel einzahlen? &quot;;	cin&gt;&gt;a.einzahlen;

	b.kontostand = b.kontostand + a.einzahlen;
	//system(&quot;cls&quot;);
}

void auszahlen(girokonto &amp;a, girokonto &amp;b)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;PIN: &quot;;	cin&gt;&gt;a.PIN;
	//for(rand()=0;rand()!=a.PIN;rand()++)	cin&gt;&gt;a.PIN;
	if(rand()!=a.PIN)
	{
		do
		{
			if(rand()!=a.PIN)	cout&lt;&lt;&quot;FALSCHE EINGABE&quot;;
		}
		while(rand()!=a.PIN);	
	}
	cout&lt;&lt;&quot;Wieviel wollen Sie ausgezahlt haben?\n\n&quot;;	
	cout&lt;&lt;&quot;\n10\t20\t50\n100\t200\n\n&quot;;
	cin&gt;&gt;a.auszahlen;
	if(a.auszahlen != 10||20||50||100||200)	cout&lt;&lt;&quot;Falsche Eingabe!&quot;;
	b.kontostand = b.kontostand - a.auszahlen;

	cout&lt;&lt;&quot;Bitte entnehmen Sie Ihre&quot;&lt;&lt;b.kontostand&lt;&lt;&quot; Euro.\n&quot;;
	cout&lt;&lt;&quot;Jetziger Kontostand: &quot;&lt;&lt;b.kontostand&lt;&lt;&quot; Euro\n&quot;;
}

void beratung(girokonto a)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;Wir empfehlen Ihnen wegen Ihren Finanzen ein neues Konto einzurichten.\n&quot;;
	system(&quot;cls&quot;);
	anlegenKonto(a);
}

void dispoOut(girokonto&amp; a)
{
	system(&quot;cls&quot;);
	if(a.kontostand&lt;0)	cout&lt;&lt;&quot;\n\nSie sind mit &quot;&lt;&lt;a.kontostand&lt;&lt;&quot; Euro im Minus.\nIhr Dispokredit wurde fuer Sie aktiviert.\n&quot;;
}

void kundendatenEingabe(girokonto &amp;a)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;Konto-Nr.:\t&quot;;	cin&gt;&gt;a.kontonummer;
	//cout&lt;&lt;&quot;\nName:\t&quot;;	cin&gt;&gt;a.kontoinhaber;
	cout&lt;&lt;&quot;\nPIN:\t\t&quot;;	cin&gt;&gt;a.PIN;
/////////////////////////////////////////////////*Passwortabfrage*////////////////////////////////////////////////////////
//evtl. mit do while,...solange pw falsch gehts nicht weiter...
	/*if(a.PIN != rand())
	{
		cout&lt;&lt;&quot;FALSCHE PIN!&quot;;
		_getch();
		exit(0);
	}*/
	system(&quot;cls&quot;);
}

void speichern(girokonto&amp; a)
{
	char KN[10];
	char PIN[10];
	char KS[100];

	itoa(a.kontonummer, KN, 10);
	itoa(a.PIN, PIN, 10);
	itoa(a.kontostand, KS, 10);

	ofstream aus;

	aus.open(&quot;Bankautomat.txt&quot;, ios::out);
	aus&lt;&lt;&quot;\n&quot;&lt;&lt;a.kontonummer;
	aus&lt;&lt;&quot;\t&quot;&lt;&lt;a.kontoinhaber;
	aus&lt;&lt;&quot;\t&quot;&lt;&lt;a.PIN;
	aus&lt;&lt;&quot;\t&quot;&lt;&lt;a.kontostand;
	aus.close();

	ifstream ein;

	ein.open(&quot;Bankautomat.txt&quot;, ios::in);

	ein.getline(KN, 250, '\n');
	ein.getline(PIN, 250, '\n');
	ein.getline(a.kontoinhaber, 250, '\n');
	ein.getline(KS, 250, '\n');

	ein.close();

	cout&lt;&lt;KN&lt;&lt;a.kontoinhaber&lt;&lt;KS;

}

int _tmain(int argc, _TCHAR* argv[])
{
	girokonto a;
	int tun;
	char kunde;
	a.kontostand = 0;

	cout&lt;&lt;&quot;bereits Kunde?(j/n)&quot;;	cin&gt;&gt;kunde;

	if(kunde == 'n')
	{
		system(&quot;cls&quot;);
		anlegenKonto(a);
		speichern(a);

		system(&quot;cls&quot;);

		do
		{
			cout&lt;&lt;&quot;\n\nWas tun?\n&quot;;
			cout&lt;&lt;&quot;\n1 - Geld abheben&quot;;
			cout&lt;&lt;&quot;\n2 - Geld einzahlen&quot;;
			cout&lt;&lt;&quot;\n3 - Kontostand&quot;;
			cout&lt;&lt;&quot;\n4 - Neues Konto anlegen&quot;;
			cout&lt;&lt;&quot;\n\n6 - Beenden\n\n&quot;;

			cin&gt;&gt;tun;

			switch(tun)
			{
				case 1: auszahlen(a,a);	break;
				case 2:	einzahlen(a,a); break;
				case 3: cout&lt;&lt;a.kontostand&lt;&lt;&quot; Euro&quot;;
					if(a.kontostand &gt; 50000) beratung(a);
							break;
				case 4: anlegenKonto(a);break;
				case 5: exit(0);	break;
			}

			dispoOut(a);
		}
		while(kunde = 'j');
	}
	else
	{
		kundendatenEingabe(a);
		//system(&quot;cls&quot;);

		do
		{
			cout&lt;&lt;&quot;\nWas tun?\n&quot;;
			cout&lt;&lt;&quot;\n1 - Geld abheben&quot;;
			cout&lt;&lt;&quot;\n2 - Geld einzahlen&quot;;
			cout&lt;&lt;&quot;\n3 - Kontostand&quot;;
			cout&lt;&lt;&quot;\n4 - Neues Konto anlegen&quot;;

			cout&lt;&lt;&quot;\n6 - Beenden\n\n&quot;;

			cin&gt;&gt;tun;

			switch(tun)
			{
				case 1: auszahlen(a,a);	break;
				case 2: einzahlen(a,a);	break;
				case 3: cout&lt;&lt;a.kontostand&lt;&lt;&quot; Euro&quot;;
						if(a.kontostand&gt;500000)
						{
							beratung(a);
						}	break;
				case 4: anlegenKonto(a);break;
				case 6: exit(0);	break;
			}
			dispoOut(a);
		}
		while(kunde='j');
	}
	_getch();
	return 0;
}
//Bin ueber jede Hilfe dankbar!!!
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/304501/brauche-hilfe-bei-meinem-programm-das-will-nich-wies-soll</link><generator>RSS for Node</generator><lastBuildDate>Sun, 09 Aug 2026 18:45:45 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304501.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 07 Jun 2012 18:25:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Brauche Hilfe bei meinem Programm, das will nich wies soll on Thu, 07 Jun 2012 18:25:25 GMT]]></title><description><![CDATA[<p>Ich moechte Passwort eingeben...solange das falsch is soll er immer passwort abfragen,...wenns dann richtig is, soll er eifnach weiter machen...</p>
<pre><code class="language-cpp">// PROJEKT BANK
#include &quot;stdafx.h&quot;
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;conio.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;time.h&gt;
#include &lt;windows.h&gt;

using namespace std;

struct girokonto
{
	double	kontostand;
	int	maxkontostand;
	double	dispo;
	int	kontonummer;
	char	kontoinhaber[20];
	double	einzahlen;
	int	auszahlen;
	int	kontenzaehler;
	int	PIN;
};

void anlegenKonto(girokonto&amp;);
void eingabeDaten();
void ausgabeDaten(girokonto);
void einzahlen(girokonto&amp;, girokonto&amp;);
void auszahlen(girokonto&amp;, girokonto&amp;);
void beratung(girokonto);
void dispoOut(girokonto&amp;);
void kundendatenEingabe(girokonto&amp;);
//void kontouebersicht();
void speichern(girokonto&amp;);

void anlegenKonto(girokonto &amp;a)
{
	srand(time(NULL));
	a.PIN = rand ();

	cout&lt;&lt;&quot;NEUES KONTO ANLEGEN\n\n&quot;;
	cout&lt;&lt;&quot;Konto-Nr.:\t&quot;;			cin&gt;&gt;a.kontonummer;
	cout&lt;&lt;&quot;\nName:\t\t&quot;;			cin&gt;&gt;a.kontoinhaber;
	cout&lt;&lt;&quot;\nEinzahlen:\t&quot;;			cin&gt;&gt;a.kontostand;
	//cout&lt;&lt;&quot;\nKontostand:\t&quot;;		cout&lt;&lt;a.kontostand&lt;&lt;&quot; Euro&quot;;

	cout&lt;&lt;&quot;\n\nPIN wird generiert...&quot;;      cout&lt;&lt;&quot;\n\nneue PIN:\t&quot;&lt;&lt;a.PIN;

	_getch();
	system(&quot;cls&quot;);
}

void ausgabeDaten(girokonto a)
{
	cout&lt;&lt;&quot;Ihr Kontostand: &quot;&lt;&lt;a.kontostand&lt;&lt;&quot; Euro\n&quot;;
}

void einzahlen(girokonto &amp;a, girokonto &amp;b)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;Wieviel einzahlen? &quot;;	cin&gt;&gt;a.einzahlen;

	b.kontostand = b.kontostand + a.einzahlen;
	//system(&quot;cls&quot;);
}

void auszahlen(girokonto &amp;a, girokonto &amp;b)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;PIN: &quot;;	cin&gt;&gt;a.PIN;
	//for(rand()=0;rand()!=a.PIN;rand()++)	cin&gt;&gt;a.PIN;
	if(rand()!=a.PIN)
	{
		do
		{
			if(rand()!=a.PIN)	cout&lt;&lt;&quot;FALSCHE EINGABE&quot;;
		}
		while(rand()!=a.PIN);	
	}
	cout&lt;&lt;&quot;Wieviel wollen Sie ausgezahlt haben?\n\n&quot;;	
	cout&lt;&lt;&quot;\n10\t20\t50\n100\t200\n\n&quot;;
	cin&gt;&gt;a.auszahlen;
	if(a.auszahlen != 10||20||50||100||200)	cout&lt;&lt;&quot;Falsche Eingabe!&quot;;
	b.kontostand = b.kontostand - a.auszahlen;

	cout&lt;&lt;&quot;Bitte entnehmen Sie Ihre&quot;&lt;&lt;b.kontostand&lt;&lt;&quot; Euro.\n&quot;;
	cout&lt;&lt;&quot;Jetziger Kontostand: &quot;&lt;&lt;b.kontostand&lt;&lt;&quot; Euro\n&quot;;
}

void beratung(girokonto a)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;Wir empfehlen Ihnen wegen Ihren Finanzen ein neues Konto einzurichten.\n&quot;;
	system(&quot;cls&quot;);
	anlegenKonto(a);
}

void dispoOut(girokonto&amp; a)
{
	system(&quot;cls&quot;);
	if(a.kontostand&lt;0)	cout&lt;&lt;&quot;\n\nSie sind mit &quot;&lt;&lt;a.kontostand&lt;&lt;&quot; Euro im Minus.\nIhr Dispokredit wurde fuer Sie aktiviert.\n&quot;;
}

void kundendatenEingabe(girokonto &amp;a)
{
	system(&quot;cls&quot;);
	cout&lt;&lt;&quot;Konto-Nr.:\t&quot;;	cin&gt;&gt;a.kontonummer;
	//cout&lt;&lt;&quot;\nName:\t&quot;;	cin&gt;&gt;a.kontoinhaber;
	cout&lt;&lt;&quot;\nPIN:\t\t&quot;;	cin&gt;&gt;a.PIN;
/////////////////////////////////////////////////*Passwortabfrage*////////////////////////////////////////////////////////
//evtl. mit do while,...solange pw falsch gehts nicht weiter...
	/*if(a.PIN != rand())
	{
		cout&lt;&lt;&quot;FALSCHE PIN!&quot;;
		_getch();
		exit(0);
	}*/
	system(&quot;cls&quot;);
}

void speichern(girokonto&amp; a)
{
	char KN[10];
	char PIN[10];
	char KS[100];

	itoa(a.kontonummer, KN, 10);
	itoa(a.PIN, PIN, 10);
	itoa(a.kontostand, KS, 10);

	ofstream aus;

	aus.open(&quot;Bankautomat.txt&quot;, ios::out);
	aus&lt;&lt;&quot;\n&quot;&lt;&lt;a.kontonummer;
	aus&lt;&lt;&quot;\t&quot;&lt;&lt;a.kontoinhaber;
	aus&lt;&lt;&quot;\t&quot;&lt;&lt;a.PIN;
	aus&lt;&lt;&quot;\t&quot;&lt;&lt;a.kontostand;
	aus.close();

	ifstream ein;

	ein.open(&quot;Bankautomat.txt&quot;, ios::in);

	ein.getline(KN, 250, '\n');
	ein.getline(PIN, 250, '\n');
	ein.getline(a.kontoinhaber, 250, '\n');
	ein.getline(KS, 250, '\n');

	ein.close();

	cout&lt;&lt;KN&lt;&lt;a.kontoinhaber&lt;&lt;KS;

}

int _tmain(int argc, _TCHAR* argv[])
{
	girokonto a;
	int tun;
	char kunde;
	a.kontostand = 0;

	cout&lt;&lt;&quot;bereits Kunde?(j/n)&quot;;	cin&gt;&gt;kunde;

	if(kunde == 'n')
	{
		system(&quot;cls&quot;);
		anlegenKonto(a);
		speichern(a);

		system(&quot;cls&quot;);

		do
		{
			cout&lt;&lt;&quot;\n\nWas tun?\n&quot;;
			cout&lt;&lt;&quot;\n1 - Geld abheben&quot;;
			cout&lt;&lt;&quot;\n2 - Geld einzahlen&quot;;
			cout&lt;&lt;&quot;\n3 - Kontostand&quot;;
			cout&lt;&lt;&quot;\n4 - Neues Konto anlegen&quot;;
			cout&lt;&lt;&quot;\n\n6 - Beenden\n\n&quot;;

			cin&gt;&gt;tun;

			switch(tun)
			{
				case 1: auszahlen(a,a);	break;
				case 2:	einzahlen(a,a); break;
				case 3: cout&lt;&lt;a.kontostand&lt;&lt;&quot; Euro&quot;;
					if(a.kontostand &gt; 50000) beratung(a);
							break;
				case 4: anlegenKonto(a);break;
				case 5: exit(0);	break;
			}

			dispoOut(a);
		}
		while(kunde = 'j');
	}
	else
	{
		kundendatenEingabe(a);
		//system(&quot;cls&quot;);

		do
		{
			cout&lt;&lt;&quot;\nWas tun?\n&quot;;
			cout&lt;&lt;&quot;\n1 - Geld abheben&quot;;
			cout&lt;&lt;&quot;\n2 - Geld einzahlen&quot;;
			cout&lt;&lt;&quot;\n3 - Kontostand&quot;;
			cout&lt;&lt;&quot;\n4 - Neues Konto anlegen&quot;;

			cout&lt;&lt;&quot;\n6 - Beenden\n\n&quot;;

			cin&gt;&gt;tun;

			switch(tun)
			{
				case 1: auszahlen(a,a);	break;
				case 2: einzahlen(a,a);	break;
				case 3: cout&lt;&lt;a.kontostand&lt;&lt;&quot; Euro&quot;;
						if(a.kontostand&gt;500000)
						{
							beratung(a);
						}	break;
				case 4: anlegenKonto(a);break;
				case 6: exit(0);	break;
			}
			dispoOut(a);
		}
		while(kunde='j');
	}
	_getch();
	return 0;
}
//Bin ueber jede Hilfe dankbar!!!
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2220688</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220688</guid><dc:creator><![CDATA[Tester10031995]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:25:25 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Hilfe bei meinem Programm, das will nich wies soll on Thu, 07 Jun 2012 18:50:37 GMT]]></title><description><![CDATA[<p><a href="http://www.c-plusplus.net/forum/304133" rel="nofollow">http://www.c-plusplus.net/forum/304133</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220699</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220699</guid><dc:creator><![CDATA[wxSkip]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:50:37 GMT</pubDate></item><item><title><![CDATA[Reply to Brauche Hilfe bei meinem Programm, das will nich wies soll on Thu, 07 Jun 2012 18:55:25 GMT]]></title><description><![CDATA[<p>Ich habe den Code nicht ganz gelesen, weil er mir zu lang ist, aber warum in aller welt prüfst du in Zeile 113 auf eine rand() Funktion? die gibt eine random-Zahl aus. Bist du sicher, dass du das willst?</p>
<p>gruß<br />
syntax</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2220701</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2220701</guid><dc:creator><![CDATA[Syntax_error]]></dc:creator><pubDate>Thu, 07 Jun 2012 18:55:25 GMT</pubDate></item></channel></rss>