COS 201- Module 1
COS 201- Module 1
Computer
Programming I
Module 1:Introduction to Computer
Programming
Introduction
Computers are used for various tasks in various settings,
such as school, work, and home. Creating applications to
run these tasks
How do we make these applications to handle these tasks?
We program these apps to perform diverse functions
through software created by programmers and developers.
A programmer, or software developer, is a person with the
training and skills necessary to design, create, and test
computer programs.
Computer programming is an important and versatile
career employed across many industries and fields.
In this course we will be learning how this application are
made
Computer Programming
A program is a set of instructions that tells the computer what
to do.
Computer programming (often shortened as coding), is the
process of;
writing, testing, debugging/troubleshooting and maintaining
instructions (source code) for solving a problem with the
computer.
A source code is written in an acceptable computer
programming language. (C++, Java, Python etc.)
The purpose of programming is to create a program that
exhibits a certain described behavior (customization).
The process of writing source code requires expertise in many
different subjects, including knowledge of the application
domain.
What is Programming
Programming is the craft of transforming
requirements into something that a computer can
execute.
It is also the process of creating a set of instructions
(called a program) that tells a computer how to
perform a task. It involves:
Writing precise, step-by-step commands
Using specific programming languages that the computer
can understand
Converting human thoughts and solutions into machine-
executable format (Coding)
Why Programming Matters
An essential skill for problem-solving
programming is a fundamental tool for problem-
solving, as it allows for;
The development of analytical and logical thinking,
The automation of tasks,
The modelling and simulation of scenarios,
The manipulation and analysis of data,
The rapid prototyping of solutions,
These capabilities make programming an
essential skill for effective problem-solving in a
wide range of domains.
Key Ways Programming Contributes
To Problem-Solving
Algorithmic Thinking: Programming requires the ability
to break down complex problems into a series of logical
steps or algorithms. This helps develop analytical and
problem-solving skills
Automation: Programming allows for the automation of
repetitive or tedious tasks, freeing up time and resources
to focus on more complex problem-solving.
Modeling and Simulation: Programming enables the
creation of models and simulations to test hypotheses,
explore scenarios, and experiment with potential solutions
without the risks or constraints of the real world..
Key Ways Programming Contributes
To Problem-Solving
Data Manipulation and Analysis: Programming provides the
tools to collect, organize, and analyze data, which is crucial for
identifying patterns, trends, and insights that can inform problem-
solving approaches.
Rapid Prototyping: The iterative nature of programming allows
for the rapid development and testing of solutions, enabling quick
feedback and the ability to iterate on ideas.
Key Ways Programming Contributes
To Problem-Solving
Scalability and Adaptability: Well-designed programs can
be easily scaled and adapted to handle larger or more
complex problems, making them a valuable tool for
problem-solving.
Collaboration and Communication: Programming often
involves working with teams, which fosters collaboration,
communication, and the sharing of diverse perspectives to
tackle complex problems.
The Problem-Solving Process
The Problem-Solving Process
Problem Identification: Understanding what needs to be
solved, Identifying inputs and required outputs and determining
constraints and requirements
Problem Analysis: Breaking down complex problems into
smaller parts, identifying patterns and relationships and
determining necessary resources
Solution Design: Creating algorithms to solve the problem,
planning data structures and Designing user interfaces (if
needed)
Implementation: Writing the actual code, Testing and debugging
and Optimizing performance
Example: Planning a Birthday Party
Problem Identification
Understanding what needs to be solved: You want to plan a fun
birthday party.
Identifying inputs and required outputs: You need to know how many
guests are coming, what food and drinks to provide, and what
activities/entertainment you should include.
Determining constraints and requirements: You have a limited
budget, a small venue, and a specific date and time.
Problem Analysis
Breaking down complex problems into smaller parts:
List the tasks: sending invitations, ordering food, buying decorations,
planning games, etc.
Identifying patterns and relationships: Figure out how many guests
will attend which helps dictate the amount of food and drinks needed.
Determining necessary resources: Determine what you need to buy
(cake, drinks, decorations) and who can help (friends, family).
Planning a Birthday Party
Solution Design
Creating algorithms: Outline steps for each task, like:
Create a guest list, Send invitations, Confirm attendance, and Order
food based on headcount.
Planning data structures: Create a simple spreadsheet to keep track
of guest RSVPs and budgets.
Designing user interfaces: If you're using an online invitation service,
design the page to be easy to navigate for your guests.
Implementation
Writing the actual code: Not literally code here, but putting your plan
into action—send invitations, order food, buy decorations.
Testing and debugging: Check if guests received invitations, adjust if
food order is too small or too large based on RSVPs.
Optimizing performance: If the budget allows, consider things like
double-checking supplies to avoid last-minute rushes or tweaking the
game schedule based on what works well previously.
Class work
Planning my resumption
Using the Problem-Solving Process, to help solve
this problem of a student preparing for school
resumption after a break.
Example: Planning for school
resumption
Problem Identification
Implementation