#Need urgent help
54 messages · Page 1 of 1 (latest)
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
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.
I know how to do the converting option
yeah
but idk how to make it to where there's multiple functions
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.")
Write something that asks the user what they'd like to convert, temperature, distance or weight.
yeah idk how to do that part
Do you know how to have it ask them?
Surely you could use some hints from your program above?
idk how to have it ask them which function they want
like inch to cm or F to C or kilo to pound
Split it up into smaller problems, first ask the user which they'd like to convert.
Do that first.
i dont think u understand what i'm trying to say
like how do i make it say
- C to F
- Kilo to Pounds
etc
i have 0 idea how to do that
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?
string_result = input("1. C <=> F\n2. Kilo to Pounds\nEnter a number: ")
int_result = int(string_result)
print("User entered", int_result})
ohhhhhh
okay okay
and now i just have to assign the functions to their number right?
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)
okok
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?
Just put your code for converting into the if statement blocks.
oh okay
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
@analog lagoon Hello, so I changed my mind and decided to go with the 1st one on this list