Professional Documents
Culture Documents
Cc101 Reviewer For Midterms
Cc101 Reviewer For Midterms
Cc101 Reviewer For Midterms
Computers are just machines which will not do anything unless the task are specified by the
users’ using programs that are executed into them.
Software/computer program is a collection of codes that instructs the computer on all the
processes that it must perform. Hardware is the physical components of a computer.
Program codes is the lists of instructions. Program coding/coding is the process of typing codes
into a computer. Programmers are the people who writes the program codes.
1. System Programmers
- People who create and maintain programs which are involved in the computer’s
basic operating functions like operating systems, utilities, and device drivers.
2. Application Programmers
- Ones who create and maintain programs that have specific functions such as Point of
Sale (POS) programs that calculate and generate the payroll report of a certain
company and others.
Steps in Programming
1. Planning
- Revolves around the determination of requirements, then setting the processes by
which goals are to be achieved.
2. Analysis
- Determine the precise objectives that you want to achieve to create a solution to the
presented problem. Output is the file generated/processed. File is a collection of
information. Input is the data that the program requires to produce the desired
result. Process is a mechanism for converting input to output.
3. Design
- We use this analysis to design a solution. Use modeling tools to guide you in
designing a solution to the problem such as flowcharts and algorithms.
4. Development
- Translate the design into a program.
5. Testing and Debugging
- Testing the problem’s solution on the computer overlaps with the design and
development phases. Bugs are computer errors and Debugging is the process of
correcting errors.
Documentation
- Means that you must create materials that will generally describe all the things you
did in the whole process of developing a project or a program.
Elements of Programming
1. Input
- Necessary information is collected at the start of programming.
2. Data
- This is the input/Raw value since nothing has been done to them.
3. Operations
- The data are then applied with the correct operations to manipulate it. The process.
4. Output
- The manipulated data will be extracted from the program and sent back to the user.
5. Conditional Execution/Branching
- Data can also be manipulated using this. There may be codes that require
comparison first before execution. Line by line execution.
6. Loops
- Looping/execute a set of instructions until the condition inside the loop statement
evaluates to false.
7. Subroutines
- Breaking data into small pieces and is executed at different locations in the program.
Programming Paradigms/Styles of programming
1. Procedural
- Running the codes line by line without skipping any of the statements.
2. Modular
- Turning a huge program into small ones with simpler codes.
3. Data Abstraction
- Hiding the attributes of the data making it appear more compound than more
primitive.
4. Object-Oriented Programming
- Represents concepts as “objects” that have specific attributes and methods.
CHAPTER 2: NUMBER SYSTEMS
Number system is a way how to represent numbers.
Digits are one symbols that represents a number. The number 143 consists of 3 digits, 1, 4 and
3.
Weight is the value of each digit position.
Decimal weight represents the value of each digit position of a decimal number such as UNITS
(100), TENS (101), HUNDREDS (102), THOUSANDS (103), etc.
Binary weights are enumerated as UNITS (20), TWOS (21), FOURS (22), EIGHTS (23), and so on.
Hexadecimal weights are enumerated as UNITS (160), SIXTEENS (161), and so on.
Decimal Number System - 10 digits/base (0, 1, 2, 3, 4, 5, 6, 7, 8, and 9)
Binary Number System – 2 digits/base (0 and 1)
Hexadecimal Number System – 16 digits/base (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, and F)
STEPS:
a. Group the digits of the binary number from the last digit by 4’s.
b. If the last group is less than 4 digits, add zeros to the left to make it 4. Ex. 11, add 2 zeroes to
make it 0011. All the groups should have 4 digits.
c. From the Table of Equivalences, write below the corresponding hexadecimal number
equivalent of each group.
Mas madalasan na ginagamit double dahil mas precise or accurate and lilitaw na sagot kesa sa
float. "Float should only be in cases when we're dealing with small decimal values" Ginagamit
lng ang float if maliliit na decimals and ginagamit tulad ng 2.01, 1.50 at etc
Short has a memory size of 2 bytes, whereas int has a memory size of 4 bytes. Using short can
conserve memory than using int which can be important when using a large array. Use int
unless you conserving memory is critical, or your program uses a lot of memory (e.g., many
arrays). Long is a large range of whole numbers. – Same as double and float.
Variables
A variable’s value can be changed. The syntax for variable is ---
data_type variable_name;
int x;
float interest_rate;
char alias;
Mathematical Operators