Ask Question
25 February, 20:19

A cubit is an ancient unit of length, roughly the distance between one's fingers and elbow. The definition of one cubit is 18 inches. Write a program consisting of one script and one function. The script does the following: ▪ prompts the user for the number of cubits ▪ calls a function cubit2inch to convert this number to inches ▪ prints the result

+1
Answers (1)
  1. 25 February, 23:54
    0
    def cubit2inch (c) : inches = c * 18 print (inches) cubit = int (input ("Enter number of cubits: ")) cubit2inch (cubit)

    Explanation:

    The solution code is written in Python 3.

    Firstly, write a function cubit2inch that takes one input parameter, c. In the function, apply the formula to convert the cubit to inches and print it (Line 2 - 3).

    In the main program, we prompt user to input number of cubits and convert it to numerical and assign it to cubit variable (Line 5). Call the function to print the converted inches (Line 6).
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “A cubit is an ancient unit of length, roughly the distance between one's fingers and elbow. The definition of one cubit is 18 inches. Write ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers