Use Python: ----------------------------------- Write a function moronic-calc th
ID: 3802614 • Letter: U
Question
Use Python:
-----------------------------------
Write a function moronic-calc that takes a string consisting of a mathematical expression written in Mo- ronic numerals, such as FFSSEI FIIE and returns the value of the expression in Moronic numerals In the argument you may assume that there is always exactly one space after the first operand, followed by an operator, followed by a space, followed by the second operand. Negation of numbers is also allowed, but with some limitations mentioned below. If a number is negated, then the negation symbol appears immediately to the left of the leftmost numeral. Your calculator must support the following mathematical operators: I Symbol Example Operation Addition FIE -SSSEIII Subtraction -SIE FSSSETII Multiplication FSFEIII /EIII Integer (Floor) Division IIIII EEEEEIII Exponentiation Important notes: Either or both operands could be negative, except for the exponent in an exponentiation operation, which you may assume is positive. You may assume that the result of an operation is in the range -3071,3071], with the exception of zero. If the result is positive, do NOT include a sign in front of it. Finally, you will want to have the moronic-calc function call your arabic2moronic and moronic arabic functions as needed to help solve this problem.Explanation / Answer
Windows has a built-in dialog for changing environment variables (following guide applies to XP classical view): Right-click the icon for your machine (usually located on your Desktop and called “My Computer”) and choose Properties there. Then, open the Advanced tab and click the Environment Variables button.
In short, your path is:
My Computer Properties Advanced Environment Variables
In this dialog, you can add or modify User and System variables. To change System variables, you need non-restricted access to your machine (i.e. Administrator rights).
Another way of adding variables to your environment is using the set command:
To make this setting permanent, you could add the corresponding command line to your autoexec.bat. msconfig is a graphical interface to this file.
Viewing environment variables can also be done more straight-forward: The command prompt will expand strings wrapped into percent signs automatically:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.