0% found this document useful (0 votes)
89 views8 pages

Galgao, Zergs - Galvez, Kenneth-LaboratoryExercise01

The document contains instructions for a laboratory activity involving solving problems through algorithms, pseudocode, and flowcharts. Students are given 3 problems to solve: 1) completing time-specific tasks for a baby brother, 2) determining which of 5 cubes weighs more using 2 weighings, and 3) creating a checklist for items needed for a beach trip. The intended learning outcomes are to discuss problem implications, create logical flowcharts, and write equivalent pseudocodes.

Uploaded by

Jong Suk Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views8 pages

Galgao, Zergs - Galvez, Kenneth-LaboratoryExercise01

The document contains instructions for a laboratory activity involving solving problems through algorithms, pseudocode, and flowcharts. Students are given 3 problems to solve: 1) completing time-specific tasks for a baby brother, 2) determining which of 5 cubes weighs more using 2 weighings, and 3) creating a checklist for items needed for a beach trip. The intended learning outcomes are to discuss problem implications, create logical flowcharts, and write equivalent pseudocodes.

Uploaded by

Jong Suk Lee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

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

Republic of the Philippines


CAVITE STATE UNIVERSITY
Bacoor City Campus
SHIV, Molino VI, City of Bacoor

DEPARTMENT OF COMPUTER STUDIES

Bachelor of Science in Computer Science

DCIT 22: COMPUTER PROGRAMMING 1


(FUNDAMENTALS OF PROGRAMMING) - LABORATORY

LABORATORY 1: PROBLEM SOLVING THROUGH ALGORITHM OR


PSUEDOCODE AND FLOWCHART (GROUP)

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.

INTENDED LEARNING OUTCOMES

At the end of this activity, the students are expected to be able to:

1. Discuss the implications of the given problems;


2. Create flowcharts following a logical interpretation of the given problems; and
3. Write pseudocodes equivalent to your flowchart interpretation.

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

Understanding of the Problem #1:

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

Flowchart for Problem #1:


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

Pseudocode for Problem #1:

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

Pseudocode for Problem #2:

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

Pseudocode for Problem #3:

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

4. What can you conclude from this activity

We have learned on how to create pseudocodes and be more familiar in using


flowchart symbols. Pseudocode and flowcharts help students / programmers like us to
plan and describe the proposed program. Pseudocode and flowcharts helps us also to
determine the underlying algorithm or describe a system in terms of an algorithm. We’re
looking forward to learning more of these in the future.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy