Multiple Consecutive Operators and Operands

I have an assignment in which I need to pseudocode as it's an intro course. So far this is what I have, but I don't know how I am to write it so it would allow the user to input up to 5 operators and 10 operands consecutively. Anyone care to tip me? Below is what I have. (No external math libs or math lib functions are allowed)

//This will be a calculator program that is menu driven and allows for addition, multiplication, division,
//and exponentiation

//Declare modules
menu()
addition()
subtract()
multiply()
divide()
exponent()

//The main module
Module main()
//Declare variables
Declare Integer answer
Declare Integer memory //Will store temp #s for recall. Must be able to subtract or add to/from variable
Declare Integer menuSelect

//Welcome message
Display “Welcome to the Calculator Program”
Display “What would you like to do?”

//Calls menu
Module menu (menuSelect)
Do
Select menuSelect
Case 1:
Call addition(memory)
Case 2:
Call subtract(memory)
Case 3:
Call multiply(memory)
Case 4:
Call divide(memory)
Case 5:
Call exponent(memory)
End Select
While menuSelect != 6
End Module // Ends Module main()

//The menu module
Module menu (Integer choiceOne)
Declare Integer choiceOne

Display “1.) Add.”
Display “2.) Subtract.”
Display “3.) Multiply.”
Display “4.) Divide.”
Display “5.) Exponent.”
Display “6.) Exit.”
Display “Enter your selection.”
Input choiceOne

While choiceOne < 1 OR choiceOne > 3
Display “Invalid input.”
Display “Please enter 1, 2, 3, 4, 5, or 6.”
Input choiceOne
End Module

//the addition module
Module addition(Integer answer)
//Declares variables for user input
Declare num1

//the subtract module
Module subtract(Integer answer)

//the multiply module
Module multiply(Integer answer)

//the divide module
Module divide(Integer answer)

//the exponent module
Module exponent(Integer answer)
Last edited on
Topic archived. No new replies allowed.