Tutorial Hell
It may not sound like much, but it’s a real headache especially for me, I learnt how to: Iterate, declare variables, etc. After that? My huge ego was bigger, I went around telling people I can code, I mean I can but Can I? I’ve sat there after watching these tutorials with all this information but to do what with it was a mystery. That marked my arrival in tutorial Hell.
So here lies the premise (fancy fancy word) of the post my new journey to tutorial heaven? That doesn’t sound right, but I’ll find the right word.
This is how
I’m going to go about it, instead of just watching and bumming, I’m watching
and doing.
So this is
officially Day 1 of escaping Tutorial Hell, NB. Today doesn’t mean Today. This
was typed on MS word on the 14th of April. TO be uploaded whenever I
end up on the campus Wi-Fi, Yes we are very poor here and can’t afford data (this
is a lie, I just blow my data in a week, I think Econet has beef with me).
So we start
with a calculator. To those of you who did CS in IGCSE screaming “Oh but you’re
in University, you can’t be doing such a simple thing” Shhh, my blog so I do
what I want. I’m playing I’m playing, but the reason I’m starting with this is
because I thought of a twist. My calculator is going to find the root of things
too.
Let’s
start, this is about to get technical. Get your pc, and learn how to code while you’re
at it
So I
created a function called “Calculate” and then created a variable called ctype
which stands for calculation type. The
variable gets assigned an input from the user hence the stuff after the equals
sign. On the prompt screen (Console it would Look like this.)
Noice:D
So Let’s
start with the addition, the variables are localized so you seeing Num1 in add
and subtract won’t affect anything.
Of course
it works, IT IS I. So the next snaps will be for the other options:
Now to the
final part of the calculator, the twist. Finding the root of the number. My
logic for this was as follows
So
yeahhhhhh, now we have this
Ah, yess. I
am inevitable. That’s all for today folks
12313132345542345324353B3535464343424343576


















Comments
Post a Comment
Say something Diego!