how to develop an algorithm and pseudocode read 10 integer from the keyboard in the range 0 up to 100 and count how many are larger than 50 and display this result

3 answers

Algorithm:

1. Initialize a counter variable to 0.
2. Create a loop that will read 10 integer inputs from the keyboard.
3. For each integer input, check if it is larger than 50.
4. If it is larger than 50, increment the counter variable.
5. After all 10 inputs have been read, display the value of the counter.

Pseudocode:

counter = 0
FOR i = 1 to 10 DO
read integer input from keyboard
IF input > 50 THEN
counter = counter + 1
END IF
END FOR
DISPLAY counter
how-to-develop-an-algorithm-read-10-integer-from-the-key-board-in-the-range-0-up-to-100-and-count--how-many-of-them-are-larger-than-50-and-display-the-result
Algorithm:

1. Initialize a counter variable to 0.
2. Create a loop that will read 10 integer inputs from the keyboard.
3. For each integer input, check if it is in the range of 0 to 100.
4. If the input is in the valid range, check if it is larger than 50.
5. If it is larger than 50, increment the counter variable.
6. After all 10 inputs have been read, display the value of the counter.

Pseudocode:

counter = 0
FOR i = 1 to 10 DO
read integer input from keyboard
IF input >= 0 AND input <= 100 THEN
IF input > 50 THEN
counter = counter + 1
END IF
END IF
END FOR
DISPLAY counter