0% found this document useful (0 votes)
12 views

CSCC_102_Lab_Exercise_3-1

practice coding

Uploaded by

Mesh Asis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

CSCC_102_Lab_Exercise_3-1

practice coding

Uploaded by

Mesh Asis
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Laboratory Manual in Fundamentals of Programming (CSCC 102)

WORK SHEET
Laboratory Exercise No. 3.1

TOM AND JERRY LAWN SERVICE

Name: __________________________________________________
Meshach Dane Asis Score:
Date: ___________________________________________________
09/20/2024

OBJECTIVES

At the end of the activity, the students must have been able to do the following:
• complete an IPO chart for the Tom and Jerry Lawn Service problem;
• 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

Tom and Jerry opened a new lawn service. They provide three services: mowing, fertilizing, and
planting trees. Mowing costs Php 750 per 100 square meters, fertilizing is Php 550 per application,
and planting a tree is Php 400. Write a program that prompts the user to enter the area of the lawn
to be mowed, the number of fertilizing applications, and the number of trees to be planted. The
program then displays the billing amount for each lawn service and the total billing amount.
(Assume that the user orders all three services.) 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


_____________________________________________________________________________
Area of the lawn to be mowed double lawnArea = 0.0;
_____________________________________________________________________________
Number of fertilizing applications int fertilizingApplications = 0;
_____________________________________________________________________________
number of trees to be planted int treesPlanted = 0;
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________

Notre Dame of Marbel University


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

PROCESSING
_____________________________________________________________________________
Processing items:
_____________________________________________________________________________
_____________________________________________________________________________
none

_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
OUTPUT
_____________________________________________________________________________
total amount of mowing service
_____________________________________________________________________________
double amountMowingService = 0.0;
total amount of fertilizing service
_____________________________________________________________________________
double amountFertilizingService = 0.0;

_____________________________________________________________________________
total amount of trees planting service double amountPlantingService = 0.0;

_____________________________________________________________________________
total billing amount double totalBilling = 0.0;

_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________
_____________________________________________________________________________

Notre Dame of Marbel University


34 City of Koronadal, South Cotabato
Laboratory Manual in Fundamentals of Programming (CSCC 102)

FLOWCHART

start

Enter lawn area, number of


fertilizing application, and
number of trees planted

amount of mowing service = lawn area * 750

amount of fertilizing service = number of


fertilizing application * 550

amount of planting service = number of trees


planted* 400

total bill = sum of amounts of service in mowing,


fertilizing application, and tree planting

display amount of mowing, amount of


fertilizing application, amount of trees
planted, and total billing

stop

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

Area of lawn no, of fertilizing application no. of trees planted price of mowing price of fertilizing application price of tree planting

100 sq. m 10 5 750 php 550 php 400 php


200 sq. m 20 10 750 php 550 php 400 php

amount of mowing amount of fertilizing application amount of tree planting total billing
750 php 5,500 php 2,000 php 8,250 php
1,500 php 11,000 php 4,000 php 16,500 php

Notre Dame of Marbel University


City of Koronadal, South Cotabato 35

You might also like