Hello people☺!!! Its a pleasure
to meet you all after a very long break. How have things been going ? Hope you
guys doing really really good over there. Alright guys its time to back to our
weekly routine to discuss about the Lab Assignment 7, whoooaa... This time we
have learned about Loops.
There are many
categories of loops such as while loops, for loops, do-while loops and also
nested loops. For you guys to more
understand loops is a instruction that is continuously repeated till it reach a certain condition. This week's lab contain 10 questions which need to be solved. Starting from first question we need to just show output for given code. I found that easy so there is no complaint about it :D. Second question need to trace the program by showing the values for each variable and write the output. Question 3 and 4 is simple cause its just about the loop writing for given code.
Question 5 is quite tricky cause it was divided into two that must convert given code for loop statement to a while and do-while loop.
After this I found question 9 was difficult. As usual I stucked here but managed to complete it with the guidance of my friends. This question I need to write a program that plays the popular rock-paper-scissor game. Actually the coding was quite lengthy that's why it was really tough for me. Luckily I've completed to run the program at last...☺☺
Finally the last tenth question also took sometime to solve it. I need to find the minimum point on the function f(x) = ( x – 2 ) 2 + 1 where x = [-1, 0, … , 4] using random optimization.
So yeah that is all for this week my dear friends. Even though things getting harder still I could manage to do my assignment with the guidance of my friends and my lecturer. You know self belief and hard work always earn you success. Till we meet next week with the new Lab assignment questions , take care..❤❤❤
THANK YOU FOR READING !!!
Pritah D/O Subramaniam (185797)
Next blog : yanhua0112.blogspot.com