0

Hi everyone, I am working with MARIE and need help with the following: Write the equivalent C++ code in MARIE:

/ cin >> Max;

/ Count = 0;

/ Sum = 0;

/ While (Count < Max){

/ Count++;

/ cin >> Number;

/ cout << Number;

/ if (Number > 0) then

/ Sum = Sum + Number;}

/ cout << Sum;

```
ORG 100
Input
Store Max
Test, Load Count
Skipcond 800
Jump Loop
Loop, Load Count
Add One
Store Count
Input
Output Number
Store Number
Skipcond 000
Jump If
Jump Test
If, Load Sum
Add Number
Store Sum
Output
Jump Test
Halt
Max, Dec 0
Count, Dec 0
One, Dec 1
Number, Dec 0
Sum, Dec 0
```

I keep getting an infinite loop and it is because of my Test, Skipcond, I do not know how to Test for while(count

*Edited
by Ezzaral*: Code format