0% found this document useful (0 votes)
8 views35 pages

Programming Fundamentals Overview

The document outlines the Programming Fundamentals course at IBN SINA University, detailing the program development cycle, algorithm creation, and various programming constructs such as flowcharts and pseudocode. It emphasizes the importance of problem-solving skills and includes course objectives, contents, and assessment methods. Additionally, it provides guidelines for testing, debugging, and documenting programs.

Uploaded by

mohammedsaif4816
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)
8 views35 pages

Programming Fundamentals Overview

The document outlines the Programming Fundamentals course at IBN SINA University, detailing the program development cycle, algorithm creation, and various programming constructs such as flowcharts and pseudocode. It emphasizes the importance of problem-solving skills and includes course objectives, contents, and assessment methods. Additionally, it provides guidelines for testing, debugging, and documenting programs.

Uploaded by

mohammedsaif4816
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

‫جامعة الزعيم األزهري‬ Faculty of Computer Science

First year 2025

Programming Fundamentals
• Lec1
• Introduction
Prepared by: [Link] Elbasheir

Academic Year 2025- 2026


1
Programming
Fundamentals
Lec1
Introduction

Dr Mohammed Elbasheir
Credit Hours: 3
Assessment:
Tutorials: 20%,
NoteBook 20%
Mid-term: 20%,
Final Exam: 40%

IBN SINA University-Faculty of Information Technology


INTRODUCTION
❖The computers work on a set of instructions called computer program,
❖A person who is responsible for designing, writing, and modifying computer
programs is known as a computer programmer.
• System programmers write programs, which provide interface and functionality to the
hardware components. These programs help the computer to boot or facilitate its general
functioning. For example, [Link]
• An application programmer writes programs to fulfil a specific task such as inventory
control and payroll system.

❑ Note: The collection of instructions forms a program and a group of programs


forms software.
Program Development Cycle

• The programmer has to determine the problem that needs to be


solved.

• There are different approaches to problem solving.

• One common approach is to use the program development


cycle, The development cycle of a program includes the
following phases
Program Development Cycle
Program Development Cycle
1. Problem Analysis:
• In this phase, the problem is analyzed precisely and completely.
• Based on one's understanding, the developer knows about the scope within which the problem
needs to be developed.
2. Task Analysis:
• After analyzing the problem, the developer needs to develop various solutions to solve the given
problem.
• From these solutions, the optimum solution is chosen, which can solve the problem comfortably
and economically.
3. Algorithm Development:
• After selecting the appropriate solution, an algorithm is developed to depict the basic logic of the
selected solution.
• An algorithm depicts the solution in logical steps (sequence of instructions). Further, the algorithm
is represented by flowcharts, decision tables and pseudocodes.
• These tools make program logic clear and they eventually help in coding.
• These tools are also part of documentation, which helps the user in understanding the program
logic.
Program Development Cycle
4. Algorithm Testing:
• Before converting the algorithms into actual code, it should be checked for accuracy.
• To do this, test data need to be ‘walked through’ each step in the algorithm to verify that the
instructions described in the algorithm actually perform the required functions.
• The main purpose of checking algorithm is to identify major logical errors at an early stage,
because logical errors are often difficult to detect and correct at later stages.
• The testing also ensures that the algorithm is a ‘true’ one and it should work for both
normal and unusual data.
5. Coding:
• After meeting all the design considerations, the actual coding of the program takes place in
the chosen programming language.
• Depending upon application domain and available resources, a program can be written by
using computer languages of different levels such as machine, assembly or high-level
languages.
Program Development Cycle
6. Testing and Debugging:
• It is not unusual for the initial program code to contain errors.
• These errors may be in the form of logical errors (semantic errors) or due to incorrect use of
programming language (grammatical errors also known as syntax errors).
• A program compiler and programmer-designed test data machine test the code for syntax
errors.
• The results obtained are compared with results calculated manually from these test data.
Depending upon the complexity of the program, several rounds of testing may be required.
7. Documentation:
• Once the program is free from all the errors, it is the duty of the program developers to
ensure that the program is supported by suitable documentation. These documents should
be supplied to the program users.
• Documenting a program enables the user to operate the program correctly.
• It also enables other persons to understand the program clearly so that it may, if necessary,
be modified, or corrected by someone other than the original programmer.
Program Development Cycle
7. Implementation:
• After documentation, the program is installed on the end user's machine.
• The user is also provided with all the essential documents to understand how the program
works.
• The implementation can be viewed as the final testing because only after using the program,
the user can point out the drawbacks (if any) and report them to the developers. Based on the
feedback from the users, the programmers can modify or enhance the program.
8. Maintenance and Enhancement:
• After the program is implemented (loading and executing the program on user's computer),
it should be properly maintained by taking care of the changing requirements of its users and
system.
• The program should be regularly enhanced by adding additional capabilities.
• This phase is also concerned with detecting and fixing the errors, which were missed in
testing phase.
• Since this step generates user feedback, the programming cycle continues as the program is
modified or reconstructed to meet the changing needs.
ALGORITHM
❖An algorithm is defined as a finite sequence of explicit instructions that when
provided with a set of input values produces an output and then terminates.

❖Properties of algorithm are as follows:


• There must be no ambiguity in any instruction.

• There should not be any uncertainty about which instruction is to be executed next.

• The description of the algorithm must be finite. An algorithm cannot be open-ended.

• It should terminate after a finite number of steps.

• It must be general enough to deal with any contingency.

• We use algorithms in our daily life.


Algorithm: To determine largest of three numbers
1. Start
2. Read three numbers A, B, C
3. Find the larger number between A and B and store it in MAX_AB
4. Find the larger number between MAX_AB and C and store it in
MAX
5. Display MAX
6. Stop
FLOWCHART

• A flowchart is a pictorial representation of an algorithm in which the


steps are drawn in the form of different shapes of boxes and the logical
flow is indicated by interconnecting arrows.

• The boxes represent operations and the arrows represent the


sequences in which the operations are implemented.

• The primary purpose of the flowchart is to help the programmer in


understanding the logic of the program.
Guidelines for Preparing Flowcharts
1. The flowchart should be clear, neat and easy to follow.
2. It must have a logical start and finish.
3. In drawing a proper flowchart, all necessary requirements should be listed in logical order.
4. Only one flow line should come out from a process symbol.

5. Only one flow line should enter a decision symbol. However, two or three flow lines (one for
each possible answer) may leave the decision symbol.
6. Only one flow line is used with a terminal symbol.

7. Within standard symbols, write briefly. If necessary, use the annotation symbol to
describe data or process more clearly.
8. In case of complex flowcharts, connector symbols are
used to reduce the number of flow lines.
9. Intersection of flow lines should be avoided to make it a
more effective and better way of representing
communication.
[Link] is useful to test the validity of the flowchart by
passing through it with normal/unusual test data.
Flowchart Structures
• There are mainly three key constructs, which are used in drawing a flowchart.

• Sequence, where information can flow in a straight line. sequence


of operations consist of processes and input/output steps

• Selection (branched), where the decisions are made according to


some predefined condition.

• Repetition, where the logic can repeat in a loop, that is, where a
sequence of steps is repeated until the desired output is obtained.
DECISION TABLES
• A decision table is a way of representing an algorithm in a tabular form.

• It contains all the possible conditions for a specific problem and the corresponding
results using condition rules that connect conditions with results.

• It consists of rows and columns, divided into four separate quadrants.

• Decision tables are generally useful in situations where a number of decisions or


actions have to be taken depending on the input provided.
• Conditions: Contains a list of all the possible conditions pertaining to a problem.
• Condition Alternatives: Contains the condition rules (set of possible values for
each condition) of alternatives.
• Actions: Contains actions, which can be a procedure or operation to be
performed.
• Action Entries: Contains the action rules, which specify the actions to be
performed on the basis of the set of condition alternatives corresponding to that
action entry.
Pseudocode Structures
❖The ‘structured’ part of pseudocode is a notation for representing three general
programming constructs: sequence, selection and repetition.
❖These constructs represent the logic or flow of control in an algorithm.
❖Following are Keywords often used to indicate input, output and processing
operations.
• Input: READ, OBTAIN, GET and PROMPT
• Output: PRINT, DISPLAY and SHOW
• Compute: COMPUTE, CALCULATE and DETERMINE
• Initialize: SET and INITIALIZE
• Add One: INCREMENT
Flowchart and Pseudocode for Sequence Construct
Flowchart and Pseudocode for IF-THEN-ELSE-ENDIF
Selection Construct
Flowchart and Pseudocode for IF-THEN-ENDIF
Selection Construct
Flowchart and Pseudocode for CASE-ENDCASE Selection
Construct
CASE-ENDCASE Selection Construct
• A CASE construct indicates a multiway branch based on many conditions.
• CASE construct uses four keywords, CASE, OF, OTHERS and ENDCASE,
along with conditions that are used to indicate the various alternatives.
• CASE construct performs the same process as multiple IFs, but it is much easier to read and
write.
• Conditions are normally numbers or characters indicating the value of ‘Expression’, but
there can be English statements or some other notations that specify the condition under
which the given statement is to be performed.
• The OTHERS clause, used with its default sequence, is optional and is used to perform
those actions, which do not satisfy any of the specified conditions.
• Similar to ENDIF, ENDCASE indicates the end of the CASE structure.
Flowchart and Pseudocode for Repetition Looping
Construct
❖ Repetition (Looping) In DO WHILE-ENDDO
pseudocode, done by using specific
keywords,
• DO WHILE-ENDDO (the test is
performed at the top of the loop)
and
• REPEAT-UNTIL,(the test is
performed at the bottom of the
loop)
Flowchart and Pseudocode for Repetition Looping
construct
REPEAT-UNTIL
Program Testing And Debugging
• Before implementing the program on the user's system, it should be tested thoroughly to ensure that it is running
properly and giving desired results. This process of validating a program is known as testing.

• The process of detecting, isolating and correcting bugs in a program is known as debugging.

• The errors in a program can be classified into two categories:

• Syntax Errors: These errors occur when the rules of the programming language are not followed. These errors
are easier to correct because in case of such errors, programming languages provide a useful error message,
which gives an idea about what is wrong with the program.

• Logical Errors: A logical error is an error in planning the program logic. These errors are the most difficult to
detect, because no error message is produced in case of such errors.

• Two types of approaches, black box and white box testing, are applied to test a program.
1. Black Box Testing
❖Black box testing, also known as functional testing, is a testing technique where the internal architecture of the
item being tested is not necessarily known by the tester.

❖ The tester should only know about the inputs and the expected outcomes.

❖it should be performed by a person who has no prior knowledge about the program.

2. White Box Testing


❖White box testing, also known as glass box, structural, clear box and open box testing, is one of the most popular
testing approaches.

❖Explicit knowledge of the internal workings of the item being tested are used to select the test data.

❖White box testing uses specific knowledge of programming code to examine outputs.

❖The tester should read and use the source code of the applications being tested. He must apply test cases and
various inputs in order to test branches, conditions, loops and the logical sequence of statements being executed.
PROGRAM DOCUMENTATION
• Documentation refers to all written materials that help in
explaining the use and maintenance of a system or program.

• Proper documentation enables the user to understand the


program and acts as a reference tool for programmers, in case
modifications are required.
PROGRAMMING FUNDAMENTAL
• Course Name and Code: Programming Fundamentals ITC127
• Course Description:
• This course helps students to develop problem solving skills using programming
languages. Students are introduced to fundamentals of programming with emphasis
on primitive data types, control statements, methods and arrays. By the end of the
semester, students will be able to create simple programs.
• Course Objectives:
• Upon successful completion of the course, students will be able to understand
fundamentals of programming and gain practical skills to solve problems using
programs.
PROGRAMMING FUNDAMENTAL
• Course Contents:

• 1. An overview of computers and programming languages

• 2. Basic problem solving skills (algorithm, flowchart)

• 3. Primitive Data types and operations

• 4. Control Structures

• 5. Methods

• 6. Arrays

• Course Outcomes:

• By the end of this course the student will be able to

•  Discuss the importance of algorithms in the problem-solving process and using pseudo-code.

•  Gain valuable problem solving skills and programming techniques that will enable them to become proficient in elementary
programming.
PROGRAMMING FUNDAMENTAL
• Teaching Methods

• The course is taught in two Lectures (lecture and follow-up) and 3 hour lab session in the week.

• Course Assessments:

• • Tests, homework and tutorials. (25 %)

• • Lab work and practical exams (25%)

• • Final Examination. (50%)

• References

• • Liang. Daniel Y (2014), Introduction to Java Programming, 10th edition, Pearson;

• • Elliot B. Koffman and Ursula Wolz (2002), Problem Solving with Java, Update, 2nd edition , Addison Wesley

• • Felleisen, Findler, Flatt, and Krishnamurthi (2001) , How to Design Programs: An Introduction to
Programming and Computing , 1st edition, The MIT Press;

You might also like