#Need urgent help

54 messages · Page 1 of 1 (latest)

stable stream
#

I have a deadline on this python project today and I'm a little lost. I really do need/want to learn how to code on python but I need this today.

#

1.- Make a Program in python to Calculate the Tip Amount of a Restaurant Bill. Make option is you are going to Pay alone or Split the Charges.
2.- Create a Program in Python to Calculate the Payroll Salary if you work in any Company. Calculate the Retaining amount from the Pay Check for Tax to the IRS, NY State and NY City Local Taxes.
3.- Create a Program in Python to Convert Temperature form C0 to F0 Inch to Centimeter, Pounds to Kilos.
4.- The Program Should have inputs and then the program should calculate the Answers.

#

I have to do only 1 of those

analog lagoon
#

Academic Honesty
We will help you understand your homework, we will help you figure out the solution, we will not give you the answers. For tests and quizzes we can help you with your studying, we can only give you vague nudges in the right direction on quizzes, we will not help with tests.

#

Please show any sort of effort on your part to solve one of the problems.

#

I think 3 is probably the easiest.

stable stream
#

I know how to do the converting option

#

yeah

#

but idk how to make it to where there's multiple functions

analog lagoon
#

Well show us how you'd do one of them.

#

And we can help you work on the others.

stable stream
#

okay one sec

#

so this is F to C or C to F

#

temp = input("Input the temperature you like to convert? (e.g., 45F, 102C etc.) : ")
degree = int(temp[:-1])
i_convention = temp[-1]

if i_convention.upper() == "C":
result = int(round((9 * degree) / 5 + 32))
o_convention = "Fahrenheit"
elif i_convention.upper() == "F":
result = int(round((degree - 32) * 5 / 9))
o_convention = "Celsius"
else:
print("Input proper convention.")
quit()
print("The temperature in", o_convention, "is", result, "degrees.")

analog lagoon
#

Write something that asks the user what they'd like to convert, temperature, distance or weight.

stable stream
#

yeah idk how to do that part

analog lagoon
#

Do you know how to have it ask them?

#

Surely you could use some hints from your program above?

stable stream
#

idk how to have it ask them which function they want

#

like inch to cm or F to C or kilo to pound

analog lagoon
#

Split it up into smaller problems, first ask the user which they'd like to convert.

#

Do that first.

stable stream
#

like how do i make it say

  1. C to F
  2. Kilo to Pounds
#

etc

#

i have 0 idea how to do that

analog lagoon
#

Did you not write the program above?

#

using input?

#

or print?

stable stream
#

i did?

#

but

#

i still dont know how to make it like that

#

cuz i put 2 functions and only 1 can work

#

at a time

#

what function do i need to use so the user can pick between?

analog lagoon
#
string_result = input("1. C <=> F\n2. Kilo to Pounds\nEnter a number: ")
int_result = int(string_result)
print("User entered", int_result}) 
stable stream
#

ohhhhhh

#

okay okay

#

and now i just have to assign the functions to their number right?

analog lagoon
#
if int_result == 1:
    temp = input("Input the  temperature you like to convert? (e.g., 45F, 102C etc.) : ")
    degree = int(temp[:-1])
    i_convention = temp[-1]

    if i_convention.upper() == "C":
        result = int(round((9 * degree) / 5 + 32))
        o_convention = "Fahrenheit"
    elif i_convention.upper() == "F":
        result = int(round((degree - 32) * 5 / 9))
        o_convention = "Celsius"
    else:
        print("Input proper convention.")
        quit()
    print("The temperature in", o_convention, "is", result, "degrees.")
elif int_result == 2:
    # Handle Kilo to Punds
#

Do you have to use functions?

#

like:

#
def mahfunction(stuff):
    print(stuff)
stable stream
#

no its a simple project

#

just a functioning converting system

analog lagoon
#

okok

stable stream
#

just the options function im stuck on

#

my first time ever learning coding so i'm really trying to understand

#

how do i assign the functions?

analog lagoon
#

Just put your code for converting into the if statement blocks.

stable stream
#

i have an appointment so i have to go now but i'll definitely be back because the deadline is in 8h

#

but thank you for the help so far

stable stream