Question: in python Part 1: Arabic Numerals Wolfie Numerals Converter (20 points) You've heard of Roman numerals, but have you heard of Wolfie numerals? Probably not



in python
Part 1: Arabic Numerals Wolfie Numerals Converter (20 points) You've heard of Roman numerals, but have you heard of Wolfie numerals? Probably not because we've invented them for this lab assignment. Wolfie numerals are similar to Roman numerals in that numbers are formed by combining symbols and adding the values. In Wolfie numerals, each numeral has a fixed value representing a power of 8 (rather than a power of 10 or half of a power of 10, as in Roman numerals) Svmbol: IE S 18 64 Value: In addition, there are also symbols representing the halved powers of 8. A complete list of Wolfie numerals is given below: FE TS 1 48 32 | 64 Symbol: Value: Symbols are placed from left to right in order of value, starting with the largest. For example, EFII is 14: (8 x 1) +(4 x 1)(1 x 2) 8+4+2-14 Note: You may want to review (or learn) the rules for the Roman numerals to better understand this assignment. In a few specific cases, to avoid having three or more characters being repeated in succession (such as III or EEE), subtractive notation is used, meaning that a smaller number is listed before the bigger value, as in this table: (8-1) 24 (32-8) 56 (64-8) IE Notation: IF ET ES For example, with these subtractive notations, instead of writing 7 as 4+1+1+1 (FIII), you must write it as 8-1 (IE), to shorten the numeral sequence. Thus, there must never be more than two instances of a single symbol next to each other in a Wolfie numeral. Also, only the numerals that are powers of 8 can be repeated. Moreover, it is disallowed for a symbol to be used in an additive manner after it has been used in a subtractive manner. To see why this is true, consider Roman CSE 101 -Fall 2017 Lab #9 numerals for a moment. CXC (190) is valid because C is used first in an additive way and then in a subtractive way. But XCXX is invalid because X is first used in a subtractive way and then in an additive way. In Wolfie numerals, examples of analogous invalid cases would be expressions like IFII, ETE and ESEE Based on the rules described above, an updated table of the numerals can be described as below: Symbol: Value: Max # of Appearances: 8 2432 56 Write a function arabic2wolfie that takes one argument, num, which is an Arabic numeral that you will need to convert to the Wolfie numerals. Your function should return the Wolfie numeral as a string. Note: You will only be given num in the range [1, 63] (inclusive of both). Below are some examples to help you understand. Keep in mind that you want the sequence to be as short as possible while following the numeral rules. Example #1: num = 10 Look from the larger Wolfie numerals to the smaller numerals. What is first value you can subtract? It's 8. Now you have 2 left to worry about, and the only applicable value is 1. Since 1 can appear twice, we have two 1's
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
