[ create a new paste ] login | about

Link: http://codepad.org/dzP3f6vt    [ raw code | output | fork ]

C++, pasted on Sep 25:
#include <iostream>
#include <string>

using namespace std;

int rechner(int geldbetrag, int kurs, int ergebnis);

int main()
{
	// VARIABLEN
	string stSpielername;
	int nAuswahl = 0;

	while (nAuswahl != 3)
	{

	cout << endl;
	cout << " =============" << endl;
	cout << "  SPIEL-MENU" << endl;
	cout << " =============\n" << endl;

	cout << " => [1] Spiel starten" << endl;
	cout << " => [2] Anleitung" << endl;
	cout << " => [3] Gramm-Rechner" << endl;
	cout << " => [3] Beenden\n" << endl;

	cout << " => AUSWAHL: ";
	cin >> nAuswahl;

	if (nAuswahl == 1) // Spiel starten
	{
		system("CLS");
		cout << "Starte Spiel..." << endl;
	}
	else if (nAuswahl == 2) // Anleitung
	{
		system("CLS");
		cout << "Spiel einfach..." << endl;
	}
	else if (nAuswahl == 3) // Rechner
	{
		system("CLS");
		int rechner (int geldbetrag, int kurs, int ergebnis);
	}
	else if (nAuswahl == 4) // Beenden
	{
		system("CLS");
		cout << "Beenden..." << endl;
	}
	else
	{
		system("CLS");
		cout << "FALSCHE EINGABE!!! ERROR ERROR ERROR!!!" << endl;
	}

	}

	getchar();
	return 0;
}

int rechner (int geldbetrag, int kurs, int ergebnis)
{
	cout << " => Geldbetrag: ";
	cin >> geldbetrag;
	cout << endl;
	cout << " => Kurs: ";
	cin >> kurs;
	cout << endl;
	ergebnis = geldbetrag / kurs;
	cout << " => Du erhaelst " << ergebnis << " Gramm zum Rauchen!" << endl;
	cout << endl;
}


Output:
1
2
3
cc1plus: warnings being treated as errors
In function 'int rechner(int, int, int)':
Line 73: warning: control reaches end of non-void function


Create a new paste based on this one


Comments: