CSCC_102_Lab_Exercise_3-2
CSCC_102_Lab_Exercise_3-2
WORK SHEET
Laboratory Exercise No. 3.2
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.
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
stop
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
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.
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
PROCESSING
_____________________________________________________________________________
Processing items:
_____________________________________________________________________________
none
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
OUTPUT
LENGTH OF PICTURE FRAME
_____________________________________________________________________________
double frameLength = 0.0;
double frameWidth = 0.0;
_____________________________________________________________________________
WIDTH OF PICTURE FRAME
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
FLOWCHART
start
stop
DESK-CHECK
Desk-check your algorithm once using your own set of data.
60 18 12