(January 10, 2018 at 12:13 am)FlatAssembler Wrote: Thanks, SteelCurtain. 15 is the correct answer.
And I agree with you that the tasks are very confusing. Pseudocode itself can be confusing, especially if you didn't go to a high school with informatics as a subject, where the same pseudocode as one on the maturity test is used. Looking at an algorithm you've never seen before and trying to guess what it's doing is very confusing.
My point was a quick study in the basic control structures common to programming languages and how arithmetic is done by a computer should be sufficient to step through problems like these with relative ease.
I merely used a sheet of paper to keep track of the variables as I stepped through each line.
Which part of this problem specifically is confusing to you? Maybe that's a better place to start.
"There remain four irreducible objections to religious faith: that it wholly misrepresents the origins of man and the cosmos, that because of this original error it manages to combine the maximum servility with the maximum of solipsism, that it is both the result and the cause of dangerous sexual repression, and that it is ultimately grounded on wish-thinking." ~Christopher Hitchens, god is not Great
PM me your email address to join the Slack chat! I'll give you a taco(or five) if you join! --->There's an app and everything!<---
PM me your email address to join the Slack chat! I'll give you a taco(or five) if you join! --->There's an app and everything!<---