Galgao, Zergs - Galvez, Kenneth-LaboratoryExercise01
Galgao, Zergs - Galvez, Kenneth-LaboratoryExercise01
In this activity, you will be given a series of problems surrounding people’s daily activities. You
are to create your interpretation of the problem using flowcharts and pseudocodes. Make your
interpretation as logical and systematic as possible.
At the end of this activity, the students are expected to be able to:
QUESTIONS
1. You are left in charge of taking care of your baby brother. Your mother asked you to
prepare the milk by 9:00 AM. Your father asked you to cook lunch by 11:00 AM. You
need bathe your brother by 3:00 PM. Lastly, at 5:00 PM, you have your scheduled game
with your team. Remember that each activity is time-specific. For the time outside the
specified hours, you are to do nothing but wait.
DCIT 22 – Laboratory Activity 01
Galgao, Zergs B. |“I can do this!”
Galvez, Kenneth B. | “I can do this!”
BSCS 2-2 | September 22, 2021
I was left in charge to take care of my baby brother and was assigned tasks on several times of the day.
Since the tasks are time-specific, I can’t do anything but wait until I reached the time for the next task
DECLARE time
SET time AS GetCurrentTime()
WHILE time !=9:00 AM DO
CALL DoWait()
LOOP
CALL DoPrepareMilk()
SET time AS GetCurrentTime()
WHILE time !=11:00 AM DO
CALL DoWait()
LOOP
CALL DoCookLunch()
SET time AS GetCurrentTime()
WHILE time !=3:00 PM DO
CALL DoWait()
LOOP
CALL DoBatheMyBrother()
SET time AS GetCurrentTime()
WHILE time !=5:00 PM DO
CALL DoWait()
LOOP
CALL DoGameWithMyTeam()
END
2. You were given five cubes and you were tasked by your Physics course instructor to
determine the one cube that weighs greater than the rest. Four of the cubes have the
same weight. You are only given to chances to weigh a set of cubes. After the second
weigh, you need to accurately discern the one cube that weighs more.
[Hint]
➢ To weigh the five cubes only up to two times to determine whichone weighs
more, you will need to weigh for the 1st round four cubes by twos and leave one
cube aside.
➢ If the two parts of weighed cubes are equal, then the cube we need to determine
is the fifth cube – the one we set aside.
➢ If not, then one of the four cubes we weighed is the one we need. To do this, we
will disregard the pair that weighs lesser and focus on the pair that weighs more.
We will weigh that pair for our 2nd round, and the cube that weighs more than the
other is the cube that we need.
DCIT 22 – Laboratory Activity 01
Galgao, Zergs B. |“I can do this!”
Galvez, Kenneth B. | “I can do this!”
BSCS 2-2 | September 22, 2021
DECLARE Weight
SET A AS GetWeightCube1+Cube2()
SET B AS GetWeightCube3+Cube4()
IF A = B THEN
OUTPUT Cube5
ELSE IF A > B THEN
IF Cube1 > Cube2 THEN
OUPUT Cube1
ELSE
OUTPUT Cube2
ELSE IF B > A THEN
IF Cube3 > Cube4 THEN
OUPUT Cube3
ELSE
OUTPUT Cube4
END
DCIT 22 – Laboratory Activity 01
Galgao, Zergs B. |“I can do this!”
Galvez, Kenneth B. | “I can do this!”
BSCS 2-2 | September 22, 2021
3. You are to travel to Palawan for a beach escapade. Since you are going, you need a
set of materials for the trip. List down all the items you need, create a checklist
beforehand, determine whether you already have each of the items, and buy the items
you do not yet have. Indicate at least 5 items.
DCIT 22 – Laboratory Activity 01
Galgao, Zergs B. |“I can do this!”
Galvez, Kenneth B. | “I can do this!”
BSCS 2-2 | September 22, 2021
DCIT 22 – Laboratory Activity 01
Galgao, Zergs B. |“I can do this!”
Galvez, Kenneth B. | “I can do this!”
BSCS 2-2 | September 22, 2021
DECLARE ListofItems
SET ListofItems AS PutItemOnAChecklist()
IF NOT HaveSunscreen THEN
Call DoBuyItem(Sunscreen)
CALL DoCheckItemOnChecklist(Sunscreen)
IF NOT HaveSwimsuit THEN
Call DoBuyItem(Swimsuit)
CALL DoCheckItemOnChecklist(Swimsuit)
IF NOT HaveBeachBag THEN
Call DoBuyItem(BeachBag)
CALL DoCheckItemOnChecklist(BeachBag)
IF NOT HaveSunglasses THEN
Call DoBuyItem(Sunglasses)
CALL DoCheckItemOnChecklist(Sunglasses)
IF NOT HaveCamera THEN
Call DoBuyItem(Camera)
CALL DoCheckItemOnChecklist(Camera)
END