SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

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

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 327 Weeks Ago, 4 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 18 May 2017 My Price 8.00

Design a simple Command Line Interface

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

(15)
Status NEW Posted 18 May 2017 08:05 AM My Price 8.00

-----------

Attachments

file 1495095001-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)