ok, i see you are trying to do something not all that complicated..
I suggest you read the tutorials.. theyll help you alot.
first off to get a number input you you use
it will pause the program untill the user inputs a number.
then variable is the number the user inputed.
and you are still trying to add a string to a number:
Code:
if( i > k ){
cout<<"Gewinn oder Verlust: +" + ( i - k );
}
that is imposible, are you trying to get the user to input a number and then add the (i -k) to it?
because what you have there right now makes no sence...
also your main() function does not return any value. main() must return something (read thee tutorial on functions).
Code:
#include <iostream>
#include <stdlib.h>
using namespace std;
int main()
{
double a;
double b;
double c;
double d;
int e;
int f;
int g;
int h;
int i;
int j;
double k;
double l;
double m;
int n;
int o;
int p;
int r;
cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Brezeln ein: ";
cin >> e;
n = 7 - e;
cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugenbrötchen ein: /n";
cin >> f;
o = 5 - f;
cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Käsestangen ein: /n";
cin >> g;
p = 5 - g;
cout<<"Geben Sie bitte der Anzahl der übrig gebliebene Laugencroissants ein: /n";
cin >> h;
r = 5 - h;
j = n + o + p + r;
cout<<"Geben Sie bitte Kassenstand am Ende in € ein: /n";
a = n * 0.5;
b = o * 0.4;
c = p * 0.7;
d = r * 0.65;
k = 10 + a + b + c + d;
l = e * 0.50 + f * 0.40 + g * 0.70 + h * 0.65;
m = 7 * 0.50 + 5 * 0.40 + 5 * 0.70 + 5 * 0.65 + 10;
cout<<"Kassenstand wenn alles verkauft worden sein würde: ";
cout<<"So viel Geld müssen Sie in die Kasse haben: ";
cout<<"Preis der übrig gebliebene Waren: ";
cout<<"Aktuelle Kassenstand am Ende: ";
if( i < k ){
cout<<"Gewinn oder Verlust: -";
}
if( i > k ){
cout<<"Gewinn oder Verlust: +";
}
if( i == k ){
cout<<"Gewinn oder Verlust: ";
}
system("PAUSE");
return 0;
}
it works fine, but the variable 'i' has no value. so you youll get an error.