Question: no functions Create a calculator that can add, subtract, multiply or divide depending upon the input from the user, using loop and conditional statements. After
no functions
Create a calculator that can add, subtract, multiply or divide depending upon the input from the user, using loop and conditional statements. After each round of calculation, ask the user if the program should continue, if ' y ', run your program again; if ' n ', stop and print 'Bye'; otherwise, stop and print 'wrong input'. Sample run 1: Select operation: 1. Add 2. Subtract 3. Multiply 4. Divide Enter choice (1/2/3/4):3 Enter first number: 15 Enter second number: 14 1514=210 Do you want to do another calculation (y)?n Bye Sample run 2: Select operation: 1. Add 2. Subtract 3. Multiply 4. Divide Enter choice (1/2/3/4): 2 Enter first number: 15 Enter second number: 14 1514=1 Do you want to do another calculation (y) ? y Select operation: 1. Add 2. Subtract 3. Multiply 4. Divide Hints: Make an infinite loop with a stopping criterion
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
