Write a program FLOWCHART that lets the user enter a sequence of numbers. The program should stop when it notices that the last two numbers entered were identical. At this point, it should report how many entries were made. For example, the user could enter the following sequence:
44
9
93
94
44
2
44
104
104
after which the program would stop and output 9 (because the user made 9 entries).
Note that the program is not counting distinct numbers entered - if the same number is entered multiple times, it should be counted multiple times. The user should NOT be asked for the length of the sequence in advance. The length of the sequence is up to the user and will not necessarily be a multiple of 3.
Your program may use the following operations:
- Output information (text, numbers, etc.)
- Input a real number, integer, or boolean value
- Store a numeric or boolean value into a variable
- Perform arithmetic operations: add, subtract, multiply, divide, integer quotient, integer remainder
- Perform numeric comparisons: equals, does not equal, less than (or equal to), greater than (or equal to)
- Perform boolean operations: and, or, not
- Make decisions
- Loop (go back to an earlier point in the program)