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

ComProg Module - M6 Final

The document discusses algorithms, flowcharts, pseudocode, and data types for computer programming. It defines an algorithm as a step-by-step procedure to solve problems. The document also defines common data types like boolean, integer, string, and discusses using pseudocode and flowcharts for problem solving. An example problem on classifying student grades is provided along with the necessary pseudocode, flowchart, and data types.

Uploaded by

LEO JR GREFALDO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views

ComProg Module - M6 Final

The document discusses algorithms, flowcharts, pseudocode, and data types for computer programming. It defines an algorithm as a step-by-step procedure to solve problems. The document also defines common data types like boolean, integer, string, and discusses using pseudocode and flowcharts for problem solving. An example problem on classifying student grades is provided along with the necessary pseudocode, flowchart, and data types.

Uploaded by

LEO JR GREFALDO
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

COMPUTER PROGRAMMING .

NET
(Q3M1) ALGORITHMS, FLOWCHARTS, DATA TYPES, AND
PSEUDOCODES
DURATION : 3-4 WEEKS
INSTRUCTOR :
EMAIL :

NOTE: Write your answers on the answer sheet provided (Check the last page). DO NOT write anything on the module.
LESSON OBJECTIVES
 Classify programming languages and identify its usage, and enumerate the process in program development.
 Understand algorithm, use pseudocode and flowchart un problem solving; and
 Identify data types and variables.

LESSON DISCUSSION
Problem solving is a part of our everyday life. In computer programming, problem solving is inevitable too and it is actually one of the main reasons why a program is created. In this
lesson, we will learn the various concepts on how to plan a program’s output, step by step, using algorithm applied to pseudocode and flowchart. Identifying variables and the corresponding
data types will also be discussed in this lesson.

WHAT IS AN ALGORITHM?
Generally, an algorithm is a step-by-step procedure to solve problems. A guide for installing new software, a manual for assembling appliances, and even recipes are examples of an
algorithm. In programming, making an algorithm is exciting – they are expressed in a programming language or in a pseudocode.

Algorithm makes the whole procedure more efficient as well as consistent. It also helps in identifying decision points, processes, and essential variables to solve the problem. A
programmer can also see and determine easily the errors in a particular process using an algorithm.

On the other hand, structured design approach focuses on dividing programs, concentrates on each subprogram's task, and then later on combined them as a whole. This approach is
commonly used in big and complex object-oriented programs. This approach also works well if you are working on a team because a person or a group of people can be assigned on a specific
module or subprogram.

Identifying Required Links


In this substage functional and non-functional requirements are identified Functional requirements involve the task and the behavior of the system and its subdivided parts. Non-
functional requirements indicate the application or system's characteristics and quality. Say for example the system must output the name and average grade of a particular student. The last
name should appear first before the first name and the average mark should only be in 2 decimal places. Outputting the name and grade is the functional requirement for this particular program
and the non-functional requirement is the specification that the last name should be written first and the average grade's format must be in 2 decimal places to summarize, functional
requirements answer the question what a system must do and non-functional requirements answer the question how a system will do the specific task

WHAT IS A DATA TYPE?


A data type is a description of a specific data that can be stored in a variable, the amount of memory the item occupies and the operations it can be performed.
Common Language Common Language
Keyword Value Range Keyword Value Range
Runtime Type Structure Runtime Type Structure

Page | 1 Computer Programming .Net  Quarter 3  Module 4


