Computer Science, asked by KAgu0425, 6 months ago

Write a program that inputs the length of two pieces of fabric in feet and inches (as whole numbers) and prints the total.

Sample Run
Enter the Feet: 3
Enter the Inches: 11
Enter the Feet: 2
Enter the Inches: 5
Sample Output
Feet: 6 Inches: 4

Answers

Answered by valeriy69
0

\small\mathsf\color{pink}{Solution\: using\: python\: 3}

fabric_1_feet = int(input("Fabric 1 feet: "))

fabric_2_feet = int(input("Fabric 2 feet: "))

fabric_1_inches = int(input("Fabric 1 inches: "))

fabric_2_inches = int(input("Fabric 2 inches: "))

feet_sum = fabric_1_feet + fabric_2_feet

inches_sum = fabric_1_inches + fabric_2_inches

feet_total = feet_sum + (inches_sum // 12)

inches_total = (inches_sum % 12)

print(f"Feet: {feet_total} Inches: {inches_total}")

\small\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions