Question: Problem 1 Write a program that performs the function of a simple integer calculator. This program should ask the user for an operation (including the

Problem 1

Write a program that performs the function of a simple integer calculator. This program should ask the user for an operation (including the functionality for at least addition, subtraction, multiplication, and long division) and after the user has selected a valid operation, ask the user for the two operands (i.e., the integers used in the operation). If the user enters an invalid operation, the program should print out a message telling them so.

Hint: Note that long division of integers requires that you provide both a quotient and a remainder you can refer to https://docs.python.org/3/library/stdtypes.html or lecture notes if you do not recall how to compute the remainder when you divide two integers.

Sample Output-1 (user input highlighted)

(A)ddition

(S)ubtraction

(M)ultiplication

(D)ivision (Long)

Please select an operation from the list above: Vaporize

This program does not support the operation "Vaporize".

Sample Output-2 (user input highlighted) (

A)ddition

(S)ubtraction

(M)ultiplication

(D)ivision (Long)

Please select an operation from the list above: M

Please provide the 1st integer: 3

Please provide the 2nd integer: 5

3 * 5 = 15

Sample Output-3 (user input highlighted)

(A)ddition

(S)ubtraction

(M)ultiplication

(D)ivision (Long)

Please select an operation from the list above: D

Please provide the 1st integer: 16

Please provide the 2nd integer: 3

16 / 3 = 5 with remainder 1

use python

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!