← Back to Week 1 Hub
Workbook 1c — Exercise 3

Basic Calculator

Project name: basic-calculator  |  Workbook p.87

In Plain English

Build a simple calculator. Ask the user for two numbers, show them a menu of math operations, and multiply the two numbers together. Display the result.

What a Successful Run Looks Like
Example Run 1
Enter the first number: 5
Enter the second number: 3

Possible calculations:
(A)dd
(S)ubtract
(M)ultiply
(D)ivide
Please select an option: M

5.0 * 3.0 = 15.0
Example Run 2
Enter the first number: 12
Enter the second number: 7

Possible calculations:
(A)dd
(S)ubtract
(M)ultiply
(D)ivide
Please select an option: M

12.0 * 7.0 = 84.0
What This Exercise Practices
Flow Diagram
Ask for first number
Ask for second number
Show menu
Multiply the numbers
Display result

Workbook 1c, p.87 — Exercises: Basic Calculator (Exercise 3)

← Math Application Payroll Calculator →