-
-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathhovercraft.c
More file actions
29 lines (23 loc) · 572 Bytes
/
hovercraft.c
File metadata and controls
29 lines (23 loc) · 572 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <stdio.h>
const char* hovercraft_profit_status(int units_sold)
{
int sell_price = 3000000;
int cost_price = 2000000;
int insurance_price = 1000000;
int units_built = 10;
int expenses = (units_built * cost_price) + insurance_price;
int revenue = units_sold * sell_price;
if (revenue > expenses)
return "Profit";
else if (revenue < expenses)
return "Loss";
else
return "Broke Even";
}
int main()
{
int units_sold;
scanf("%d", &units_sold);
printf("%s", hovercraft_profit_status(units_sold));
return 0;
}