Question
Mathematical functions map naturally to program functions and modules often are used to group such functions for reuse. In the Bukiyip* language, coconuts, days and
Mathematical functions map naturally to program functions and modules often are used to group such functions for reuse.
In the Bukiyip* language, coconuts, days and fish are counted in base 3. Numbers use only the digits 0-2, such that instead of "tens" and "hundreds", the second and third digits represents multiples of 3 and 9 respectively.
(Reference: http://mentalfloss.com/article/31879/12-mind-blowing-number-systems-otherlanguages)
Write a Python module called 'bukiyip.py' with the following functions for simple Bukiyip arithmetic, assuming that all values have at most 3 digits.
a) bukiyip_to_decimal (a)
Convert a Bukiyip number to decimal.
b) decimal_to_bukiyip (a)
Convert a decimal number to Bukiyip.
c) bukiyip_add (a, b)
Add two Bukiyip numbers.
d) bukiyip_multiply(a, b)
Multiply two Bukiyip numbers.
Sample I/O:
**** Bukiyip test program ****
Available commands:
d
b
a
m
q : quit
Enter a command:
d 12
110
Enter a command:
b 20
6
Enter a command:
a 12 11
100
Enter a command:
m 12 11
202
Enter a command:
q
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started