0% found this document useful (0 votes)
280 views31 pages

Module 1 Page 12-41

The document outlines the 6 main phases of the program development life cycle (PDLC): 1) Program specification which defines program requirements and inputs/outputs 2) Program design which plans the solution using techniques like algorithms, pseudocode, flowcharts 3) Program coding which writes the program logic in a programming language 4) Program testing and debugging which verifies the program works as intended 5) Program documentation which records the program details 6) Program maintenance which modifies the program after implementation The PDLC provides a structured process to develop programs from planning to maintenance.
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)
280 views31 pages

Module 1 Page 12-41

The document outlines the 6 main phases of the program development life cycle (PDLC): 1) Program specification which defines program requirements and inputs/outputs 2) Program design which plans the solution using techniques like algorithms, pseudocode, flowcharts 3) Program coding which writes the program logic in a programming language 4) Program testing and debugging which verifies the program works as intended 5) Program documentation which records the program details 6) Program maintenance which modifies the program after implementation The PDLC provides a structured process to develop programs from planning to maintenance.
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/ 31

Steps in Program Development

If we are to develop a program using any programming language, there shall


be a sequence of steps to follow. These steps are called phases in program
development. The program development life cycle is a set of steps or phases that
are used to develop a program in any programming language. Generally, the
program development life cycle comprises 6 phases, they are as follows.

1. Program Specification
2. Program Design
3. Program Coding
4. Program Testing and Debugging
5. Program Documentation
6. Program Maintenance

Program
Specification

Program
Program Design
Maintenance

Program
Program Coding
Documentation

Program
Testing and
Debugging

Figure 1-1. PDLC

1. Program Specification is also called program definition or program analysis. It


requires the programmer to specify a program plan which contains the
following:

12 | P a g e
Program Background – This specifies the nature of the program,
background information, programming language to be used, and the
target dates.

The available input – These are the given data which will be
manipulated so that the required output may be obtained.

The Required Output – This is what the program intends to do, including
the desired output layout and specifications.

Processing Requirements or Program Methodology – These are the


operations to be performed on data to obtain the required output.

2. Program Design is the way you plan a solution, preferably using a structured
programming technique. The technique consists of the following:

The algorithm refers to the narrative step-by-step solution to the problem.


Using natural verbal but somewhat technical annotations, the solution is
explained.

Example:

1. Set total regular hours and total overtime hours to zero


2. Get time in and time out for a job
3. If worked past 1700 hours, then compute overtime hours
4. Compute regular hours, add overtime, and subtract
deduction

Pseudocode (soo-doh-code) is a narrative form of the logic of the program. It


is like doing a summary or an outline form of the program or simply, we can
say that it’s the cooked up representation of an algorithm. Often at times,
algorithms are represented with the help of pseudo-codes as they can be
interpreted by programmers no matter what their programming background
or knowledge is. Pseudocode, as the name suggests, is a false code or a
representation of code that can be understood by even a layman with some
school level programming knowledge. It has no syntax like any of the
programming languages and thus can’t be compiled or interpreted by the
computer.

Example:

Let’s have a look at this code at the left column and see the Pseudo Code for the
same at the right column.

13 | P a g e
// This program calculates the Lowest Common multiple This program calculates the Lowest Common
// for excessively long input values multiple
for excessively long input values
import java.util.*;
function lcmNaive(Argument one, Argument
public class LowestCommonMultiple {
two){
private static long
lcmNaive(long numberOne, long numberTwo) Calculate the lowest common variable of
{ Argument
1 and Argument 2 by dividing their product
long lowestCommonMultiple; by their
Greatest common divisor product
lowestCommonMultiple
= (numberOne * numberTwo) return lowest common multiple
/ greatestCommonDivisor(numberOne, end
numberTwo);
}
function greatestCommonDivisor(Argument
return lowestCommonMultiple;
one, Argument two){
}
if Argument two is equal to zero
then return Argument one
private static long
greatestCommonDivisor(long numberOne, long numberTwo)
{ return the greatest common divisor

if (numberTwo == 0) end
return numberOne; }

return greatestCommonDivisor(numberTwo,
numberOne % numberTwo); {
} In the main function
public static void main(String args[])
{ print prompt "Input two numbers"

Scanner scanner = new Scanner(System.in);


Take the first number from the user
System.out.println("Enter the inputs");
long numberOne = scanner.nextInt(); Take the second number from the user
long numberTwo = scanner.nextInt();
Send the first number and second number
System.out.println(lcmNaive(numberOne, numberTwo)); to the lcmNaive function and print
} the result to the user
} }

Logic Structures are the ways or techniques on how statements are organized
or represented to show the logic of the program. There are three logical
structures: sequence, selection, and iteration. These shall be further discussing
in Module 4 of this course.

Flowcharts are used to illustrate data, information, and workflow by the


interconnection of specialized symbols with flow lines. The combination of
symbols and flow lines portray the logic of the program or system. A flowchart
improves the logic of the solution so that programmers usually derive the
flowchart from the algorithm. These are widely used in multiple fields to
document, study, plan, improve, and communicate often complex processes
in clear, easy-to-understand diagrams.

A flowchart is also defined as a schematic representation of a sequence of


operations, as for a computer program. Graphical or symbolic description of
how the program is performing.

14 | P a g e
There will be further discussion on the flowchart in the last part of this Module.

Top-down program design are steps called program modules to identify the
program’s processing steps which are made up of logically related program
statements.

Example:
Master
Payroll

Compute Compute
Salary Deduction

Time Record Overtime Compute Absences /


Basic Pay Tax Under-time

Figure 1-2. Example of Top-down program design

3. Program Coding. Coding is the actual writing of the program logic using any
programming language.

What is a good program? A Good Program should be reliable, that is, it


should work under most conditions. It should catch obvious and common
input errors. It should also be understandable by all users. The best way to
write programs is by applying structured designing and logic structures.

Which Language? An important decision is which language to write the


programs in. First, you must determine the program’s logic. Then, you can
code it in whatever programming language you may choose that is available
on your computer and applicable in the type of output you wish to create.

4. Program Testing and Debugging

Testing refers to the process of verifying the accuracy or workability of the


solution. While testing the program, a programmer should be able to correct
syntax and logic errors.

Methods of Testing: Desk checking, manual testing, and testing sample data
on the computer. In these phases, programs are tested through the use of
computers and undergo special systems software such as Language
Translator. Symbolic and high-level programming languages have translators
that will tell the programmer if the language has been used correctly. The job
of a language translator is to convert a source code ( a program written in a

15 | P a g e
particular programming language) into its object code (machine code)
equivalent.

There are three kinds of language translators:

 Assembler – converts a program written in assembly language to its


object code equivalent.

 Interpreter – converts a program written in a high-level language into


its object code equivalent on a line-by-line basis.

 Compiler - converts a program written in a high-level language into its


object code equivalent on a whole-program basis.

Debugging is the process of locating/identifying and correcting errors in the


program.

There are two types of errors, and these are:

 Syntax error – is a violation of the rules and regulations of whatever


programming language the program is being written in.

 Logic error – is when the programmer has used an incorrect


calculation or left out programming procedures.

5. Program Documentation. “Documenting means a description of the purpose


and process of the program. It consists of written descriptions and procedures
about a program and how to use it. It is not something done just at the end of
the programming process. Documentation is carried out through all the
programming steps. Users, operators, and programmers should be provided
with these documents.

 Documentation usually includes the following:


 Program Specification
 Program Design
 Program Source Code Listing
 Listing of the Test Data used for testing and Debugging
 Sample Output Layout of the program
 Hardware and Software requirements necessary to run the program
 User’s Manual

The logic is generally the most difficult part of programming. However,


depending on the programming language, writing the statements may also be
laborious. One thing is certain. Documenting the program is considered the
most annoying activity by most programmers.

6. Program Maintenance. Programmers update the software to correct errors to


improve usability, to standardize and adjust to organizational changes. The
program’s life cycle does not end from the time it was finished by the

16 | P a g e
developer. It continually modifies ore revises to cope with changes and
ensure that current programs are operating error-free, efficiently, and
effectively. If bugs occur even when the program is running smoothly for
some time, the programmer must be able to trace and correct the errors.

Problem Analysis and Design Tools

Until now, the theory of problem-solving (Newell and Simon, 1972) has mainly
emphasized the search for solutions within a problem space. From this viewpoint,
problem-solving capability (intelligence) should be seen as the possession of
adequate logic, which allows the search more efficient.

The first thing to be done to solve an ill-structured problem is to formulate it in


a well-structured way. Once we know how to construct (and transform) simply apply
the existing knowledge about the search through problem spaces. Moreover, we
shall be able to solve all types of problems.

Definition of Terms

The abstract is a well-structured problem formulation to tackle a complex


problem domain, General representations constructed to analyze, hierarchically
organized, as well as a system of distinctions, securing the survival of an agent
concerning his situation. The abstract is a preliminary variation-selection model
outlined combining theoretical, computational, and empirical-psychological
approaches for solving a problem domain.

Abstraction is a design activity that makes use of models first before


implementation. This is a process of building simple structures out of the available
data, which are often inconsistent, ambiguous, unclear, and changeful in manner.
This is also the act of separating the inherent qualities or properties of something from
the actual physical object or concept to which it belongs.

The ill-structured problem can be characterized, first, by the presence of a


“problem” or a situation that is to be changed in some way. The absence of
structure is needed for efficient search, constraints in well-defined goal(s), problem-
states, operators, and heuristic criteria.

IPO Chart is also known as Input- Process-Output Chart. IPO links the Input and
Output and specifies what input data go into a process and what output is generated
as an outcome.

17 | P a g e
Example of an IPO Chart:

INPUT PROCESS OUTPUT

First Number To get the sum, First Number


Add first
number to Second Number

Second Number second number Sum


Print the sum

Figure 1-3. IPO (Input-Process-Output)

Narrative refers to program logic that is described and communicated through


words. Procedures and instructions are narrated which may be numbered to indicate
sequence or order.

Algorithm is a diagram that uses standard ANSI (American National Standard


Institute) symbols to show the step-by-step processing activities and decision logic
needed o\in solving problems.

Let’s test your learning by answering our second quiz. Good luck!

18 | P a g e
Quiz #1.2
Good Luck!
Assessment

“First, solve the problem. Then, write the code.” – John Johnson

Name: ____________________________________ Year Level: ______________

Section: ___________________________________ Date: ____________________

I. Identification

Direction: Read and identify each sentence.

______________ 1. The name of input data which may be in a form of facts or figures
which will be manipulated throughout the program.

______________ 2. A programming approach which focuses on identifying and


creating objects or data as well as manipulating and interactions of objects. It uses a
reusable code to execute several tasks.

______________ 3. Any violation of the rules and regulations such as wrong spelling or
missing punctuation marks while writing the program code.

_______________ 4. One of the steps in program development that specifies the given
data, required outputs, and program processing requirements.

_______________ 5. Method of program testing which uses special system software that
translates high-level language into its low level language equivalent.

_______________ 6. A form of input (data) which focus on non-numerical values and


phenomenon

_______________ 7. One of the planning techniques which shows a narrative step-by-


step solution to the problem using ordinary English language.

_______________ 8. A language translator which converts program in high-level


language into its objects code equivalent.

_______________ 9. Among the different kinds of translator, this converts the program
source code into its equivalent object code on a line-by-line basis.

______________10. A type of error which violates rules and regulations in writing a


programming language.

19 | P a g e
______________ 11. Step in programming development which focus on the actual
coding and translate the program plan into a programming language.

______________ 12. The updates were done to the program to correct errors and to
improve the usability, as well as to standardized and adjust to organizational changes.

______________ 13. One of the major reasons why planning is important before doing
the program which considers the welfare of the end-users.

______________ 14. A technique in planning stage which uses symbols to illustrate data,
information, and its workflow.

______________ 15. Textual representation of the solution to the problem which is


carefully written after following the proper syntax.

II. Enumerate and briefly discuss the following:

Contents of Program Documentation


Reasons why planning is essential to program development
Programming Language Translator
Procedural Programming and Object-Oriented Programming Languages

20 | P a g e
Problem Analysis

In computer programming, problem analysis is the process where we break down


problems into its components so that the problems can easily be understood. The way
to do this is to write an ALGORITHM of the problem. To have a clear vision of what you
are supposed to do to start a program, a Program plan or detailed plan is necessary
to achieve the desired output or solution of the problem.

Program Plan

The program plan is a blueprint that provides a systematic approach to


computer programming problems. It consists of several important sub-steps.

The first step is to define the problem. In this step, the problem is examined
carefully to determine what questions must be answered before attempting to solve
the problem. From this sub-step, the required output of the program is determined.

The second step is to assemble all given data and to assign variable names to
those quantities, which are unknown. All unnecessary information should be discarded
because many problems contain information that has no meaning to the solution.
From this sub-step, the available data are derived.

The third step is to discover relationships among data and to express the
relationship as an equation. The quotations are also arranged in order of importance
so that the proper sequence of the solution may be determined. From this sub-step,
the processing requirements are determined.

Example of a Program Plan:

Create a program plan that will compute for an employee’s weekly net pay
and will generate the employee’s payslip similar to the one below:

Payroll Period
September 7 – 12, 2020

Employee Name: Juan Andres

Regular Hours worked: 48


Regular Rate per Hour: Php 62.50
Basic Salary for the Week: Php 3,000.00
Overtime Hours Rendered: 10
Overtime Pay: Php 937.50
Gross Pay: Php 3,937.50
Less Tax: Php 590.62
Net Pay: Php 3,346.88

The payroll period, employee name, regular hours worked, and overtime hours
rendered is to be entered from the keyboard. Overtime pay is one and a half times
the regular rate, while tax is set at 15% of the gross.

21 | P a g e
Solution:
Program Plan
a. Available input
1. Payroll Period = period
2. Employee Name = EName
3. Regular Hours Worked = RHWorked
4. Regular Rate per Hour = RRate
5. Overtime Hours Rendered = OHRendered

b. Processing Requirements
1. Net Pay = Gross Pay – Tax
2. Gross Pay = Basic Salary of the Week + Overtime Pay
3. Tax = Gross Pay * .15
4. Basic Salary = RHWorked * RRate
5. Overtime Pay = OHRendered * RRate * 1.50

c. Required output

Payroll Period
MM –DD-YYYY

Employee Name: XXXXXXX XXXXXX

Regular Hours worked: 99


Regular Rate per Hour: Php 99.99
Basic Salary for the Week: Php 9,999.99

Overtime Hours Rendered: 99


Overtime Pay: Php 999.99

Gross Pay: Php 9,999.99


Less Tax: Php 999.99

Net Pay: Php 9,999.99

Algorithm

An algorithm as defined in the previous page refers to the narrative step-by-


step solution to the problem. Using natural verbal but somewhat technical
annotations, the solution is explained. In planning the algorithm, an IPO chart can be
used. An IPO chart is divided into three columns: Input, Process, and Output. Most
algorithms begin with as instruction that enters the input column of an IPO chart.

After the instructions to enter the input items, the next set of instructions
process the input typically by performing some calculations on some processing
items. Processing items represent an intermediate value that the algorithm uses
when processing the input into the output. These steps are entered in the processing
column of an IPO chart. The algorithm usually end with an instruction either to print
or to display or to store the output items which are listed in the Output column of the
IPO chart.,

22 | P a g e
Algorithm (Sample Problem 1-1)
Problem: Print the sum of the two (2) numbers.
Algorithm:
1. Input the first number
2. Input the second number
3. Compute for the SUM by adding the first number to the second number.
4. Print the SUM
Now, let us create an IPO chart using the example above that would create a
program plan that will compute for an employee’s weekly net pay and will generate
the employee’s payslip based on the specifications provided.
The following algorithm can be used to compute for the weekly net pay of an
employee:
1. Enter period, EName, RHWorked, RRate, and OHRendered
2. Multiply RHWorked and RRate, call it as salary
3. Multiply RRate with 1.50, name it as 0Rate
4. Multiply RHWorked with 0Rate, call it as 0pay
5. Add salary and 0Pay, name it as Gross
6. Multiply Gross with 0.15, call it as Tax
7. Subtract Tax from Gross, name it as Net
8. Display Pperiod, Ename, RHWorked, RRate, BSalary, OHRendered, 0Pay, Gross,
tax, and Net

