Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

The Internet accelerates the process of economic growth. Discuss.

Answered: 1 week ago