mirror of
https://inf-git.fh-rosenheim.de/studavrije7683/cplusplus-training.git
synced 2025-04-20 02:59:55 +00:00
34 lines
654 B
C++
34 lines
654 B
C++
#include<iostream>
|
|
|
|
using namespace std;
|
|
|
|
int Gewicht=0; // 3 globale Variablenen deklarieren und initialisieren
|
|
float Tagespreis=0;
|
|
float Einnahme=0;
|
|
|
|
void Daten_abfragen() //Deklaration und Definition der Methode Daten_abfragen
|
|
{
|
|
cout << "Wie ist das Gewicht? " << endl;
|
|
cin >> Gewicht;
|
|
cout << "Wie steht der Tagespreis? " << endl;
|
|
cin >> Tagespreis;
|
|
}
|
|
|
|
void Einnahme_berechnen() //Deklaration und Definition der Methode Einnahme_berechnen
|
|
{
|
|
Einnahme = Gewicht * Tagespreis;
|
|
cout << "Einnahme: " << Einnahme<<endl;
|
|
}
|
|
|
|
int main()
|
|
{
|
|
//Methodenaufrufe
|
|
Daten_abfragen();
|
|
Einnahme_berechnen();
|
|
|
|
cout << endl << endl;
|
|
system("PAUSE");
|
|
return 0;
|
|
}
|
|
|