Solution:

INPUT PROCESS OUTPUT

Payroll Period Processing items: Payroll Summary

Employee Name Regular Hours Worked


Overtime Hours Rendered
Regular Hours Worked
Algorithm:
Regular Rate
1. Multiply RHWorked and RRate,
Overtime Hours Rendered call it as BSalary
2. Multiply RRate with 1.50,
name it as 0Rate
3. Multiply RHWorked with
0Rate, call it as 0pay
4. Add BSalary and 0Pay, name
it as Gross
5. Multiply Gross with 0.15, call it
as Tax
6. Subtract Tax from Gross,
name it as Net

The following are helpful hints a programmer may consider in planning an algorithm.

1. Before writing an algorithm, consider whether you have already solved a similar
problem if so, you can use the same solution with little modification to solve the
current problem.

23 | P a g e
2. If you have not yet solved a similar problem, consider whether you can use a
portion of an existing algorithm to solve the current problem to save time and
effort and use it to a more serious, needs a deeper examination of the
program.
3. If both items 1 and 2 are not considered, then solve the problem manually,
noting each step you take to do so.

Sample Problem 1-2: Algorithm

Instruction: Create a program plan and an algorithm for the following cases:

A man knows that the gasoline tank of his car holds 24 gallons and that his car
averages 18.3 miles per gallon. He starts with a full tank and drives at 45 miles per hour.
Find the volume of the gasoline left in the tank at any given time.

PROGRAM PLAN
Required Output The volume of the gasoline left in the tank

Available Input Full Tank = volume = 24 gallons

Average miles per gallon = 18.3 miles/gallon=amg

Processing Requirements Average gasoline consumption = amg * time

Volume Consumed + Speed/Average Gasoline


Consumption at any given time

Volume Remaining = Full Tank – Volume Consumed

Algorithm

Step 1. Start
Step 2. Enter time (t)
Step 3. To obtain the average gasoline consumption at any given time, multiply amg
by (t), call it as (Avgt)
Step 4. To obtain the volume consumed, divide the car’s speed by AVGt, name it as
(V3)
Step 5. To compute the remaining gasoline, subtract (V2) from (V1), call it as
(VRemaining)
Step 6. Stop

Let’s test your learning by accomplishing our lecture activities. Good luck!

24 | P a g e
Good Luck!
Assessment

Lecture Activity # 1 – Problem Analysis


Instructions: Create a program plan and algorithm for the following cases and write
your answer on the table provided.

1.1 Suppose you want to create a program that would accept any number
and computes the square, and square root the number read.

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

25 | P a g e
1.2 Input three (3) integer numbers, then calculate and output their sum
and the average.

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

26 | P a g e
1.3 A store owner wants to give a 10% discount to customers who are 60
years old and above.

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

27 | P a g e
Lecture Activity # 2 – Design Tools (Algorithm)
Instructions: Create a program plan and algorithm for the following case and write
your answer on the table provided.

A company pays an annual bonus to its employees. The bonus is based on the
number of years the employee has been with the company. Employees working at
the company for less than 5 years receive a 1% bonus while the rest will receive a 2%
bonus. Bonuses will also be based on the employee’s annual salary.

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

28 | P a g e
Lecture Activity # 3 – Design Tools (Algorithm)
Instructions: Create a program plan and algorithm for the following case and write
your answer on the table provided.

A company pays an annual bonus to its employees. The bonus is based on the
number of years the employee has been with the company. Employees working at
the company for less than 5 years receive a 1% bonus while the rest will receive a 2%
bonus. Bonuses will also be based on the employee’s annual salary.

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

29 | P a g e
Flowchart and Flowcharting Symbols

We already defined Algorithms and flowchart in the previous topic.


Algorithms and flowcharts are two different ways of presenting the process of solving
a problem. Algorithms consist of a set of steps for solving a particular problem, while
in flowcharts those steps are usually displayed in shapes and process boxes with
arrows. So flowcharts can be used for presenting algorithms

Symbols used in flowcharting are never standardized. For uniformity, it should


be agreed upon that the following symbols be used:

PROGRAM FLOWCHART SYMBOLS

SYMBOL FUNCTION

Terminator/Terminal. Used to indicate the beginning and


end of a flowchart or routine.

Preparation/Initialization. Used to initialize work areas


such as counters, accumulators, or array.

Input/Output. Used to indicate where data are entered


and also where results are written. This symbol is used
when the I/O device name is not given.

Decision. Used to test a condition, which will be either


TRUE or FALSE.

ON-PAGE Connector. Used to indicate the point of


which transfer of control.

OFF-PAGE Connector. Used to correct separate pages


of a flowchart.

Flow Lines. Used to indicate the sequence in which


instruction is executed.

30 | P a g e
SYSTEM FLOWCHART SYMBOLS

SYMBOL FUNCTION
Predefined Process or Subroutine. Used to denote a
sequence of steps that are separate from the main
flowchart.
Printer. Used to print results, reports, or messages.

Manual Input (Keyboard). Used to enter data


manually.

Display. Used to display results on the screen.

As you have noticed, flowchart symbols have been presented in two


separate tables. The first one is for the program flowchart symbols and the other one
is for the system flowchart symbols. System flowchart and program flowchart are two
types of flowcharts.

1. Program Flowchart – A plan of attack showing the detailed steps required in


the solution to a given problem. It is a graphical representation of the
operation required to carry out data processing. A flowchart is also defined as
a pictorial representation of the structure and sequence of operations involved
in the solution to a problem.

Example of a Program Flowchart


Begin
Begin

Read N

M=1
F=1

F=F*M

M = M=1 Is
M = N?

Print N

End

Figure 1-4. Program Flowchart

2. System flowchart – System Development modeling tool, used to diagram and


document the design of a new system and present an overview of the entire
system, including data flow (point of input, output, and storage) and

31 | P a g e
processing activities. This flowchart is used to show in general terms what is to
be accomplished by the program.

Example of a System / General Flowchart

Begin
Begin

Print Heading

Enter Employee code

Read Master File

Compute Pay

Print Cheque

End

Figure 1-5. System / General Flowchart

The main difference between the system flowchart and program flowchart is
that a system flowchart explains the functionality of an entire system while a
program flowchart explains how a single program solves a given task.

Software development is a complex task. It is not possible to write programs


for the entire system directly. Therefore, it is necessary to model the system to get a
better understanding of the system. Furthermore, different diagrams help to
understand the functionality of the system. One such diagram is a flowchart. It is a
diagrammatic representation that illustrates a solution model to a given problem.

Rules of Drawing Flowcharts for Algorithms

There are some basic shapes and boxes included in flowcharts that are used
in the structure of explaining the steps of algorithms. Knowing how to use them while
drawing flowcharts is crucial. Here are some rules that should be known:

1. All boxes of flowcharts are connected with arrows to show the logical
connection between them,
2. Flowcharts will flow from top to bottom,
3. All flowcharts start with a Start Box and end with a Terminal Box.

To help you get a healthier understanding of flowchart techniques, observe


examples of flowcharts for the algorithm below.

32 | P a g e
Example 1: Create a program that will calculate the Interest of a Bank Deposit

Algorithm:

Step 1: Read amount,


Step 2: Read years,
Step 3: Read rate,
Step 4: Calculate the interest with the formula
"Interest=Amount*Years*Rate/100
Step 5: Print interest,

Flowchart:

Example 2: Create a program that will determine and output whether Number N is
Even or Odd

Algorithm:

Step 1: Read number N,


Step 2: Set remainder as N modulo 2,
Step 3: If the remainder is equal to 0 then number N is even, else number N is
odd,
Step 4: Print output.

