Snippets

Kevin Pichette Hovercrafts

Created by Kevin Pichette last modified
# You run a hovercraft factory. Your factory makes ten hovercrafts in a month.
# Given the number of customers you got that month, did you make a profit?
# It costs you 2,000,000 to build a hovercraft, and you are selling them for
# 3,000,000. You also pay 1,000,000 each month for insurance.

# TASK:
# Determine whether or not you made a profit based on how many of the ten
# hovercrafts you were a le to sell that month.

# INPUT FORMAT:
# An integer that represents the sales that you made that month.

# OUTPUT FORMAT
# A string that says "Profit', 'Loss', or 'Broke Even'.

# SAMPLE INPUT
# 7

# SAMPLE OUTPUT
# Loss

# Explanation
# If you only had 5 hovercrafts, you spent 21,000,000 to operate but only made
# 15,000,000.
def main():
    hc = int(input("Hovercrafts sold: "))
#   hcs = int(hc)
    is_hover(hc)

def is_hover(hcs):
    build = 2000000
    eachhc = 3000000

    ins = 1000000

    a = hcs * eachhc
    spent = (10 * build) + ins

    amtmd = "Amount made: "
    print(f'{amtmd}{a}')

    if a == spent:
        print("Broke Even")
    elif a >= spent:
        print("Profits")
    elif a <= spent:
        print("Loss")

main()

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.