I. Programming. Draw A Complete Flowchart

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

Polytechnic University of the Philippines

College of Computer and Information Sciences

Quiz1- Computer Programming 1

NAME: Rey Adrian R. Inday Date: Nov. 9, 2020 BSIT 1 - 2

I. Programming. Draw a complete flowchart

A. Sariling Atin Aircraft Carrier allows two pieces of luggage and maximum 35 kilos
for each luggage and charge Php.250.00 for each luggage. If the luggage
exceeds the allowable weight, an excess luggage fee of Php.150.00 per kilo is
charged per luggage. If any of the luggage weigh only 5kilos – 10kilos, a refund
of Php. 75.00 per luggage is given to the passenger. Display the weight of each
luggage and then compute and display the total cost / charge / refund to the
passenger.

B. Draw a flowchart that will input the weight of a letter in gram(s) and its letter code.

Letter Code Description


1 Ordinary Letter
2 Special Letter

If the letter weigh 1 gram or less you will pay Php. 20.00 for each gram or less for
Ordinary letter and Php. 30.00 for each gram or less for Special letter. If the letter
weigh more than 1 gram you will pay additional Php. 10.00 for each gram and a
fraction of the weight for ordinary letter and Php. 15.00 for each gram and a fraction
of the weight for special letter. Compute and print how much will be the cost of the
letter.

C. Pizza parlors offers different pizza sizes in terms of diameters. For example,
Angels’ Pizza has three options: 10 inches, 12 inches and 14 inches diameter. Pinoy
Pizza cost 350 pesos, 480 pesos and 540 pesos respectively. Write a program that
will input the diameter of the pizza and its price. Determine and print the following:

1. area of the pizza


2. Price divided by area.

Note that the area of a circle is equivalent to PI * (diameter / 2) 2 .


Where π(PI) = 2.54
A.

START

LUGG_WT1=0,
LUGG_WT2=0,
CHRG1=0,
CHRG2=0,
REF1=0,
REF2=0,
T_COST=0,
T_CHRG=0,
T_REF=0

INPUT
LUGG_WT1

LUGG_WT1>=5 YES
&& CHRG1=250.00
LUG_WT1<=10 REF1=75.00

NO

LUGG_WT1>10 T_CHRG=CHRG1=CHRG2
YES
&& YES CHRG1=250.00
T_REF=REF1+REF2
LUG_WT1<=35 REF1=0
T_COST=T_CHRG-T_REF

NO

OUTPUT
LUGG_WT1>35 CHRG1=250.00+
YES ((LUGG_WT1-35)*150) LUGG_WT1
YES REF1=0

OUTPUT
NO LUGG_WT2
OUTPUT
INVALID

OUTPUT
T_COST
INPUT
LUGG_WT2

OUTPUT
T_CHARGE

LUGG_WT2>=5
&& CHRG2=250.00
YES
LUGG_WT2<=10 REF2=75.00
YES
OUTPUT T_REF

NO
LUGG_WT2>10 CHRG2=250
&& REF2=0
YES
LUG_WT2<=35 YES

NO
CHRG2=250.00+
LUGG_WT1>35 ((LUGG_WT2-35)*150)
YES YES REF2=0

NO END
OUTPUT
INVALID
B.

START

CODE=0,
GRAMS=0,
COST=0

INPUT
CODE, GRAMS

YES
OUTPUT
CODE==1 && COST=20.00 COST
GRAMS<=1

NO

CODE==2 && YES OUTPUT


COST=30.00
GRAMS<=1 COST

NO

YES OUTPUT
CODE==1 && COST=20+(10*(GRAMS-1))
GRAMS>1 COST

NO

YES
CODE==2 && OUTPUT
COST=20+(15*(GRAMS-1))
GRAMS>1 COST

NO

OUTPUT
“ENTER 1 OR 2 FOR END
LETTER CODE”
C.

START

PRICE=0,
DIAMETER=0,
AREA=0,
PRICE_DIV_AREA=0

INPUT
PRICE, DIAMETER

AREA=2.54*(DIAMETER/2)*(DIAMETER/2)

OUTPUT
AREA

PRICE_DIV_AREA=PRICE/AREA

OUTPUT
PRICE_DIV_AREA

END

You might also like