Ask Question
20 August, 18:07

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

+2
Answers (1)
  1. 20 August, 20:46
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers