08448380779 Call Girls In Civil Lines Women Seeking Men
Lecture_Activities_4.1_to_4.7.pdf.pdf
1. Assessment
Name: Cleofas, Vince Joseph R.__ Year Level: 1st year BSIT
SectionCEIT-37-101P Date: 10-27-21
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,
circumferenceand diameter. Use constant declaration.
Area = pi * radius2
Circumference = 2 * pi * radius
Diameter = 2 * radius
Program Plan
Required Output A program that accept a radius of a
circle and compute its area,
circumferenceand diameter
Available Input Area = A
Circumference = C
Diameter = D
Radius = R
Pi = 3.1416
Processing Requirements A = pi * radius2
C = 2 * pi * radius
D = 2 * radius
Algorithm
1. Start
2. Input R
3. To obtain Area, Use this formula A = pi * radius2
4. To get the circumference, Use this formula C = 2 * pi * radius
5. Calculate the Diameter with the formula D = 2 * radius
6. Print A, C, D
7. Stop
Good Luck!
3. 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 Program that accept two (2) numbers
represented by X and Y. Print the two
numbers after interchanging their values.
Available Input Input X, Y
Processing Requirements Temp = X
X = Y
Y = Temp
Algorithm
1. Start
2. Read X, Y
3. To interchange the value of X to Y, Use this formula Temp = X, X=Y, Y = Temp
4. Print interchanged value of X, Y
5. Stop
5. Lecture Activity 4.3: Flowcharting (SelectionStructure)
Given is GROSS_PAY. Draw a flowchart that will compute for DEDUCTIONS and
NET_PAY for employee’s weeklypayroll. 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 Program that compute for Deduction
and net pay for employees weekly
payroll
Available Input DEDUCTIONS, NET_PAY, GROSS_PAY
Processing Requirements 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
[NET_PAY = GROSS_PAY – DEDUCTIONS]
Algorithm
1. Start
2. Read GROSS_PAY, DEDUCTIONS, NET_PAY
3. Input Civil Status
4. Calculate the Net pay by using the formula NET_PAY = GROSS_PAY –
DEDUCTIONS
5. Print NET_PAY
6. Stop
6. Flowchart
Start
ReadDEDUCTIONS,
NET_PAY,
GROSS_PAY
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
InputCivil Status
NET_PAY= GROSS_PAY– DEDUCTIONS
Print NET_PAY
Stop
7. Lecture Activity 4.4: Flowcharting (SelectionStructure)
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 determininginto which class to place an item.
Program Plan
Required Output A program that determine which class to
place an item depends on the weight
Available Input Wt. = Weight
Processing Requirements CLASS A – 12 pounds or over
CLASS B – 5 to 11 pounds
CLASS C – less than 5 pounds
Algorithm
1. Start
2. Read Wt.
3. Input Wt.
4. Determine the class depends on weight of products.
5. If the item is over 12 pounds then it is CLASS A, If 5-10 pounds then it is CLASS B,
if less than 5 pounds it is belong to CLASS C.
6. Print Class A, B ,C
7. Stop
9. Lecture Activity 4.5: Flowcharting (IterationStructure)
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 Program that convert a given decimal
number (N10) to its equivalent binary
number (N2).
Available Input (N10) = DN
DN = 25
Remainder = r
Binary Number = BN
BN = r
Processing Requirements 25 / 2 = 12 r = 1
12 / 2 = 6 r = 0
6 / 2 = 3 r = 0
3 / 2 = 1 r = 1
1 / 2 = 0 r = 1
Algorithm
1. Start
2. Read BN = r, DN = 25
3. Calculate the DN to get the BN by dividing the given DN = 25 which is the
dividend and 2 is the divisor, until the quotient becomes 0, then the remainders
is considered as the binary number.
4. Print BN
5. Stop
11. Lecture Activity 4.6: Flowcharting (IterationStructure)
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-hoursusedthereafter.Computefor theamount due froma customer after
reading the kilowatt-hours used. Assume that there are 100 records of customers.
Program Plan
Required Output Program that compute for the amount
due from a customer after reading the
kilowatt-hours used.
Available Input Kilowatt-hour = kWh
Amount due
Processing Requirements 300 kWh = P25.00
300 kWh >= P30.00
Algorithm
1. Start
2. Read kWh
3. If the customer has 300 kWh used in a month the charged is P25.00, If the
customer has 300 kWh above used in a month then the charged is P30.00
4. Print amount due
5. Stop
13. 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 The program is to read the cards and
store the proper code in each card.
Available Input Local = Loc
National = Natl
International = Intl
Credit Card = CC
Processing Requirements If credit card is local then 01,
If credit card is national then 02,
If credit card is international then 03.
Algorithm
1. Start
2. Read Loc, Natl, Intl, CC
3. Initialize the CC to its proper code depends on the process requirements
4. Print CC
5. Stop
14. PSEUDOCODE
Initialize Loc to 01
Initialize Natl to 02
Initialize Intl to 03
If the credit card holder resides in metro manila then
Print ‘code is 01’
If the credit card holder resides anywhere in the Philippines then
Print ‘code is 02’
If the credit card holder resides anywhere in the world then
Print ‘code is 03’
Endif
Stop