+ 2
Can anyone help me to overcome this code?I'm able to get the 3&4 test cases to be true but 1,2&5 cases are showing failed.
6 Antworten
+ 3
in your code take input from user here i taken count
int price = 2000000;
int cost = 3000000;
int insurance = 1000000;
int allCount = 10;
int count =0;
Take input as a count
int allPrice = price * allCount + insurance - cost * count;
+ 2
User input means is that an int order asking for the user
+ 2
Thank u soo much whoever helped me to overcome my mistakes in my code.my heartfull thanks to all
+ 1
You should add a user input statement, because the code coach will provide you some input in each case.
Then, your total cost is always the same (ten hovercrafts for $ 2mn each plus $ 1mn insurance), and your sales revenue changes in each test case ($ 3mn for each unit sold).
0
1.give input by scanner...
2.multiply that input by both original cost and the selling cost.(but not the insurance)
3.Your if else condition checks both >= and<= for same input that means the Break Even will never print
0
Change the <= and >= of if else to < and > and try again