ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 12 May 2017 My Price 8.00

Design a simple Command Line Interface (CLI)

Design a simple Command Line Interface (CLI) calculator that performs six (6) basic arithmetic operations: addition, subtraction, multiplication, division, modulo and exponentiation. You shall implement your design in Python and name the file simplecalc.py. It shall work like this:

$ python simplecalc.py

 

<result>

For example, 

$ python simplecalc.py add 5 7

12 

Be mindful of implicit type casting and always ensure the accuracy of the program’s operations. You may use the strings “add”, “sub”, “mul”, “div”, “mod” and “exp” to represent the operators. Maintain precision to 3 decimal places where necessary, i.e. 22/7 should result in 3.143. 
Include error handling code in your program so that it displays an appropriate message. For instance, in case a user supplies non-numeric operands or if the result is outside of Python’s range (find these limits).


Your program should meet the PEP 8 (pycodestyle) conventions as a minimum. It should also have helpful comments. Write a short one-or-two paragraph description (user manual) of your program in the comments at the beginning of your code. 

Answers

(11)
Status NEW Posted 12 May 2017 01:05 AM My Price 8.00

-----------

Not Rated(0)