Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please dont forget do indent ! Last post was missing indents. Also please just use while loop for this one. Nothing fancy just simple code

Please dont forget do indent ! Last post was missing indents. Also please just use while loop for this one. Nothing fancy just simple code
image text in transcribed
Python please. Simple coding nothing fancy this is just a Second level class. Please show screenshot of code running. Thank you so much! Topies: class, object, instantiation, methods Problem Statement In this lab, you will design a very simple calculatora purpose of this assignment is to gain experience in basic OOP concepts The Problem Scenario: You would ask two user input a and b using your favorite input function. Then the program should display a menu that is similar to a calculator application. The operations that need to be implemented are 1) addition, 2) multiplication, 3) subtraction, 4) division and 5) power function. You can choose to implement your own power function or you can use the built-in functions in the standard module. The menu should have an exit option to exit the program and user can choose to stay in the application until s/he decides to leave the application. Proper documentation for each of the methods and exception handling are required. For example: your program should be able to handle zero division operation or any non-numeric number like string values Design your solution: Class Definition You need to design a class named "Calculator To design your class, you can take the following approach: Write down a description of your problem (what should the problem do?). Underline all the nouns verbs, and adjectives. For example: A Calsulator application which is able to add uhtract divide multinlzand perform gxponential (user choice) on two user numbers 1. 2. Go through the nouns, these are potential classes: Calculator Go through the verbs, they are potential methods: add, subtract etc. You also need to define init andstrmethod and any other additional method you need Go through the inputs and output, looking for potential attributes: user inputs, kind of operation and result Allocate methods and attributes to your classes 3. 4. You can write a simple main function to create your menu and object. A sample object creation can be as:c Calculatorfx, y, +") where xy user numbers and is the operation to be performed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts International Edition

Authors: David M. Kroenke

6th Edition International Edition

0133098222, 978-0133098228

More Books

Students also viewed these Databases questions