Pseudo Code Generator

User Input Total Calculator

This pseudo code outlines a program that collects up to 100 integers from users, ensuring they fall between 1 and 299, sums those greater than 20, and outputs the total.


Empty image or helper icon

Prompt

DECLARE ListA : ARRAY [1:100] OF INTGER

DECLARE Total , Count : INTGER

Total←0

FOR Count←1 TO 100

REPEAT

OUTPUT "PLZ ENTER A NUMBER"

INPUT ListA[Count]

UNTIL ListA[Count]>0 AND ListA[Count]<300

IF ListA[Count] > 20

THEN

Total←Total+ListA[Count]

ENDIF

NEXT Count

OUTPUT " Your total is", Total

Answer

Pseudo Code for User Input and Total Calculation

Variable Declaration

DECLARE ListA : ARRAY [1:100] OF INTEGER
DECLARE Total : INTEGER
DECLARE Count : INTEGER

Initialization

Total ← 0

Input Loop

FOR Count ← 1 TO 100
    REPEAT
        OUTPUT "PLEASE ENTER A NUMBER"
        INPUT ListA[Count]
    UNTIL ListA[Count] > 0 AND ListA[Count] < 300

Total Calculation

    IF ListA[Count] > 20 THEN
        Total ← Total + ListA[Count]
    ENDIF
NEXT Count

Output Result

OUTPUT "Your total is", Total

Summary

  1. Input Collection: The program collects up to 100 valid integers from the user, ensuring each number is between 1 and 299.
  2. Condition Check: It checks if the entered number exceeds 20.
  3. Total Calculation: The program sums those valid numbers that are greater than 20.
  4. Result Output: Finally, it outputs the calculated total.

This pseudo code provides a structured approach to implement the desired functionality while ensuring clarity and understanding.

Create your Thread using our flexible tools, share it with friends and colleagues.

Your current query will become the main foundation for the thread, which you can expand with other tools presented on our platform. We will help you choose tools so that your thread is structured and logically built.

Description

This pseudo code outlines a program that collects up to 100 integers from users, ensuring they fall between 1 and 299, sums those greater than 20, and outputs the total.