Bootcamp Go Language PT. Phincon Exercise Week 2
These are exercise of what we do on week 2.
My first exercise task was making 3 if statement and switch case, first one must have an arithmetic operators or about calculations, second one must have multiple condition if, and the third one is up to us. So after taking 2 sip of coffee, i decided to make absolute odd subtract calculator 😬. These are the codes of my program:
As we can see together on that calculator there will be no negative value. After making this program, i made an app for odd descending sort calculator, so we can actually get bigger value always in left.
Last but not least, we make a static app to log in, just to make it fast and easy to build and implement if statement with rather complex but easy to build app like this code below:
On switch cases example i made a calculator of 2 variables, picture below shows what i wrote down for that program:
The program i made was for a dynamic input of choice, so we can actually choose between addition, subtraction, multiplication and division. After that i made a program about categorizing what are 2 value are, and which one is bigger. Below are the program that i wrote down:
And last but not least i made a program about switching names that returns the position of people that is listed on PT. Phincon right now, below are the code that i wrote:
After we do exercise about branching, we continue to learn about for loops in Go, and we are making exercise about few things such as this code below:
Output:
Exercise 1 is about loop of 10 to 0 (Descending)
Output:
Code above are code for loop that multiple by five in every iterations.
Output:
This code above is for making matrix using for loops in Go language.
Output:
This code is an exercise for us to make a right triangle that prints their own column.
Output:
The last but not least, we are making right triangle with same concept like previous exercise, but we are making it with every odd row only prints odd number, and as well as even row. thats what we’re making on the exercise.
After doing exercise, i was given a task to make 3 program using for-loops. This code below are my code for every task that i have been given:
Output:
This code is normal code for IT recruitment purposes. that’s why i am making this code, i already do this in every H****rRank test. Thank you H****rRank AHAHAHAHA. Anyways, on the next for i make a calculator program to print out an odd or even numbers iterable with upper and lower limit that is dynamically can change. Below are my code:
Output:
The last program that i made is making dynamic input of square maker (i name it by myself🤣). Below are my source code:
Output:
Thats what i made this week, i hope you guys love to see this and make a fun review about this articles, thanks and see you aroun coders 👋.