Computer Science, asked by tonny1549, 1 year ago

edhesive 2.3 code practice question 2 answers

Answers

Answered by tytylong2004
78

Answer:

a_ft = int(input("Enter the Feet for the first piece of fabric: "))

a_inc = int(input("Enter the Inches for the first piece of fabric: "))

b_ft = int(input("Enter the Feet for the second piece of fabric: "))

b_inc = int(input("Enter the Inches for the second piece of fabric: "))

sum_inc = a_inc + b_inc

# select the whole and the fractional part

inc_to_ft = sum_inc // 12

rem_from_div = sum_inc % 12

sum_ft = a_ft + b_ft + inc_to_ft

print("Feet: {} Inches: {}".format(sum_ft, rem_from_div))

Explanation:

Answered by mindfulmaisel
5

Edhesive 2.3 practice question 2 answers:

Explanation:

def Input_feet_inc():

   feet = int(input("Enter Feet: "))

   inches = int(input("Enter Inches: "))

   return feet, inches

f1, i1 = Input_feet_inc()

f2, i2 = Input_feet_inc()

carry = (i1+i2)//12

print("Feet: {} Inches: {}".format(f1+f2+carry, (i1+i2)%12))

hence, this is the required answer

Similar questions