0% found this document useful (0 votes)
97 views19 pages

02 - Programming Cycle

This document discusses the programming cycle which involves defining the problem, planning the solution by designing inputs and processes, developing the program, testing and debugging, and deployment. It provides examples of analyzing requirements for a university store program to calculate average daily sales. Learners are expected to explain the programming process and design inputs to gather data for calculating average daily sales.

Uploaded by

Abram Alfaro
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
97 views19 pages

02 - Programming Cycle

This document discusses the programming cycle which involves defining the problem, planning the solution by designing inputs and processes, developing the program, testing and debugging, and deployment. It provides examples of analyzing requirements for a university store program to calculate average daily sales. Learners are expected to explain the programming process and design inputs to gather data for calculating average daily sales.

Uploaded by

Abram Alfaro
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 19

Module 2 – Programming Cycle

1
Module 2 – Programming Cycle

STANDARDS AND COMPETENCIES

Content Standard: The learner shows an understanding of appropriate knowledge and practices
in designing a computer application.
Performance Standard: The learner develops design solutions based on given requirements and
specifications.
Most Essential Learning Competency:
At the end of this module, the students must be able to:
• explain how a program is being developed.

HOW TO USE THIS MODULE

This module is for you to accomplish at home. You can work at your own pace and allow
self-discovery of the concept through activities that you will perform. Learning activities were
also selected to enable independent learning, aiming to develop students' critical thinking and
problem-solving skills.

Read the simple instructions below of this module to explore how our lives are as
programmers.
1. Follow carefully all the contents and instructions indicated on every page of this module.
2. Write in your notebook the concepts about the lessons. Writing enhances learning, which
is essential to develop and keep in mind.
3. Perform all the provided activities in the module. Practice is a vital component to learn
programming and to think logically and critically.
4. If there is a need for support, please do not hesitate to ask for my help.
5. Enjoy studying!

2
Module 2 – Programming Cycle

EXPECTATIONS

This module will discuss how to come up with programs that will be meet user
requirements and expectations.
After this module, you are expected to perform the most essential learning competency.
Specifically, you are expected to:
• explain what programming is and its learning benefits.
• discuss what tasks are done in each programming step.

PRE-TEST

Instruction: True or False. Write T if the statement is true. Write F if the statement is false.
________ 1. Programming requires logical thinking.

________ 2. Go directly to a computer to code the program solution.

________ 3. A program is a set of instructions that a computer follows.

________ 4. Errors in a program can be due to incorrect writing of syntax.

________ 5. Flowcharts can show each instruction that will be done by the computer.

INTRODUCTION

There is a higher dependence on technology we can observe in our daily lives, particularly
in mobile phones, computers, and the Internet, because of the applications and websites we use
there, which are essential for us to use for different reasons.

3
Module 2 – Programming Cycle

The applications and websites we usually use are products of simple to complex
programming. Thus, it is essential that Programming is understood and the different concepts
related to it.

Activity 1: Programming Defined


Learning Objective: The student must be able to explain what programming is and its learning
benefits.

So, looking back on your use of computers, what is computer programming? Please write
your answer on the space provided.

MOTIVATION

Programming is an essential skill for those who would be involved in the field of
information technology (IT). To better understand the wonder of learning programming, please
watch the video by clicking the link https://www.youtube.com/watch?v=2-VKC8g2u1Y or by
scanning the QR code below.

4
Module 2 – Programming Cycle

Activity 2: Benefits in Learning Programming


Learning Objective: The student must be able to explain what programming is and its learning
benefits.

Answer the following questions after watching the video.


a. Choose one person featured in the video. Discuss what he/she talks about
programming.

b. After watching the video, identify and explain the benefits of acquiring programming
skills?

5
Module 2 – Programming Cycle

INSTRUCTION

PROGRAMMING DEFINED
Programming is a process of developing programs. Programming aims to create a set of
instructions that computers use to perform specific operations or exhibit desired behaviors. It
often requires expertise in many different subjects, including knowledge of the application
domain, specialized algorithms, and formal logic.
The set of instructions is compiled in programs that become part of what we called
software. These programs contribute to the accomplishment of what that software intends to
do for the user.
The program written by a programmer is called the source code.

PROGRAMMING CYCLE
Since programming is a process, it is composed of different steps to develop a program.

STEP 1. DEFINE THE PROBLEM.


As a programmer, you must identify user requirements based on the current scenario and
what the users or the organization want to achieve with the software in the future. In
determining user requirements, you must consider the following guide questions:
a. What does the program required to solve or provide as a result? (OUTPUT
REQUIREMENT)
b. What data are needed to solve the problem? (INPUT REQUIREMENT)
c. What formula (for problems needing some computations) or rules that data must
comply or not comply with to solve the problem? (PROCESS REQUIREMENT)

6
Module 2 – Programming Cycle

Activity 3: Define the Problem


Learning Objective: The student must be able to discuss what tasks are done in each
programming step.

Problem Scenario: The University Store sells different school supplies within the campus. They
are open every weekday from 8:00 am to 5:00 pm. The University Store asked your
help in developing a program for them to determine their average daily sale in a week.

What is your analysis of the user's requirements based on the problem scenario by
answering the guide question given in the discussion?

Guide Questions Answer


What does the program
required to solve or
provide as a result?
(Output Requirements)

What data are needed to


solve the problem?
(Input Requirements)

What formula (for


problems needing some
computations) or rules
that data must comply or
not comply with to solve
the problem?
(Process Requirement)

7
Module 2 – Programming Cycle

STEP 2. PLANNING THE SOLUTION.


The typical way or logical sequence on solving the problem is to follow the figure below.

a. Input. The first step in coming up with a program is to first get the necessary data
from the user from Step 1. You cannot produce any result or output without data to
process. To begin with, you cannot come up with the sum without actually knowing
what to add.

You need to plan how to input or gather all the data necessary for processing from
the user. Later on, you need to select what input device can easily accept and get
data accurately will less prone to human error. Cost is also a consideration when
buying the input device.

Activity 4: Planning for Input Design


Learning Objective: The student must be able to discuss what tasks are done in each
programming step.

Problem Scenario: The University Store sells different school supplies within the campus. They
are open every weekday from 8:00 am to 5:00 pm. The University Store asked your
help in developing a program for them to determine their average daily sale in a week.

What is/are the users' input requirement(s) based on the problem scenario by answering
the guide question given in the discussion based on Step 1.

8
Module 2 – Programming Cycle

Using the criteria mentioned in the discussion, what input device will you choose to get
the users' input requirement(s), keyboard, or a barcode reader?

Criteria Keyboard Barcode Reader


What will be the
instructions/processes
of getting input
requirements using the
device?
How easy will it take to
accept the input
requirements from the
user using the device?

How accurate can you


accept the input
requirements using the
device?

How prone from errors


can happen when
accepting input
requirements using the
device?
How costly will it be
when buying the
device to accept the
input requirements?

Conclusion: Which is the best option in getting the input requirements from the user? Explain
your answer.

Input Design Plan

9
Module 2 – Programming Cycle

b. Process. After these data were gathered, you can plan the different steps to
manipulate data, including performing some mathematical or logical operations from
Step 1. Take note that these steps or instructions that you provide should be
sequenced logically to produce the correct result or output.

Activity 5: Planning for Process Design


Learning Objective: The student must be able to discuss what tasks are done in each
programming step.

Problem Scenario: The University Store sells different school supplies within the campus. They
are open every weekday from 8:00 am to 5:00 pm. The University Store asked your
help in developing a program for them to determine their average daily sale in a week.

What will be the instructions you will provide the computer to manipulate the data inputs
to produce the results? Again, these steps or instructions you must provide should be sequenced
logically to produce the correct result or output.

Actual Process Design Plan

c. Output. The last step is to plan how the results or output would be shown to the user
based on Step 1. This step may include what output device to use to show the result
and formats to be applied to the results when displayed in an output device.

Activity 5: Planning for Output Design


Learning Objective: The student must be able to discuss what tasks are done in each
programming step.

Problem Scenario: The University Store sells different school supplies within the campus. They
are open every weekday from 8:00 am to 5:00 pm. The University Store asked your
help in developing a program for them to determine their average daily sale in a week.

10
Module 2 – Programming Cycle

Things to Do Actual Output Design Plan


What is/are the output
requirements of the problem
scenario? (Based on Step 1)

What output device will be


used to show the output
requirements?

What formats would you


apply to show the output to
the users accurately?

When put together, these plans become a logical sequence of steps helpful in doing
calculations, data processing, and automated reasoning. This logical sequence of steps is called
algorithms. These algorithms are implemented in different books, either as pseudocodes or
flowcharts.

Pseudocode is an implementation of an algorithm in annotations and informative text written in


plain English. Below is an example of pseudocode that computes for the sum of two numbers.

Step 1. Get the 1st number (X) from the user.


Step 2. Get the 2nd number (Y) from the user.
Step 3. Add the two numbers, X and Y, to get the sum.
Step 4. Display sum.

A flowchart, on the other hand, is a graphical representation of an algorithm. It shows


the step-by-step solution to a given problem as boxes of various kinds, and their order by
connecting these with an arrow. The next figure shows the flowchart implementation that
computes for the sum of two numbers and will be discussed in detail in Module 3.

11
Module 2 – Programming Cycle

Start

Get No1

Get No2

Sum = No1+No2

Print Sum

End

d. User Interface (UI) Design. According to techterms.com, a user interface is how a


person controls a software application or hardware device. Please be reminded that
we have to design the user interface with the users in mind as developers. Though it
is not part of the logical sequence of steps to solve a problem, an excellent user
interface provides a "user-friendly" experience, allowing the user to naturally and
intuitively interact with the software or hardware.

For hardware, these may include the buttons that we press to operate some and the
screen or lights showing its operations' progress. Our user interface is the screen or
window in software that we see where we type data and click buttons and other
objects to do some tasks on our computer, such as the login screen of our Learning
Management System.

12
Module 2 – Programming Cycle

STEP 3. CODING THE SOLUTION.


Since there is a plan that guides you on solving the problem, it can now be easy to develop
a program. What you just need is a programming language that will help you out in this task of
developing applications.
According to computerhope.com, a programming language is a computer language that
programmers use to develop software programs, scripts, or other sets of instructions for
computers to execute that control a machine's behavior. Current programming languages used
in the industry include python, Java, C, and C#. In our class, we will be using C# to develop
programs primarily focused on developing desktop applications.
Using a programming language, we have to be concerned about the following:
a. Commands – Each programming language contains a set of commands that we can
use to instruct our computer on what to do. Each command can make the computer
execute something. It follows specific rules in writing them referred to as syntax.
Please take note that your computer may not follow your instruction if you cannot
follow the syntax of a command instruction and provide them in a logical sequence.

b. Data – Each programming language has methods on how to represent them inside the
computer. As a programmer, you must utilize a better approach in storing data since
it can help in easy retrieval and manipulation as data are processed during the
developed program's execution.

c. Application – Each programming language can do different types of applications. As


a programmer, we must study where a particular programming language can be used
in developing applications. There are programming languages used for creating
desktop applications. There are also programming languages that are used for web
programming or for developing mobile apps.

13
Module 2 – Programming Cycle

The figure shows the different concerns discussed. Console.Write(), Console.WriteLine()


and Console.ReadLine() are just a few of the commands you need to learn. No1, No2, and sum
are called variables to store data needed in the program's execution. The program is written in
C# and solves the problem by creating a console application.
STEP 4. CHECKING OUT THE PROGRAM
After the program has been developed, the programmer must check whether the
program is running based on expected results or output. This step is called testing. During this
test, errors or bugs hinder the correct results from being shown by the user. Examples of types
of errors that may happen are the following:
a. Syntax Errors – errors that occur when commands are not written in its proper syntax.

b. Run-time Errors – errors that occur during program execution with some leading to
program crash. Example of which is Division by Zero.

c. Logical Errors - errors in a program's source code that gives way to unanticipated and
erroneous behavior producing incorrect output. A wrong way of designing the
solution of the program may cause this error.

STEP 5. DOCUMENT THE PROGRAM


This step is being done to ensure support to the ones using or maintaining the program.
The lifespan of the program may be more than the years spent by the developer in the
organization. Thus, it is beneficial to have some documentations to train new employees who
will handle the application.
a. User Manual – documentation that users can read to understand how the program
operates quickly.

b. Developer's Manual – documentation that developers can read to easily understand each
part of the codes is written in the program for maintenance purposes.

These documentations may be a hardcopy document, but currently, users are being
assisted by pressing F1 or Help to open the program's documentation. This support may be
provided either as online or offline support.

14
Module 2 – Programming Cycle

SUMMARY

Computer programming does not mean going directly to the computer and start creating
the program. Each step of the programming cycle must be done one at a time to ensure that
everything goes well. This step is especially important when dealing with a large project with
many user requirements. Client participation is also important in program development because
they understand better the process more than us. Thus, we have to develop the program with
the user or client in mind.

PRACTICE

Activity 6: Pseudocode
Learning Objective: The student must be able to explain how a program is being developed.

Problem Scenario: Make pseudocode that will compute for the discounted price of a product
on sale.

You must pair with a classmate for this activity. Create a Google document to be shared
with both of you for easy collaboration of ideas. The final output must be saved as a pdf file and
submitted through Blackboard on or before the set deadline.
Step 1: Define the Problem

Requirement Answer
Output Requirements

Input Requirements

Process Requirements

15
Module 2 – Programming Cycle

Step 2. Plan the Solution

PSEUDOCODE

ENRICHMENT

Activity 7: Programming Self-Reflection


Learning Objective: The student must be able to understand the work behind software
development deeply.

In a blog by Orange and Bronze CEO Mr. Calen Legaspi, he gave ideas on Jollibee's
#ChickenSad issue that happened in 2014. Make a reflection paper on the contents of the article
by answering the guide questions below:
a. What is all about the #ChickenSad issue of Jollibee all?
b. What realization do you have in performing your role as an IT professional when
dealing with clients like Jollibee after reading the blog?

16
Module 2 – Programming Cycle

Please click the link http://calenlegaspi.blogspot.com/2014/08/jollibee-chickensad-it-


management-case.html or the QR code below to view the whole article as part of your readings.
Your reflection paper will be submitted on Blackboard and will be subjected to a plagiarism
checker for the reflection paper's originality.

EVALUATION

Activity 8: Initial Design Plan


Learning Objective: The student must be able to explain how a program is being developed.

Performance Check:
The Garden Café is offering delicious food at affordable prices for its Adamson University
community. To ensure that quality service is met, they would like to provide fast and accurate
food orders computation. They ask your help as a programmer to develop an application that
will improve their cashiering/payment system.
Current Setup of the Cashiering/Payment System and Client’s Program Requirements
1. Garden Cafe is selling five (5) ice-blended coffee drinks. These are caramel (P150),
mocha (P140, chocolate (P130), vanilla (P110), matcha (P170).
2. The cashier gets the customer’s choice of drinks and the number of orders for those
drinks.
3. The client likes to see the total amount of purchase per drink.
4. The client likes to see the total amount purchased.
5. The client needs to apply a 10% VAT on the total amount purchased.
6. The client needs to see the total amount to be paid by the customer after deducting
VAT.
7. The client must accept payment from the customer and show the change (if there is
any).

17
Module 2 – Programming Cycle

Initially, they would like to see what is in your mind regarding the program they needed.
Your goal is to provide an analysis of the client's requirements by proposing a user interface
design to show what will happen with the system.
Instruction:
1. The activity will be done individually.
2. The design of the user interface can be done in any software you are comfortable in
using.
3. Submission requirements:
a. The final output will be placed on the template document that will be provided on
Blackboard. The template will be composed of spaces to write your understanding
of the user requirements and the user interface design.
b. Correctly name the document file with the prescribed filename to be given in
Blackboard.
c. The output must also be submitted on Blackboard on or before the set deadline
for grading purposes.
4. Your user interface design will be evaluated using a rubric based on specification,
analysis, design, and on-time delivery, as shown below.

Criteria 4 3 2 1
Specification • The goals of the • Most project • The design plan • A design plan does
project are carried components are shows a not show a full
out thoroughly in thoroughly carried sufficient understanding of
the design plan. out in the design understanding of what is required to
• There is an plan. what is required be done.
excellent • Understood most to be done.
understanding of the
requirement of requirements of
the client. the client
Analysis • Evidence that the • Good • A reasonable • There is some
system being understanding of understanding of attempt to
analyzed is well the system being the system being understand the
understood. analyzed. analyzed; some system.
• Analysis clear, • It describes all of misconceptions. • Missed some
organized, and the essential • It describes most significant
complete. features of the of the essential features of the
• Essential points system in good features of the system or not
are identified and detail. system in some sufficiently
explained well. detail. specific.
• Unimportant
features
misclassified as
necessary.

18
Module 2 – Programming Cycle

Design • There is correct, • The design is • There are some • There is a slight
complete, and mostly complete evidence and attempt at the
understandable and in a logical description of problem.
design. order. the process used • There is limited
• There is a clear • There are good in the design. evidence or a
and evident evidence and a • Excellent figures weak description
systematic design description of the somewhat of the organized
process applied. process used in labeled and design process.
• Good figures used the design. described. • Figures hard to
where • Clear figures, • Steps to the understand,
appropriate. mostly labeled solution shown mostly unlabeled,
• Figures labeled and described. in some cases. not well described.
and described.
Submission The student The student The student The student
submitted the submitted the submitted the submitted the
output days before output days on the output a day late output two (2) days
the deadline. day of the deadline. after the deadline. after the deadline.
The student Two (2) of the three One (1) of the No submission
followed all (3) submission three (3) requirements were
submission requirements were submission followed.
requirements. followed. requirements was
followed.

REFERENCES

• https://www.youtube.com/watch?v=2-VKC8g2u1Y
• https://www.geeksforgeeks.org/how-to-write-a-pseudo-code/
• https://techterms.com/definition/user_interface
• https://www.computerhope.com/jargon/p/programming-language.htm
• https://techterms.com/definition/runtime_error
• http://calenlegaspi.blogspot.com/2014/08/jollibee-chickensad-it-management-case.html

19

You might also like