33 | P a g e
Flowchart:

Example 3: Determine Whether a Temperature is Below or Above the Freezing Point

Algorithm:

Step 1: Input temperature,


Step 2: If it is less than 32, then print "below freezing point", otherwise print
"above freezing point".

Flowchart:

34 | P a g e
Example 4: Determine Whether A Student Passed the Exam or Not:

Algorithm:

 Step 1: Input grades of 4 courses M1, M2, M3 and M4,


 Step 2: Calculate the average grade with the formula
"Grade=(M1+M2+M3+M4)/4"
 Step 3: If the average grade is less than 60, print "FAIL", else print "PASS".

Flowchart:

There will be more examples and discussions on the application of the


flowchart in Module 4. Control Structure of this course. But for now, let’s see how much
do you learn by accomplishing the assessment on the next page.

35 | P a g e
Good Luck!
Assessment

Lecture Activity # 4 – Design Tools (Flowchart)


Instruction: Create a program plan, algorithm, and a flowchart for the following case:

Assume that a bomber with a non-board computer has a faulty bombsight. A


program is needed which will give the proper distance from the target at which the
release of the bomb will produce a hit. Since the bomb will be affected by gravity
and by the speed of the plane, the program can be written only if the altitude and
speed are known. Determine the time it will take the bomb to fall on earth by using
the gravity formula,

d = ½ gt2

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

36 | P a g e
Algorithm

Flowchart

37 | P a g e
Lecture Activity # 5 – Design Tools (Flowchart)
Instruction: Create a program plan, algorithm, and a flowchart for the following case:

Design the algorithm for a program that calculates the current balance in a savings account.
The program should obtain from the user the following information: the starting balance, the total
amount of deposits made, the total amount of withdrawals made, and the monthly interest rate.
After the program has calculated the current balance, it should be displayed on the screen. Assume
one input for deposits and one input for withdrawals. Draw the flowchart for this algorithm.

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

38 | P a g e
Flowchart

39 | P a g e
Lecture Activity # 6 – Design Tools (Flowchart)
Instruction: Create a program plan, algorithm, and a flowchart for the following case:

Design the algorithm for a program that calculates the total of a retail sale.
The program should ask the user for the following: the retail price of the item being
purchased and the sales tax rate. Once the information has been entered the
program should calculate and display the following: the sales tax for the purchase
and the total sale. Draw the flowchart for this algorithm

PROGRAM PLAN
Required Output

Available Input

Processing Requirements

Algorithm

40 | P a g e
Flowchart

41 | P a g e
References:

https://www.yourdictionary.com/programming

http://www.scribd.com/doc/7368548/Logic-Formulation

http://au.answers.yahoo.com/question/index?qid=20071110191353AABcdvH

http://wiki.answers.com/Q/What_are_the_logic_formulation

https://www.computerhope.com/jargon/m/machlang.htm#:~:text=Machine%20lan
guage%20example,the%20text%20%22Hello%20World.%22&text=Below%20is%20anot
her%20example%20of,times%20to%20the%20computer%20screen.

https://www.computerhope.com/jargon/a/al.htm#:~:text=Programs%20written%20i
n%20high%2Dlevel,JavaScript%2C%20Clojure%2C%20and%20Lisp.

https://www.britannica.com/technology/fourth-generation-language

https://www.geeksforgeeks.org/differences-between-procedural-and-object-
oriented-programming/

https://www.geeksforgeeks.org/how-to-write-a-pseudo-code/

https://www.computertaleem.com/problem-
analysis/#:~:text=changes%20before%20completion.-
,Problem%20Analysis%20in%20Computer%20programming%20is%20the%20process%2
0where%20we,discussed%20for%20giving%20the%20solution.

https://pediaa.com/what-is-the-difference-between-system-flowchart-and-
program-
flowchart/#:~:text=The%20main%20difference%20between%20system,flowchart%20r
epresents%20a%20single%20program.&text=One%20such%20diagram%20is%20a,mo
del%20to%20a%20given%20problem.

42 | P a g e

You might also like