+ 1
Code couch hovercraft help !
14 Respuestas
+ 4
https://code.sololearn.com/crOfl8f24T1I/?ref=app
+ 3
First problem I see:
your program prints Loss when == and Broke Even for else. Shouldn't be the other way around?
I'll edit my answer if I find more.
Edit. Also your inequalities needs reviewing.
You sould have on one side:
month+insurance
And on the other side:
customer*selling
+ 3
The problem specifying that
They make 10 hovercrafts each one cost 2000000, and each sales 3000000,...
he pays 10000000 insurance every month,...
Now think again, cost per month,
Is he getting more or less by selling 300000*sales.
For less, print loss,
For greater print profit
For equal print broke even...
Edit:
If you paste code in playground and share link, then it will easy for one to look errors if any in code...
+ 1
X R I G E L
If we give code, you don't get anything..
So Just read my description again, reply with what you not understand there...
You just need to use your month value, you are right upto that.. Try.
+ 1
i did same too
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int hovercraft= 2000000;
int insurance =1000000;
int selling =3000000;
int month=10*hovercraft;
int customer=Convert.ToInt32(Console.ReadLine());
if(customer*hovercraft+insurance < customer*selling +insurance){
Console.WriteLine("Profit");
}
if(customer*hovercraft +insurance==customer*selling+insurance){
Console.WriteLine("Loss");
}
else{
Console.WriteLine("Broke Even");
}
}
}
}
0
whats wrong i cannt figure out
0
in factory you can make 10 i think he is getting more
0
guys can you paste uour code i cannt understand with code i will figure it out if it is not problem 💜
0
X R I G E L
What's the point to paste our codes. It is better that you understand the problem, we can only guide you to the final answer.
0
okey i will concentrate and if i will have some problem can i send message to you ? sorry for wrong words big fingers 😃
0
Something to remember, your factory makes 10 and only 10 hovercrafts each month. You only pay insurance 1 per month.
Hope this helps solve the riddle
0
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SoloLearn
{
class Program
{
static void Main(string[] args)
{
int sales, revenue, expenditure;
sales = Convert.ToInt32(Console.ReadLine());
revenue=sales*3000000;
expenditure=10*2000000+1000000;
if (revenue>expenditure) {
Console.WriteLine("Profit");
}
else if (expenditure>revenue) {
Console.WriteLine("Loss");
}
else if(expenditure==revenue){
Console.WriteLine("Broke Even");
}
}
}
}
0
you add this last == please