i'm really struggling with this pseudocode to convert it to MARIE
Input a number
Assign this number to x
if(x <y)
x = x + y;
z=z+w;
else
y=y-w;
Print the value of the accumulator.
x, Dec 0
y, Dec 2
z, Dec 5
w, Dec 1
i'm really struggling with this pseudocode to convert it to MARIE
Input a number
Assign this number to x
if(x <y)
x = x + y;
z=z+w;
else
y=y-w;
Print the value of the accumulator.
x, Dec 0
y, Dec 2
z, Dec 5
w, Dec 1
This reads like a typical assignment so I'll only note that I would definitely use the JUMP ELSE somewhere in my solution.
Again, I can't provide code since that would be doing your homework.
is this correct
Load x
Subt y
Skipcond 800
Jump Else
If, Load x
Add y
Store x
Output x
Clear
Laod z
add w
store z
Output z
Else, Load y
subt w
store y
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.