hi everyone, long time no see! but don't you dare think i just layed in bed and let my worthy time waste away (i did that the week before) !!! i actually had my first official (paid:o) internship week and slowly but surely i will guide your through my time there and show u all of the exercises i did!
i hope it might help a few of u and if u want to, feel free to try some of those exercises yourself!!
!!!! I just really have to add: i'm not the best at explaining and generally, when explain my code on this blog, i actually try to explain it to myself! if you don't understand what i'm talking about or if you think something is wrong, pls feel free to hmu and tell me about it:)
after getting to know the language itself and giving myself an overall understanding of it, i started with my first task:
Let your program print out every number from 1-100. If the number is dividable by 3, the program has to print "Fizz" instead of the number. If it is dividable by 5, it has to print "Buzz". If both (dividable by 3 & 5) apply, it has to print "FizzBuzz".
(if i explain smth wrong or if you know easier ways to solve that task, please feel free to comment or text me! i'm more than open for help!)
Well that's how i did it:
first off i went and created an integer variable "num" with the value 100
i built a for loop starting from 0 on and told the program to keep going until it went up to 100 ("<=" means i want it to stop at exactly 100, "<" would end at 99)
inside of the for loop i put a few if statements in
the 1st if tests whether the current number is dividable by 3 and 5
here i put "if (i % 5 == 0 && i % 3 == 0)"... why?
-> "i" is the variable for the number that is "being tested" rn. We want to find out whether it is dividable by 5. For that we use "%".
This means, let's say i=2. How often does 2 fit into 5? 2 times. This results to 4 (2+2=4, another 2 won't fit into 5). now 5-4=1 soooo 2 % 5 == 1. 1 is the rest.
So , back to my code: to find out if "i" is dividable by 5, i%5 has to be equal to 0. If i%5 has any rest, it means that it is not dividable by 5. Same with 3 ofc.
The && here just means "and".
so.. long story short: IF "i" is dividable by 5 AND 3 print "FizzBuzz" (instead of "i") and go on to the next number. if it is not, go into the next if statement
the next "else if" statements say: if it is not dividable by 5 AND 3, is it dividable by 3/ 5 only? IF yes, print "Fizz"/ "Buzz" and keep going with the next number, else: go into else statement
the last else statement says: if you didnt apply to the first few if statements, just print "i"
.. well and that's about it:) programming this one was really fun and i enjoyed sound it so much ahh🩷🩷🖤
ughhh that PHP todo-list is driving me insaaaane! the people at my internship are really nice and helpful, tho my social anxiety is not really good at asking for help and i keep trying to do most of it myself. yesterday i did not get any further, there was no way for me to ever think of any type of succes. today, tho, i finally connected the mySQL database to my PHP index and i can actually add to dos, give them priorities, a date and check them off as "done":))
i am really proud of that and tomorrow i will try to insert a "delete" button to delete tasks, maybe i'll have some time and add some CSS to it to make it a bit prettier:) i'll see what i can doooo aghhh everytime i go home my brain is smoking tho it is really fun to try out new things and test things out!!
i've been playing around with my first official website yesterday and today i actually spent all day sleeping.
the rest of the time i've played subway surfers and watched chainsaw man, absolutely dissatisfying day but i needed a moment off right before my internship at this coding job i'd love to be in!! they pay me to learn coding and that would be my absolute dream<3 so if everything turns out great after the internship they might take me?? i hope so aghhh