Problem :

Input should be :

- First digit

- operator (E.g. +, -, *, /)

- Second digit

Output should be :

- Result

Input after Result

- Ask user whether he wants to continue or not ?

Note :

- Solution must contain all 3 types of algorithmic operations

- Solution must contain sub-algorithm for each operation

- Pseudocode should terminate when 'n' is entered

## 8 Replies - 864 Views - Last Post: 27 October 2013 - 12:44 AM

### #1

# We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 12:46 PM

##
**Replies To:** We have to develop 2 versions of Pseudocode for Arithmetic operations

### #2

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 12:56 PM

.. okay - what have you tried?

### #3

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 02:00 PM

modi123_1, on 26 October 2013 - 12:56 PM, said:

.. okay - what have you tried?

Print "Enter First Number"

FirstNumber=Read_Input

Print "Enter an operator"

Operator=Read_input

Print "Enter Second Number"

SecondNumber=Read_input

if operator= "+"

result=FirstNumber+SecondNumber

else operator= "-"

result=firstNumber-SecondNumber

else operator= "*"

result= FirstNumber*SecondNumber

else operator= "/"

result= Firstnumber/secondnumber

Output "your results are "FirstNumber" "Operator" "SecondNumber" = "result"

This is what i wrote, now i need a loop to terminate it on input "n" otherwise keep the program running on entering any integer..also i need to write two versions One version should use Pre-test loop and second version should use Post-test loop. Can you help?

### #4

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 02:02 PM

A while loop that is condition on a character variable that is filled by user input from the console window..

### #5

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 02:04 PM

its a simple Pseudo code in english language, dont have to implement in a program. Can ypu please tell me which loop & where to add it to terminate?

### #6

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 09:00 PM

I did.. I explained it in plain english..

### #7

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 11:03 PM

I asked fot putting alterative operation to repeat the loop, dont know where to put in program.. That is my question.. If it is put in the end, then what will be the condition?

### #8

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 26 October 2013 - 11:27 PM

Input after Result

Note :

- Solution must contain all 3 types of algorithmic operations

- Solution must contain sub-algorithm for each operation

You are not writing code, just saying in English how it should be done.

How would you ask the user if they want to continue or not? How would you check if user entered "n"

**- Ask user whether he wants to continue or not ?**Note :

- Solution must contain all 3 types of algorithmic operations

- Solution must contain sub-algorithm for each operation

**- Pseudocode should terminate when 'n' is entered**You are not writing code, just saying in English how it should be done.

How would you ask the user if they want to continue or not? How would you check if user entered "n"

### #9

## Re: We have to develop 2 versions of Pseudocode for Arithmetic operations

Posted 27 October 2013 - 12:44 AM

Does the book you are using show examples of pseudo code loops? Specifically what you are looking for is using a sentinel in a loop.

Page 1 of 1