lease do this in Python: TEXT-BASED CALCULATOR PROJECT  OPERATION CONTROLS '+' for addition '-' for subtraction '*' for multiplication '/' for division 'r' or 'R' to find the square, cube, etc. root (entered as an integer) 'x' or 'X' to take to a power of x '(' and ')' to establish order of precedence '=' to perform the calculation entered 'e', 'E', 'q', or 'Q' to exit the Calculato

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter1: Fundamentals Of C++ Programming
Section1.3: Preliminary Three: Software Development
Problem 7E: (Statistics) This is the formula for the standard normal deviate, z, used in statistical...
icon
Related questions
Question

Please do this in Python:

TEXT-BASED CALCULATOR PROJECT  OPERATION CONTROLS

  • '+' for addition
  • '-' for subtraction
  • '*' for multiplication
  • '/' for division
  • 'r' or 'R' to find the square, cube, etc. root (entered as an integer)
  • 'x' or 'X' to take to a power of x
  • '(' and ')' to establish order of precedence
  • '=' to perform the calculation entered
  • 'e', 'E', 'q', or 'Q' to exit the Calculator

USER EXPERIENCE

  • Must display the message "Welcome to the Text-Based Calculator" when program begins.
  • Must display the message "Thank you for using the Text-Based Calculator" when program exits.
  • Must display the prompt "Input: " to solicit user input.
  • User input must be terminated with an '=' sign.
  • Spaces must be ignored, if present.
  • Operations are performed left-to-right in the order they appear.
  • Must show entire line to be computed along with the result after the '=' sign.
  • Output line must be properly formatted to show spacing between numbers and operators.
  • Integer candidate values must display as integers (i.e. 5.0 displays as 5).
  • Floats must display to the minimum necessary precision (i.e 5.55000 displays as 5.55).
  • Arithmetic errors such as 'divide-by-zero' must be intercepted and reported.
  • Syntax errors such as consecutive operators or invalid terms must be intercepted and reported.

CODE REQUIREMENTS

  • Your code must include at least one private variable.
  • Your code must include at least one function.
  • Your code must include at least one 'while' statement.
  • Your code must include at least one 'for' statement.
  • Your code must include at least one 'if/else' statement.
  • Your code must include at least one 'list' and/or one 'dictionary'.
  • Your code must include at least one 'try/except' block.
  • Your code must not exceed 150 lines in total.

 

 

 

 

PROGRAM EXECUTION EXAMPLE

Welcome to the Text-Based Calculator
 
Input: 2+ 3 *4/ 5+24 =
2 + 3 * 4 / 5 + 24 = 28
Input: 2+(3*4)/5+24=
2 + ( 3 * 4 ) / 5 + 24 = 26.8
Input: Q
 
Thank you for using the Text-Based Calculator
 
ron@Mac ~ %

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Knowledge Booster
Program on Numbers
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage