0% found this document useful (0 votes)
16 views5 pages

CSCC_102_Lab_Exercise_3-2

practice coding

Uploaded by

Mesh Asis
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)
16 views5 pages

CSCC_102_Lab_Exercise_3-2

practice coding

Uploaded by

Mesh Asis
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/ 5

Laboratory Manual in Computer Programing 1 (ITCC 112)

WORK SHEET
Laboratory Exercise No. 3.2

LOCAL ZOO AND THE PICTURE FRAME

MESHACH DANE ASIS


Name: __________________________________________________ Score:
Date: ___________________________________________________
10/14/24

OBJECTIVES

At the end of the activity, the students must have been able to do the following:
• complete an IPO chart for the Local Zoo and the Picture Frame problems;
• write the corresponding C++ instructions for each item declaration in the IPO chart;
• outline the algorithm using a flowchart; and
• desk-check the algorithm using their own set of data.

PROBLEM 1

A local zoo offers three different memberships: an individual membership for Php 199 per year,
a dual membership for Php 275 per year, and a family membership for Php 325 per year. The
membership director wants a program that displays the total membership revenue for the year, as
well as the amount of the total revenue contributed by each membership type. Complete an IPO
chart for this problem and write the corresponding C++ instructions for each IPO item declaration.
Outline the algorithm using a flowchart.

INPUT C++ INSTRUCTIONS


_____________________________________________________________________________
NUMBER OF INDIVIDUAL MEMBERSHIP int numIndivMem = 0;
_____________________________________________________________________________
_____________________________________________________________________________
NUMBER OF DUAL MEMBERSHIP int numDualMem = 0;
NUMBER OF FAMILY MEMBERSHIP int numFamMem = 0;
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
PROCESSING
_____________________________________________________________________________
Processing items:
_____________________________________________________________________________
none
_____________________________________________________________________________
_____________________________________________________________________________

Notre Dame of Marbel University


City of Koronadal, South Cotabato 37
Sabado, Vince Marc B.

OUTPUT
_____________________________________________________________________________
TOTAL MEMBERSHIP REVENUE double ttlRevenue = 0.0;
_____________________________________________________________________________
INDIVIDUAL MEMBERSHIP REVENUE
_____________________________________________________________________________
double indivRevenue = 0.0;
DUAL MEMBERSHIP REVENUE double dualRevenue = 0.0;
_____________________________________________________________________________
FAMILY MEMBERSHIP REVENUE double famRevenue = 0.0;
_____________________________________________________________________________
_____________________________________________________________________________

FLOWCHART

start

enter number of individual membership,


dual membership, and family
membership for that year

incividual membership revenue = number of individual membership * 199/1

dual membership revenue = number of dual membership * 275/1

family membership revenue = number of family membership * 325/1

total membership revenue = individual membership revenue +


dual membershiop revenue + family membership revenue

display total membership revenue, individual membership revenue,


dual membership revenue, and family membership revenue

stop

Notre Dame of Marbel University


38 City of Koronadal, South Cotabato
Laboratory Manual in Computer Programing 1 (ITCC 112)

DESK-CHECK
Desk-check your algorithm once using your own set of data.
number of individual membership number of dual membership number of family membership

10 20 30

cost of individual membership (per year) cost of dual membership (per year) cost of familiy membership (per year)
199 275 325

individual membership revenue dual membership revenue family membership revenue

1, 990 5,500 9, 750

total membership revenue

17, 240

PROBLEM 2

A piece of wire is to be bent in the form of a rectangle to put around a picture frame. The length
of the picture frame is 1.5 times the width. Write a program that prompts the user to input the
length of the wire and outputs the length and width of the picture frame. Complete an IPO chart
for this problem and write the corresponding C++ instructions for each IPO item declaration.
Outline the algorithm using a flowchart.

INPUT C++ INSTRUCTIONS


_____________________________________________________________________________
double wireLenght = 0.0;
_____________________________________________________________________________
LENGTH OF WIRE

_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________

Notre Dame of Marbel University


City of Koronadal, South Cotabato 39
Sabado, Vince Marc B.

PROCESSING
_____________________________________________________________________________
Processing items:
_____________________________________________________________________________
none
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
OUTPUT
LENGTH OF PICTURE FRAME
_____________________________________________________________________________
double frameLength = 0.0;
double frameWidth = 0.0;
_____________________________________________________________________________
WIDTH OF PICTURE FRAME

_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________

FLOWCHART

start

enter wire length

frame width = wire length / 5

frame length = 1.5 * frame width

display frame lenght and frame width

stop

Notre Dame of Marbel University


40 City of Koronadal, South Cotabato
Laboratory Manual in Computer Programing 1 (ITCC 112)

DESK-CHECK
Desk-check your algorithm once using your own set of data.

wire length frame length frame width

60 18 12

Notre Dame of Marbel University


City of Koronadal, South Cotabato 41

You might also like