Programming Bazar
Programming Bazar
Choose 2 and write an algorithms and pseudocodes for the following problems:
1. Computing for the Perimeter of a Rectangle using the formula Perimeter is twice the width
and twice the length.
2. Identifying if a person can already register as a voter in the Philippines.
3.Your favorite Board or Card Game.
ANSWERS:
ALGORITHM PSEUDOCODE
HOW TO PLAY TONG ITS
BEGIN
STEP1. Display a set of 52 poker cards. OUTPUT “a set of 52 poker cards”
STEP3. The Banker (b) shuffles the cards. OUTPUT “b shuffles the cards”
STEP4. Banker (b) distributes the cards
alternately. OUTPUT “b distributes the cards alternately”
STEP 5. The Banker (b) receives 13 cards. OUTPUT “b receives 13 cards”
STEP 6. While the player 1 (a) and player 2
(c) will receive 12 cards. OUTPUT “a and c receive 12 cards”
STEP 7. The banker (b) will be the first to
drop 1 card. OUTPUT “b first to drop 1 card”
STEP 8. Player 1 (a), player 2 (c) and Banker
(b) will follow drawing the cards on the deck. IF “a, c and b drawing the cards on the deck”
STEP 9. Player 1 (a), player 2 (c) and Banker
(b) could follow drawing the cards on the IF “a, c and b could follow drawing the cards
dump cards. on dump cards”
STEP 10. The lesser value of left cards will
OUTPUT “a, c and b show all their cards”
be the winner.
END
ALGORITHM PSEUDOCODE
BEGIN
He/she must be a citizen of the Philippines. citizen of the Philippines
have voter’s ID
END