0% found this document useful (0 votes)
4 views18 pages

CSP Lab1-08-09-25

Uploaded by

hihtisham89
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)
4 views18 pages

CSP Lab1-08-09-25

Uploaded by

hihtisham89
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
You are on page 1/ 18

Computer Systems and

Programming
MECHANICAL ENGINEERING DEPARTMENT
SESSION 2024
System
A system is a collection of parts or components that work
together as a whole to achieve a common purpose or
function.
More specifically:
◦ A system has components (or elements).
◦ These components are interconnected and interdependent.
◦ The system has an input, process, and output.
◦ It often has boundaries (what’s inside vs. outside).
◦ It may also have feedback loops to adjust or maintain stability.
Examples
Biological system: The human body is a system made up of organs that
work together to keep you alive.
Computer system: Hardware + software working together to perform
computing tasks.
Ecosystem: Living organisms interacting with their environment.
Economic system: Institutions and rules that govern production and
consumption in a society.
Mechanical system: Like a car engine, where different parts move and
work together.
Computer
A computer is an electronic device which
takes input, process it and produces useful
output according to predefined
instructions. (programs or software).
Key Features of a Computer:
Input – It receives data (e.g., from a keyboard, mouse, sensor).
Processing – It performs calculations or operations on the data
using a CPU (Central Processing Unit).
Storage – It saves data temporarily (RAM) or permanently (hard
drive, SSD).
Output – It presents results (e.g., on a screen, printer, speaker).
Control – It follows instructions to manage all its operations.
Basic Components:
Hardware – The physical parts (e.g., CPU, monitor,
keyboard, motherboard).
Software – The programs and operating systems (e.g.,
Windows, macOS, apps).
◦ System Softwares
◦ Application Softwares
Data – The raw information processed by the computer.
Types of Computers:
Personal computers (PCs) – Laptops, desktops for general
use.
Servers – Powerful computers that provide services over a
network.
Supercomputers – Extremely fast, used for complex
scientific tasks.
Embedded computers – Built into devices (like in cars,
appliances, smartphones).
What is an AI
AI (Artificial Intelligence) is the field of computer science
focused on creating machines or software that can simulate
human intelligence.
AI is when computers are designed to “think” or “learn” like
humans
That means they can:
◦ Recognize patterns (like faces or speech)
◦ Make decisions (like recommending a movie or driving a car)
◦ Learn from data (like improving over time)
◦ Understand language (like what I’m doing now!)
Common Examples of AI
Example What AI Does

Voice assistants (like Siri, Alexa) Understand and respond to speech

Google Search Predicts what you’re looking for


Detect roads, obstacles, and drive
Self-driving cars
safely
Answer customer service
Chatbots
questions
Face recognition Identify people in photos or videos
What is a programming language?
A programming language is a special language used
to give instructions to a computer so it can perform
specific tasks.
A programming language is how humans "talk" to
computers.
You write a set of instructions (called code) using a
programming language, and the computer follows
those instructions.
Why Do We Need It?
Computers don’t understand human language.
They only understand binary (1s and 0s).
A programming language lets us write instructions in a way that’s easier
for humans to write and read, and that computers can understand (after
being translated).
0 mean 00
1 means 01
2 mean 10
3 mean 11
Examples of Programming Languages
Language Common Uses

Python Web development, AI, data science, automation

JavaScript Websites and interactive web apps

Java Android apps, enterprise software

C/C++ Operating systems, high-performance software


A visual programming language for beginners and
Scratch
kids
Type of Programming Languages
A high-level language is closer to human language and further from machine language.
✅ Features:
•Easy to read and write
•Uses words and symbols (e.g., if, print, while)
•Portable (can run on different types of computers with little change)
•Requires a compiler or interpreter to convert it to machine code

💡 Examples:
•Python
•Java
•C#, C++
•JavaScript
Type of Programming Languages
1. Based on Abstraction
1. High Level Language.
2. Low Level Language.
2. Based on Style
1. Procedural Programming Language (C, Fortran, Pascal, Basic)
2. Object Oriented Programing Language (C++, C#, Java etc)
3. Functional Programing Languages (Lisp
4. Logic Programming Language (Prolog)
3. Based on used cases
1. Scripting Language (PHP, JavaScript,
2. Markup Language (HTML etc)
3. Query Language (SQL etc.)
High Level Programming Languages
A high-level language is closer to human language and further from machine language.
✅ Features:
•Easy to read and write
•Uses words and symbols (e.g., if, print, while)
•Portable (can run on different types of computers with little change)
•Requires a compiler or interpreter to convert it to machine code

💡 Examples:
•Python
•Java
•C#
•JavaScript

🔸 Example (Python):
Low Level Programming Language
A low-level language is closer to the machine's native language (binary or hardware
instructions).
✅ Features:
Harder to read/write (more technical)
Runs faster and gives more control over hardware
Usually specific to one type of computer or processor
Examples:
Assembly Language
Machine Language
Main Difference
Feature High-Level Language Low-Level Language

Ease of Use Easy to learn and write Hard to learn and write

Closer to Human thinking Machine hardware

Speed Slower (needs translation) Faster (more direct)

Portability Works on many devices Tied to specific hardware

Examples Python, Java, C++ Assembly, Machine code


My First Program
#include <iostream>
using namespace std;
int main()
{
cout << "My First Program";

return 0;
}

You might also like