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
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
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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 |
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 6 steps with 3 images
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education