Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flow1 #10

Open
LAGSMANA opened this issue Aug 21, 2023 · 0 comments
Open

Flow1 #10

LAGSMANA opened this issue Aug 21, 2023 · 0 comments

Comments

@LAGSMANA
Copy link

Sure, I can help you with that! Here's a flow chart for the algorithm you described:

        +---------------+
        |  Start      |
        +---------------+
           |
           |
           v
        +---------------+
        |  Read user input  |
        +---------------+
           |
           |
           v
        +---------------+
        |  Add to sum    |
        +---------------+
           |
           |
           v
        +---------------+
        |  Check if negative|
        +---------------+
           |
           |
           v
        +---------------+
        |  Stop adding     |
        +---------------+
           |
           |
           v
        +---------------+
        |  Write result    |
        +---------------+
           |
           |
           v
        +---------------+
        |  End          |
        +---------------+

And here's the pseudo code for the algorithm:

1. Start
2. Read user input
3. Add to sum
4. Check if negative
5. If negative, stop adding
6. Write result
7. End

Here's a more detailed explanation of each step:

  1. Start: The algorithm begins.
  2. Read user input: The user enters a number.
  3. Add to sum: The entered number is added to a running sum.
  4. Check if negative: The algorithm checks if the entered number is negative.
  5. If negative, stop adding: If the entered number is negative, the algorithm stops adding numbers to the sum.
  6. Write result: The final sum is written out.
  7. End: The algorithm ends.

I hope this helps! Let me know if you have any questions or need further clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant