Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Activity 3: 10 points Write a program called SimpleCalculator. This program will display a menu of two options: add two numbers or subtract two numbers.

image text in transcribed
Activity 3: 10 points Write a program called SimpleCalculator. This program will display a menu of two options: add two numbers or subtract two numbers. The user will pick an option. If the user doesn't pick one of the options, ask the user to enter in a valid option. If the user picks addition, you will ask for two numbers. The first number must be even and must be greater than O and the second number must be divisible by 10 and greater than 100. Continue to ask for each number until both satisfy the requirements. Then output the sum of those two numbers with the label: Sum is: . If the user picks subtraction, ask the user to enter in two numbers. The first number must be a multiple of the second number and both numbers need to be positive. Continue to ask for each number until both satisfy the requirements. Then output the difference (larger number smaller number) to the screen with the label: "The differencelis: ". After the user completes the option, ask if the user wants to run the program again. If he/she enters "yes" or Yes", the program will run again Example 1. Addition 2. Subtraction Enter the number of the option you would like: 3 Invalid choice Enter the number of the option you would like: 1 Enter the first number (even and greater than 0): -2 Not valid Enter the first number (even and greater than O): 2 Enter the second number (divisible by 10 and greater than 100): 110 Sum is: 112 Run again (yes/Yes)? yes 1. Addition 2. Subtraction Enter the number of the option you would like: 2 Enter your two numbers (both need to be positive and first number is a multiple of the second): 12 7 Invalid Enter your two numbers (both need to be positive and first number is a multiple of the second): 12 3 The difference is: 9 Run again (yes/Yes)? no Submission

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

Records And Database Management

Authors: Jeffrey R Stewart Ed D, Judith S Greene, Judith A Hickey

4th Edition

0070614741, 9780070614741

More Books

Students also viewed these Databases questions