---
# System prepended metadata

title: 'Unit 5: Lesson 1 - Calculator Program'
tags: ['''22-''23']

---

# Unit 5: Lesson 1 - Calculator Program

# Instructions  

Read the sections below for an example of how to plan for your program's functionality to meet its purpose.

## Program Purpose

 The purpose of my program is to calculate the result of 5 mathematical operations for users.

## Program Function

1. To calculate the result of 5 mathematical operations, the program uses a function with a parameter named `operationCount`. Inside this function, there is a for loop. This loop runs `operationCount` times. Inside this loop, the user is asked to choose an operation from 5 options `add, subtract, multiply, divide, modulus`. The user's choice is stored in a variable `operation`. After this, there is a conditional statement based on the value of `operation`
	- If `operation` is equal to add, the program asks the users to enter two operands, finds their sum, and outputs this sum.
   - Else, if `operation` is equal to subtract, the program asks the users to enter two operands, finds their difference, and outputs this difference.
   - Else, if `operation` is equal to multiply, the program asks the users to enter two operands, finds their product, and outputs this product.
   - Else, if `operation` is equal to divide, the program asks the users to enter two operands, finds their quotient, and outputs this quotient.
   - Else, if `operation` is equal to modulus, the program asks the users to enter two operands, finds the remainder of their division, and outputs this remainder.
   - Else, if `operation` is not equal to any of the above, the program alerts the user of this and the user is again asked to select an operator.