Boolean System.Boolean A Boolean value – true or false Integer System.Int32 -2,147 483,648 to 2 147.483,647
Byte Long (long System.Int64 -9,223,372,036,854,775,808 to
System.Byte 0 to 255
integer) 9,223,372,036,854,775,807
Char Object System.Object Any type can be stored in a variable of
System.Char 0 to 65535
(class) type Object
Date System.Date Time January 1, 0001 to December 31, 9999 Short System.Int16 32,768 to 32.767
Decimal +79,228,162,514,264,337,593.543,950,335 Single (single System.Single 3,402823E+38 to -1.401298E-45 for
with no decimal point +/ precision negative values; 1.40129BE-45 to 3
7.9228162514264337593543950335 with floating-point 402823E+38 for positive values
System.Decimal
28 places to the right of the decimal,
smallest non-zero number is +/-
0.0000000000000000000000000001
-1.79769313486231E+308 to 4 System.String O to approx. 2 billion Unicode characters
Double
94065645841247E. 324 for negative (class)
(Double-
System.Double values, 4.94065645841247E-324 to String
Precision
1.79769313486231E+308 for positive
floating point)
values

 Boolean - can only contain two values, true or false. Yes or no or on and off is also possible. Byte - data type to be used if you want to store binary data (set of 0s and 1s). It is an
unsigned type that cannot contain negative values.
 Char - used to hold a single character, specifically a single unicode character. Unicode is a 16-bit character which represents all the letters and symbols of all major languages existing.
 Date - data type that holds date values, time values, or the combination of both.
 Decimal - holds decimal values up to 29 significant digits. It is specifically designed for financial calculations.
 Double - powerful data type that can hold even the smallest and the largest approximation of a real number.
 Integer - holds only whole number, but loads fast compare to other data types. Long - data type used to hold larger integer numbers.
 Object - holds objects’ addresses.
 Short - used to contain lesser value of whole number compared to data type Integer Programmers use this data type to optimize program runtime as well as to save memory.
 Single - like double data type, it is also used to contain floating point values. The difference is that it is used for much lesser values.
 String - data type used to hold set or multiple of characters, like words or sentences.

Sample Problem:
A teacher would like to create a program that will classify if a student's grade must be marked Passed or Failed. Any grades lower than 60 is considered failed. From this given Information,
please provide the necessary pseudocode, flowchart, and data type.

I. Pseudocode
If student's grade is greater than or equal to 60
You are already familiar with this pseudocode. It has been used as an example in the previous Print “Passed”
discussion from this pseudocode, we must create a flowchart. Remember that a flowchart is just a else
graphical representation of a pseudocode.  Print “Failed”

II. Start
Flowchart

Page | 2 Computer Programming .Net  Quarter 3  Module 4


Read
The flowchart is the representation of the pseudocode itself. Note that it is actually the same with the "Get
Temperature" flowchart. The only difference is the variable. A variable is a symbolic name given to an
unknown data. In the "Get Temperature flowchart, the variable is the temperature, while in the given
diagram, the variable is, of course, the student's grade.

III. Data Type

The next step is to identify the variable's data type. Let us first analyze the variable, which is the student's
grade. As we know, it can also contain decimal numbers and is usually in the scale of 0-100. The double
data type is the best data type for this variable since a student's grade is usually a real number (numbers
with decimal places).

ACTIVITY 1  Do the activity on the answer sheet provided.

Create a pseudocode and flowchart for a program that will classify whether the age inputted into the program is more than 60 or not. Age 60 or more should be able to get a discount of 20%
from stores. Your program shall print a message “Discount can be availed” if age is more than 60, however, when age is less than 60, your program should classify whether the person has a
disability or not. If there is a disability, then same discount can be availed, otherwise, your program shall show a message “No discount can be availed”.

POST-TEST  Modified True or False


Write your answer on the answer sheet provided. Identify if the following statements are true or false. If false, copy and write the term(s) that made it incorrect on your answer sheet.

1. Algorithm is a step-by-step procedure in solving a problem.


2. The aim of pseudocode is to make programming easier by using symbols.
3. Flowchart consists of 6 standard symbols namely: Terminator, Connector, Input/Output operation, and alteration

POST-TEST  Identification Double Boolean Short String


Long Variable Decimal Integer
Choose the best answer from the box  Char Single Date

1. It is used to contain lesser value of whole number compared to data type Integer. Programmers make use of this data type to optimize program runtime as well as to save memory.

2. Data type used to hold values like yes or no.

Page | 3 Computer Programming .Net  Quarter 3  Module 4


3. Data type used to hold single Unicode character.

4. Data type that is used to hold larger integer numbers.

5. Symbolic name for an unknown data.

NAME: GRADE / STRAND:

ANSWER SHEET
Activity 1

PSEUDOCODE:
FLOWCHART:

Page | 4 Computer Programming .Net  Quarter 3  Module 4


POST-TEST  MODIFIED TRUE OR FALSE

1. ______________________________________________

2. ______________________________________________

3. ______________________________________________

POST-TEST  IDENTIFICATION
4. ______________________________________________

5. ______________________________________________

6. ______________________________________________

7. ______________________________________________

8. ______________________________________________

Page | 5 Computer Programming .Net  Quarter 3  Module 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy