Thursday, October 11, 2018

Problem Solving (Lab3)

Assalamualaikum and hi guys! Here i come back with new problems, new solution and new knowledge. I hope that you guys still interesting to read my blog. So, here I would like to share the problem solving for Lab 3. So, of course for each problems for every week, there will be different learning outcome we will gain. At the end of this lab task, I would able to trace a program , designing solution to a problem using Problem Analysis Chart (PAC), Input Process Output (IPO) and flow chart. Apart from that, I able to declare, initialize and use appropriate data types in a program and use selection statements to specify alternative paths of program's execution. Not only that, I would able to write, compile and run a simple computer program based on the flowchart.

So lets start!


Question 1: 

This is the first sub-question for Question 1:



Here is the answer for that question:




The second sub-question is:


The solution is :

What I can trace for second sub-question is whenever we put the "/" in front of the coding, the program will not run or print out it. It just a comments.




The last sub-question is:



and the solution for above question is :

The error in typing the above coding is there is missing word of "else" because if we want to compare it is true or false and there will be two different statement, we should put"else".




Question 4:

The problem for question 4 is :



Here is the answer :

I found the error after the sentences "if moonlsYellow", the condition is incomplete. The second one is we no need to declare the "boolean" for two times.



Question 5:



The answer is :

The above question tested me on how to produce word before and after "g".




Question 6:




Answer :



Question 7:





The solution is :



Question 8:



The solution for question 8 is:




Based on my point of view, I feel that the task getting harder and difficult. The question is looking simple but the way to think the solution is really complicated and quite confusing. I don't even know how programming student's thought is look like because I am economic's student. The most tough question I think is Question 7 and Question 8. It is really challenging me!

For each Lab task, there is different problem and level of tough. So stay tuned with me :)

Nursaidatul Sakinah Binti Saharuddin
184881




Enjoy reading my blog!
Feel free to share any fruitful knowledge with me as I am eager to learn something new and we can learn together!

Thank you :)

This is my friend's blog. Check him out!
hongjing96.blogspot.com (lLim Hong Jing )



1 comment:

Problem Solving (Lab6)

Assalamualaikum and hi guys ! Here I come back to share new problems with new solution. Honestly, I do not really understand with questions...