Professional Documents
Culture Documents
Week 1
Learning Objectives:
Key Topics
1.1 Introduction
1.2 Evolution of Programming and Languages
1.2.1 History of Programming Language
1.3 Problem Solving through Programming
1.3.1 Creative thinking, Critical thinking
1.3.2 Steps involved in solving a problem
1.3.3 Software Development Life Cycle
1.4 Writing Algorithm / Pseudocode
1.4.1 Properties and Rules of writing Algorithm
1.4.2 Sample Algorithms
1.5 Flowchart
1.5.1 Flowchart Symbols and guidelines for preparing flowcharts
1.5.2 Sample Flowcharts
1.6 Pseudocode
1.6.1 Guidelines for Writing Pseudocode
1.6.2 Advantages of Pseudocode
1
1.7 Evolution of C language
1.7.1 History of C Programming Language
1.7.2 Characteristics of C
1.8 Summary
1.1 Introduction
Problems are at the center of what many people do at work every day. Whether you're solving a
problem for a client (internal or external), supporting those who are solving problems, or discovering
new problems to solve, the problems you face can be large or small, simple or complex, and easy or
difficult.
A fundamental part of every manager's role is finding ways to solve them. So, being a confident
problem solver is really important to your success. Much of that confidence comes from having a
good process to use when approaching a problem. With one, you can solve problems quickly and
effectively. Without one, your solutions may be ineffective, or you'll get stuck and do nothing, with
sometimes painful consequences.
Solving problems is the core of computer science. Programmers must first understand how a human
solves a problem, then understand how to translate this "algorithm" into something a computer can
do, and finally how to "write" the specific syntax (required by a computer) to get the job done. It is
sometimes the case that a machine will solve a problem in a completely different way than a human.
Computer Programmers are problem solvers. In order to solve a problem on a computer you must:
2. Determine the steps to transform the information from one representation into another.
2
3) Language used to facilitate communication about the task of organizing and
manipulating information
4) Language used to express algorithms precisely
In the 1940s, the first recognizably modern electrically powered computers were created. The limited
speed and memory capacity forced programmers to write hand-tuned assembly language programs. It
was eventually realized that programming in assembly language required a great deal of intellectual
effort.
1883:
In the early days, Charles Babbage had made the device, but he was confused about how to
give instructions to the machine, and then Ada Lovelace wrote the instructions for the
analytical engine.
The device was made by Charles Babbage and the code was written by Ada Lovelace for
computing Bernoulli’s number.
First time in history that the capability of computer devices was judged.
3
1949: Assembly Language
1952: Autocode
1957: FORTRAN
1958: ALGOL
1959: COBOL
It stands for COmmon Business-Oriented Language.
In 1997, 80% of the world’s business ran on Cobol.
The US internal revenue service scrambled its path to COBOL-based IMF (individual
master file) in order to pay the tens of millions of payments mandated by the coronavirus
aid, relief, and economic security.
1964: BASIC
1972: C
4
C is the mother of almost all higher-level programming languages like C#, D, Go, Java,
JavaScript, Limbo, LPC, Perl, PHP, Python, and Unix’s C shell.
1972 SQL
1978 MATLAB
1983 Objective- C, C++
1990 Haskell
1991 Python
2000 C#
2009 Go
2011 Kotlin
2014 Swift
Let’s understand what a problem is and how a computer helps us in solving a problem.
The problem is any question that involves doubt, uncertainty, difficulty, a situation whose
solution cannot be immediately found. Problems cannot be solved straightforwardly, and
they need thought processing.
Consider traveling from one city to another city is a problem, and it can be solved with a
series of actions.
5
1.3.1 Creative Thinking and Critical Thinking
Creative Thinking
Critical Thinking
q Engages a diverse range of intellectual skills and activities that are concerned with
evaluating information, our assumptions and our thinking processes in a disciplined
way so that we can think and assess information more comprehensively
q It is Analytical, Judgmental and Selective
q Thinking critically allows a programmer in making choices
6
1.3.2 Steps Involved in Solving a Problem
1) Defining the Problem: State the problem as clearly as possible. For example: “I don’t
have enough money to pay the bills.”Be specific about the behaviour, situation, timing,
and circumstances that make it a problem. For example: “I need to pay the phone and
gas bills, and I don’t have enough money to cover both this month.”
2) Planning the Solution:List all the possible solutions; don’t worry about the quality of
the solutions at this stage.
If you allow yourself to be creative, you may come up with some solutions that you
would not otherwise have thought about. Then go through and eliminate less desirable
or unreasonable solutions.
3) Coding the Program: Choose a suitable programming language that is suitable for you
and code the logic of each solution that you were able to find.
4) Testing the Program: Compile and run each program successfully and check the
answer received. Evaluate how effective the solution was and then decide whether the
existing solution needs to be revised or not.
5) Documenting the Program: Documentation is about lying about all the steps that you
performed to solve a problem. It is necessary so that other programmers or users can
understand what exactly is done to reach a solution.
1) Planning: In the Planning phase, project leaders evaluate the terms of the project. This includes
calculating labor and material costs, creating a timetable with target goals, and creating the
project’s teams and leadership structure.Planning can also include feedback from stakeholders.
Stakeholders are anyone who stands to benefit from the application. Try to get feedback from
potential customers, developers, subject matter experts, and sales reps.Planning should clearly
define the scope and purpose of the application. It plots the course and provisions the team to
effectively create the software. It also sets boundaries to help keep the project from expanding or
7
shifting from its original purpose.
2) Analysis: In analysis Defining requirements is considered part of planning to determine what the
application is supposed to do and its requirements. For example, a social media application would
require the ability to connect with a friend. An inventory program might require a search
feature.Requirements also include defining the resources needed to build the project. For
example, a team might develop software to control a custom manufacturing machine. The
machine is a requirement in the process. After defining requirements analyse the problem and
understand what the problem wants to convey.
3) Design: The Design phase models the way a software application will work. Some aspects of the
design include:
Architecture – Specifies programming language, industry practices, overall design, and use
of any templates or boilerplate
User Interface – Defines the ways customers interact with the software, and how the
software responds to input
Platforms – Defines the platforms on which the software will run, such as Apple, Android,
Windows version, Linux, or even gaming consoles
Programming – Not just the programming language, but including methods of solving
problems and performing tasks in the application
Communications – Defines the methods that the application can communicate with other
assets, such as a central server or other instances of the application
Security – Defines the measures taken to secure the application, and may include SSL traffic
encryption, password protection, and secure storage of user credentials.
4) Implementation: This is the actual writing of the program. A small project might be written by a
single developer, while a large project might be broken up and worked by several teams. Use an
Access Control or Source Code Management application in this phase. These systems help
developers track changes to the code. They also help ensure compatibility between different team
projects and to make sure target goals are being met. The coding process includes many other
tasks. Many developers need to brush up on skills or work as a team. Finding and fixing errors
and glitches is critical. Tasks often hold up the development process, such as waiting for test
results or compiling code so an application can run. SDLC can anticipate these delays so that
developers can be tasked with other duties.
5) Testing and Integration: It’s critical to test an application before making it available to users.
Much of the testing can be automated, like security testing. Other testing can only be done in a
specific environment – consider creating a simulated production environment for complex
deployments. Testing should ensure that each function works correctly. Different parts of the
application should also be tested to work seamlessly together—performance test, to reduce any
hangs or lags in processing. The testing phase helps reduce the number of bugs and glitches that
users encounter. This leads to a higher user satisfaction and a better usage rate.
6) Maintenance: At this point, the development cycle is almost finished. The application is done
and being used in the field. The Operation and Maintenance phase is still important, though. In
this phase, users discover bugs that weren’t found during testing. These errors need to be
8
resolved, which can spawn new development cycles.
In addition to bug fixes, models like Iterative development plan additional features in future
releases. For each new release, a new Development Cycle can be launched
Notations
1) Starting point
2) Step Numbers – Positions in Algorithm
3) Incoming Information – Input
4) Control Flow – Order of evaluating Instructions
5) Statements
6) Outgoing Information - Output
7) Ending Point
q Properties of an algorithm
q Finite: The algorithm must eventually terminate
q Complete: Always give a solution when one exists
q Correct (sound): Always give a correct solution
9
q Rules of Writing an Algorithm
q Be consistent
q Have well Defined input and output
q Do not use any syntax of any specific programming language
q Algorithm development process consists of five major steps
q Step 1: Obtain a description of the problem
q Step 2: Analyze the problem
q Step 3: Develop a high-level algorithm
q Step 4: Refine the algorithm by adding more detail
q Step 5: Review the algorithm
10
1.5 Flowcharts
Flowchart Symbols
Terminal:
The oval symbol represents Start, Stop, and Halt in a program. The terminal is used as the
start and stop symbols in the flowchart. The Halt symbol is used to represent an error
condition in the program.
11
Input / Output: A parallelogram represents the Input and Output functions. The
instructions used in the program related to input-output are written in a parallelogram.
Processing: The rectangular box represents the processes. They consist of operations such as
add, subtract, multiply, divide, or any other formulas required as per the program.
Decision: The diamond shape represents the decisions or conditions which include two-way
output, such as if the condition satisfies then "True" or "False. "True / False can also be
represented with “yes”/"no."
Connectors: A small circle represents a connector. It is used when the flowchart needs to be
continued on the nextpage.
Flow lines: Flow lines connect the symbols and direct the reader from the initial stage to the
final stage of the program.
12
q Only one flow line should come out of a Process symbol
q Only one flow line should enter a Decision symbol, but multiple lines may leave the
Decision symbol
q Write briefly within Symbols
q Use connectors to reduce number of flow lines
q Avoid intersection of flow lines
q Test Flowchart through simple test data
q Clear, Neat and easy to follow
13
1.6 Pseudo code
14
5. WRITE name, gross, deduction, net pay
Step 5: End
q Supported by C library
q Many of C’s principles and ideas were derived from the earlier language B
q BCPL and CPL are the earlier ancestors of B Language (CPL is common
Programming Language)
q In 1967, BCPL Language ( Basic CPL ) was created as a scaled down version of
CPL
q As many of the features were derived from “B” Language the new language was
named as “C”.
Characteristics of C
q Low Level Language Support
q Structured Programming
q Extensive use of Functions
q Efficient use of Pointers
16
q Compactness
q Program Portability
q Loose Typing
q Advantages of C
q Compiler based Language
q Programming – Easy & Fast
q Powerful and Efficient
q Portable
q Supports Graphics
q Supports large number of Operators
q Used to Implement Datastructures
q Disadvantages of C
q Not a strongly typed Language
q Use of Same operator for multiple purposes
q Not Object Oriented
1.8 Summary
This unit summarizes about basics of problem-solving techniques, which could be helpful for
the beginners to learn all the technologies involved in coding programs independent of any
programming language. The content helps the reader to improve his/her skills in creative and
critical thinking, Writing Algorithms, Pseudo code and drawing flowcharts.
17