Great job(ish). You're understanding the mnemonics. That's a great thing! The logic part maybe not so much. In Engineering the best way to approach a subject is take a large problem and break it down into smaller problems. You'll hear that a lot....
Let's look at one of the smaller parts you have written.....
for i in 1...10_000 {
let powerOfTwoResult = i * i
if firstNum < 1 || firstNum > 10_000 {
throw squareError.outOfBounds
If you stand back and really think about what you are actually doing here then you'll probably think oh bloody hell, what was I thinking?.....
If not let's look at what you're actually doing.
You are executing a for loop.....
for i in 1...10_000 {
Meaning this part and everything in the loop will loop 10000 times.....
if firstNum < 1 || firstNum > 10_000 { throw squareError.outOfBounds
Meaning you are checking that your firstNum is less than 1 or greater than 10000..... That's great and all, but you are checking it/the same thing ten thousand times, where you should only need to check it once before you return the verdict. How to correct that.....I think you'll figure it out now that you have direction.
I would not dwell on this too much though...If at all, because through the course and doing more of logic and code you'll get a lot better and if you actually "return" pardon the the pun! To some of these starter checkpoints later on you will be doing them with your eyes closed.
Lastly make sure you use a catch all errors so that you can give the user a pleasant message. I often think about putting in a mission impossible theme tune when that happens, but that's just me/my preference. A picture of a fluffy white dog with an "Oops no treats for you" message might be good thing as well.
Keep going you'll do great!