Files
Cpp-Cookbook/Reisekosten-Rechner/main.cpp

53 lines
1.8 KiB
C++

#include <iostream>
#include <windows.h>
using namespace std;
int main() {
SetConsoleOutputCP(CP_UTF8);
const string header[] = {
"R E I S E K O S T E N R E C H N E R",
"------------------------------------",
"\n",
};
for (const string &j: header) {
cout << j << endl;
}
double KostenPerPerson;
cout << "Grundpreis der Reise pro Person <EUR>: \t";
cin >> KostenPerPerson;
double AnzahlReisende;
cout << "Anzahl der Reisenden: \t \t \t";
cin >> AnzahlReisende;
system("cls");
//Ausgabe
const string AusgabeHeader[] = {
" R E I S E K O S T E N R E C H N E R ",
"--------------------------------------",
"\n",
"Pro Reise werden 3% Verpflegungskosten \nund 100 Euro Gewinnpauschale berechnet",
"\n",
"--------------------------------------",
"\n",
"Fuer die Reise ergibt sich ...",
};
for (const string &j: AusgabeHeader) {
cout << j << endl;
}
double gesamtKosten = (KostenPerPerson * AnzahlReisende) + (KostenPerPerson * AnzahlReisende / 100 * 3) + 100;
cout << "Bei '" << KostenPerPerson << "' EUR Grundpreis pro Person" << endl;
cout << "und '" << AnzahlReisende << "' Reisenden:" << endl;
cout << "\n";
cout << "Reisepreis <EUR> \t \t" << KostenPerPerson * AnzahlReisende << endl;
cout << "+ Verpflegungskosten <EUR> \t" << KostenPerPerson * AnzahlReisende / 100 * 3 << endl;
cout << "+ Gewinnpauschale <EUR> \t" << 100 << endl << endl;
cout << "--------------------------------------" << endl << endl;
cout << "Gesamtkosten <EUR>: \t \t" << gesamtKosten << endl << endl;
cout << "--> Preis pro Person: \t \t" << gesamtKosten / AnzahlReisende << " EUR" << endl << endl;
system("pause");
return 0;
}