+ 4
Hovercraft challenge
Test 1 fails #include <iostream> #include <string> using namespace std; int a; //input how many int b; //monthly made int c; //price they pay int sumOut; //price you pay int sumIn; //how much you make int main() { int a; cin >> a; //10 a month at 2000000= 20000000 // insurance 1000000 b = 19000000; c = 3000000; sumIn = (a * c); if(b == sumIn){ cout << "Broke Even" << endl; } else if (b > sumIn){ cout << "Loss" << endl; }else{ cout << "Profit" << endl; } return 0; }
3 Respostas
+ 5
Your monthly costs:
10 x 2.000.000 + 1.000.000
cost = 21.000.000
Your income:
income = a x 300.000
income < cost => Loss
income = cost => Broke Even
income > cost => Profit
+ 5
Montell Ifill
There should be plus instead of minus
So b = 21000000
+ 3
Thanks yeah that fixed it