Lecture Activities 4.1 To 4.7

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 22

Good Luck!

Assessment

Name: ____________________________________ Year Level: _____________

Section: ___________________________________ Date: ____________________

Lecture Activity 4.1: Flowcharting (Sequence Structure)

Instructions: Create a program plan, an algorithm, and draw a flowchart that uses
sequence structure, that would accept a radius of a circle and compute its area,
circumference and diameter. Use constant declaration.

Area = pi * radius2
Circumference = 2 * pi * radius
Diameter = 2 * radius

Program Plan

Required Output

Available Input

Processing Requirements

Algorithm
Flowchart
Lecture Activity 4.2: Flowcharting (Sequence Structure)

Instructions: Create a program plan, an algorithm, and draw a flowchart that uses
sequence structure, that would accept two (2) numbers represented by X and Y. Print
the two numbers after interchanging their values.

Program Plan

Required Output

Available Input

Processing Requirements

Algorithm
Flowchart
Good Luck!
Assessment

Name: ____________________________________ Year Level: _____________

Section: ___________________________________ Date: ____________________

Lecture Activity 4.3: Flowcharting (Selection Structure)

Given is GROSS_PAY. Draw a flowchart that will compute for DEDUCTIONS and
NET_PAY for employee’s weekly payroll. Consider the following conditions:

If Civil Status = ‘SINGLE’


DEDUCTIONS = GROSS_PAY * 0.03
If Civil Status = ‘MARRIED’
DEDUCTIONS = GROSS_PAY * 0.06
If Civil Status = ‘WIDOW’
DEDUCTIONS = GROSS_PAY * 0.05
If Civil Status = ‘HEAD OF THE FAMILY’
DEDUCTIONS = GROSS_PAY * 0.02

Using the formula:


[NET_PAY = GROSS_PAY – DEDUCTIONS]

Program Plan

Required Output

Available Input

Processing Requirements

Algorithm
Flowchart

Lecture Activity 4.4: Flowcharting (Selection Structure)

A company classifies its products by weight as follows:

CLASS A – 12 pounds or over


CLASS B – 5 to 11 pounds
CLASS C – less than 5 pounds

Show the logic of determining into which class to place an item.

Program Plan

Required Output

Available Input
Processing Requirements

Algorithm
Flowchart
Good Luck!
Assessment
Name: ____________________________________ Year Level: _____________

Section: ___________________________________ Date: ____________________

Lecture Activity 4.5: Flowcharting (Iteration Structure)

Write an algorithm and draw a flowchart that will convert a given decimal number (N10)
to its equivalent binary number (N2).

Program Plan

Required Output

Available Input

Processing Requirements

Algorithm
Flowchart
Lecture Activity 4.6: Flowcharting (Iteration Structure)

An electric company bases its charges on two rates, customers are charged
P25.00 per kilowatt-hour for the first 300 kilowatt-hours used in a month and P30.00 each
for all kilowatt-hours used thereafter. Compute for the amount due from a customer
after reading the kilowatt-hours used. Assume that there are 100 records of customers.

Program Plan

Required Output

Available Input

Processing Requirements

Algorithm
Flowchart
Good Luck!
Assessment

Name: ____________________________________ Year Level: _____________

Section: ___________________________________ Date: ____________________

Lecture Activity 4.7: Design Tools €Pseudocode)

Instruction: Create a program plan, algorithm, flowchart and pseudocode for the
following cases:

A department store classifies its credit card holders as to local, national and
international. A local card holder resides in Metro Manila, a national, anywhere in the
Philippines and an international, anywhere in the world. The programmer must store a
code 01, 02 and 03 for local, national and international card holders respectively. The
program is to read the cards and store the proper code in each card.

Program Plan

Required Output

Available Input
Processing Requirements

Algorithm
PSEUDOCODE

You might also like