SlideShare a Scribd company logo
1 of 26
Basic Java Programming
Sasidhara Marrapu
Introduction to computers
and programming
 What is a Computer?
 How do computer works?
 Computer System Parts
 Quiz
 Computer Language
 What is Programming?
 Problem Solving Steps:
 Algorithm
 Pseudocode
 Flow Charts
• Lab Problem
• Write Pseudocode
• Draw Flow Chart
• Home Work
• Write Pseudocode
• Draw Flow Chart
What is Computer?
• A programmable electronic machine that
performs
• high-speed mathematical or logical
operations
• that assembles, stores, processes
information.
• A computer is a machine that receives
input data which it then
processes/compute and outputs the
results.
How Computer Work?
Instructions
Information
Processses
Results
How Computer Work?
Data
Information
Processes/co
mputes
Results
Parts of a Computer System:
• Two Parts
• Hardware
• Software
• Hardware: Physical Electronic Devices
• Input : Keyboard, Mouse
• System unit:
• Random Access Memory (RAM)
• Central Processing Unit (CPU)
• Output: Monitor, Printer
• Secondary Storage: Disk Drive
Parts of a Computer System: Hardware
Mouse
Camera
Scanner
Keyboard
Price
Scanner
Speakers
Printer
Monitor
Parts of a Computer System: Software
 Instructions for the hardware.
 Actions to be performed
 A set of instructions is called a program.
 Driving force behind the computer
 Without a program – What is a computer?
 Collection of Useless Hardware
 2 purposes:
 Tell the computer what to do
 Tell other people what we want the computer to do.
QUIZ
What are the four basic components of a computer?
A. Input devices, output devices, printing, and typing
B. Input devices, processing unit, storage, and output devices
C. Input devices, cpu, output devices, and RAM
What does a storage unit provide?
A. A place to show data
B. A place to store currently worked on information
C. A place to store information
QUIZ
What are examples of storage devices?
A. Keyboards, flash drive, printer
B. Flash drive, RAM, DVD-ROM
C. Hard drive, DVD-ROM, flash drive
What is the processing unit?
A. The brains of the computer
B. This the main circuit board that all other internal components are
connected to.
C. A device that receives, processes, and presents information.
What Language Computer Understand?
• Uses Binary Language - which is “0”
and “1”
• A single digit (0 or 1) is called a bit
• A byte is made up of 8 bits.
• Data and instructions (numbers,
characters, strings, etc.) are encoded
as binary numbers - a series of bits
(one or more bytes made up of zeros
and ones)
What is Programing?
• Computer programs are a detailed set of instructions given to the
computer
• They tell the computer:
1. What actions you want the computer to perform
2. The order those actions should happen in
• Examples:
1. Adding two numbers
2. Drawing Circle
• An effective program therefore needs:
1. A thorough understanding of the problem
2. A well thought-out, step-by-step solution to the problem
3. The most valuable part of learning to program is learning how to think about
arranging the sequence of instructions to solve the problem or carry out the
task
Problem Solving?
• A Good Problem Solver is Better Programmer
• Problem Solving Steps -
1. U – Understand the Problem
2. D – Devise a Good Plan to Solve
3. I – Implement the Plan
4. E – Evaluate the Solution
Step 1 - Understand the Problem
• What
 is the Problem to be solved?
 is the unknown?
 is the condition?
 is the data?
 is needed to solve the problem?
 actions need to take place?
• Identify the inputs and outputs
• Identify the processes needed to produce the outputs from the
given inputs
• Draw a figure. Introduce suitable notation.
• Isolate Principle parts of the problem.
Step 2 - Devise a Plan
 Find connections between the knowns and unknowns.
 Simplify: Break the problem into smaller sub-problems
 Design a solution
 Make a plan or list of actions to implement the solution
 Algorithm / Flowchart / Psuedocode
Step 2 - Devise a Plan (cont.)
• Algorithm
• A FINITE set of clear, executable steps that will eventually
terminate to produce the desired outcome
• Logical design used to solve problems – usually a list of
actions required to perform task
• Pseudocode
• Written like program code but more “English Like” and
doesn’t have to conform to language syntax
• Flowchart
• Diagram that visually represents the steps to be performed
to arrive at solution.
Step 3 - Implement the Plan
 Implement in a Programming Language
 Carry out the plan checking the preliminary results at each
step.
 Code A Little - Test A lot
Step 4 - Evaluate the Solution
• Run the Code
• Check results repeatedly and thoroughly
• Use numerous test cases or data sets
• Use highly varied test case, including expected as well as
and unexpected cases
• Look for new solutions
• Is there a better, easier, or more efficient solution
• Can other problems be solved using these techniques?
FLOW CHART SYMBOLS
TERMINAL – the beginning or ending of
a program
INPUT/OUTPUT – where the user of the program
is asked for information (INPUT) or where the
program displays a result (OUTPUT)
PROCESSING – shows any mathematical
operation
CALL – shows any other pieces of the
program that are called upon
DECISION – represents any action where the
computer is making a decision
Problem 1:
Write an algorithm and draw a flowchart that will read the two
sides of a rectangle and calculate its area.
Pseudocode:
• Input the width (W) and Length (L) of a rectangle
• Calculate the area (A) by multiplying L with W
• Print A?
Problem 1:
Algorithm:
Step 1: Input W, L
Step 2: A  L x W
Step 3: Print A
FlowChart
Start
Input W and L
A = L x W
Print A
Stop
Problem 2:
Write an algorithm to determine a student’s final grade and indicate
whether it is passing or failing. The final grade is calculated as the
average of four marks (50).
Pseudocode:
• Input a set of 4 marks
• Calculate their average by summing and dividing by 4
• if average is below 50
• Print “FAIL”
• else
• Print “PASS”
Problem 2:
Detailed Algorithm:
Step 1: Input M1,M2,M3,M4
Step 2: GRADE (M1+M2+M3+M4)/4
Step 3: if (GRADE < 50) then
Print “FAIL”
else
Print “PASS”
Endif
Programming Fundamentals: Putting
the Instructions Together
• Sequential Processing
• A List of Instructions
• Conditional Execution
• Ifs
• Repetition
• Looping / Repeating
• Stepwise Refinement / Top-Down Design
• Breaking Things into Smaller Pieces
• Calling Methods / Functions / Procedures / Subroutines
• Calling a segment of code located elsewhere
• Reuse of previously coded code segment
Methods of Programming
• Procedural
• Defining set of steps to transform inputs into outputs
• Translating steps into code
• Constructed as a set of procedures
• Each procedure is a set of instructions
• Object-Oriented
• Defining/utilizing objects to represent real-world entities that work
together to solve problem
• Basic O-O Programming Components
• Class
• Object/Instance
• Properties
• Methods
Home Work
Write an algorithm, pseudo code and flow chart to read three
numbers and print the largest number.

More Related Content

What's hot

CS106 Lab 1 - Introduction
CS106 Lab 1 - IntroductionCS106 Lab 1 - Introduction
CS106 Lab 1 - IntroductionNada Kamel
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableAnjali Technosoft
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
Unit 1 program development cycle
Unit 1 program development cycleUnit 1 program development cycle
Unit 1 program development cycleDhana malar
 
6months industrial training in labview, jalandhar
6months industrial training in labview, jalandhar6months industrial training in labview, jalandhar
6months industrial training in labview, jalandhardeepikakaler1
 
6 weeks summer training in labview,jalandhar
6 weeks summer training in labview,jalandhar6 weeks summer training in labview,jalandhar
6 weeks summer training in labview,jalandhardeepikakaler1
 
Algorithm &amp; flowchart
Algorithm &amp; flowchartAlgorithm &amp; flowchart
Algorithm &amp; flowchartsaurabh sen sky
 
Flowcharts and pseudocodes
Flowcharts and pseudocodesFlowcharts and pseudocodes
Flowcharts and pseudocodesDr Piyush Charan
 
Unit ii introduction to vba
Unit ii introduction to vbaUnit ii introduction to vba
Unit ii introduction to vbaDhana malar
 
Programming process and flowchart
Programming process and flowchartProgramming process and flowchart
Programming process and flowcharthermiraguilar
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptaviban
 
Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Ramadan Babers, PhD
 
problem solving and design By ZAK
problem solving and design By ZAKproblem solving and design By ZAK
problem solving and design By ZAKTabsheer Hasan
 
(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1Aaron Angeles
 

What's hot (19)

CS106 Lab 1 - Introduction
CS106 Lab 1 - IntroductionCS106 Lab 1 - Introduction
CS106 Lab 1 - Introduction
 
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision tableProgramming aids- Algorithm, Flowchart, Pseudocodes and Decision table
Programming aids- Algorithm, Flowchart, Pseudocodes and Decision table
 
Lecture 24
Lecture 24Lecture 24
Lecture 24
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Programming logic &practices
Programming logic &practices Programming logic &practices
Programming logic &practices
 
Unit 1 program development cycle
Unit 1 program development cycleUnit 1 program development cycle
Unit 1 program development cycle
 
6months industrial training in labview, jalandhar
6months industrial training in labview, jalandhar6months industrial training in labview, jalandhar
6months industrial training in labview, jalandhar
 
6 weeks summer training in labview,jalandhar
6 weeks summer training in labview,jalandhar6 weeks summer training in labview,jalandhar
6 weeks summer training in labview,jalandhar
 
Algorithm &amp; flowchart
Algorithm &amp; flowchartAlgorithm &amp; flowchart
Algorithm &amp; flowchart
 
Flowcharts and pseudocodes
Flowcharts and pseudocodesFlowcharts and pseudocodes
Flowcharts and pseudocodes
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Unit ii introduction to vba
Unit ii introduction to vbaUnit ii introduction to vba
Unit ii introduction to vba
 
Programming process and flowchart
Programming process and flowchartProgramming process and flowchart
Programming process and flowchart
 
Data structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 pptData structures & problem solving unit 1 ppt
Data structures & problem solving unit 1 ppt
 
Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018Introduction to computer_lec_04_fall_2018
Introduction to computer_lec_04_fall_2018
 
problem solving and design By ZAK
problem solving and design By ZAKproblem solving and design By ZAK
problem solving and design By ZAK
 
Algorithm & flow chart
Algorithm & flow chartAlgorithm & flow chart
Algorithm & flow chart
 
Flowcharting and Algorithm
Flowcharting and Algorithm Flowcharting and Algorithm
Flowcharting and Algorithm
 
(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1(Prog213) (introduction to programming)v1
(Prog213) (introduction to programming)v1
 

Similar to Pj01 1-computer and programming fundamentals

Cs1123 2 comp_prog
Cs1123 2 comp_progCs1123 2 comp_prog
Cs1123 2 comp_progTAlha MAlik
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing TechniquesAppili Vamsi Krishna
 
Computer Programming Computer Programming
Computer Programming Computer ProgrammingComputer Programming Computer Programming
Computer Programming Computer Programmingarifhasan88
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programmingSangheethaa Sukumaran
 
Programming requirements for beginning in software engineering.pptx
Programming requirements for beginning in software engineering.pptxProgramming requirements for beginning in software engineering.pptx
Programming requirements for beginning in software engineering.pptxTeddyDaka
 
Chapter 1 Introduction to computer components
Chapter 1 Introduction to computer componentsChapter 1 Introduction to computer components
Chapter 1 Introduction to computer componentsBoonsaaMulataa
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptxmiansaad18
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESHarshJha34
 
Algorithmic problem sloving
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem slovingMani Kandan
 
Computer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module iComputer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module iAjit Nayak
 
Csci101 lect00 introduction
Csci101 lect00 introductionCsci101 lect00 introduction
Csci101 lect00 introductionElsayed Hemayed
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptKirti Verma
 

Similar to Pj01 1-computer and programming fundamentals (20)

Algorithm.pdf
Algorithm.pdfAlgorithm.pdf
Algorithm.pdf
 
Cs1123 2 comp_prog
Cs1123 2 comp_progCs1123 2 comp_prog
Cs1123 2 comp_prog
 
C programming for Computing Techniques
C programming for Computing TechniquesC programming for Computing Techniques
C programming for Computing Techniques
 
Computer Programming Computer Programming
Computer Programming Computer ProgrammingComputer Programming Computer Programming
Computer Programming Computer Programming
 
Introduction to computer programming
Introduction to computer programmingIntroduction to computer programming
Introduction to computer programming
 
Programming requirements for beginning in software engineering.pptx
Programming requirements for beginning in software engineering.pptxProgramming requirements for beginning in software engineering.pptx
Programming requirements for beginning in software engineering.pptx
 
Chapter 1 Introduction to computer components
Chapter 1 Introduction to computer componentsChapter 1 Introduction to computer components
Chapter 1 Introduction to computer components
 
01CHAP_1.PPT
01CHAP_1.PPT01CHAP_1.PPT
01CHAP_1.PPT
 
Introduction.pptx
Introduction.pptxIntroduction.pptx
Introduction.pptx
 
Comp102 lec 1
Comp102   lec 1Comp102   lec 1
Comp102 lec 1
 
UNIT-111.pptx
UNIT-111.pptxUNIT-111.pptx
UNIT-111.pptx
 
Lec-ProblemSolving.pptx
Lec-ProblemSolving.pptxLec-ProblemSolving.pptx
Lec-ProblemSolving.pptx
 
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHESC LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
C LANGUAGE-FLOWCHARTS,PSEUDOCODE,ALGORITHMS APPROCHES
 
Algorithmic problem sloving
Algorithmic problem slovingAlgorithmic problem sloving
Algorithmic problem sloving
 
Lecture1
Lecture1Lecture1
Lecture1
 
PPS Unit-1.pdf
PPS Unit-1.pdfPPS Unit-1.pdf
PPS Unit-1.pdf
 
Computer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module iComputer Fundamentals & Intro to C Programming module i
Computer Fundamentals & Intro to C Programming module i
 
Unit no_1.pptx
Unit no_1.pptxUnit no_1.pptx
Unit no_1.pptx
 
Csci101 lect00 introduction
Csci101 lect00 introductionCsci101 lect00 introduction
Csci101 lect00 introduction
 
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.pptBCE L-2 Algorithms-and-Flowchart-ppt.ppt
BCE L-2 Algorithms-and-Flowchart-ppt.ppt
 

Recently uploaded

Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 

Recently uploaded (20)

Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 

Pj01 1-computer and programming fundamentals

  • 2. Introduction to computers and programming  What is a Computer?  How do computer works?  Computer System Parts  Quiz  Computer Language  What is Programming?  Problem Solving Steps:  Algorithm  Pseudocode  Flow Charts • Lab Problem • Write Pseudocode • Draw Flow Chart • Home Work • Write Pseudocode • Draw Flow Chart
  • 3. What is Computer? • A programmable electronic machine that performs • high-speed mathematical or logical operations • that assembles, stores, processes information. • A computer is a machine that receives input data which it then processes/compute and outputs the results.
  • 6. Parts of a Computer System: • Two Parts • Hardware • Software • Hardware: Physical Electronic Devices • Input : Keyboard, Mouse • System unit: • Random Access Memory (RAM) • Central Processing Unit (CPU) • Output: Monitor, Printer • Secondary Storage: Disk Drive
  • 7. Parts of a Computer System: Hardware Mouse Camera Scanner Keyboard Price Scanner Speakers Printer Monitor
  • 8. Parts of a Computer System: Software  Instructions for the hardware.  Actions to be performed  A set of instructions is called a program.  Driving force behind the computer  Without a program – What is a computer?  Collection of Useless Hardware  2 purposes:  Tell the computer what to do  Tell other people what we want the computer to do.
  • 9. QUIZ What are the four basic components of a computer? A. Input devices, output devices, printing, and typing B. Input devices, processing unit, storage, and output devices C. Input devices, cpu, output devices, and RAM What does a storage unit provide? A. A place to show data B. A place to store currently worked on information C. A place to store information
  • 10. QUIZ What are examples of storage devices? A. Keyboards, flash drive, printer B. Flash drive, RAM, DVD-ROM C. Hard drive, DVD-ROM, flash drive What is the processing unit? A. The brains of the computer B. This the main circuit board that all other internal components are connected to. C. A device that receives, processes, and presents information.
  • 11. What Language Computer Understand? • Uses Binary Language - which is “0” and “1” • A single digit (0 or 1) is called a bit • A byte is made up of 8 bits. • Data and instructions (numbers, characters, strings, etc.) are encoded as binary numbers - a series of bits (one or more bytes made up of zeros and ones)
  • 12. What is Programing? • Computer programs are a detailed set of instructions given to the computer • They tell the computer: 1. What actions you want the computer to perform 2. The order those actions should happen in • Examples: 1. Adding two numbers 2. Drawing Circle • An effective program therefore needs: 1. A thorough understanding of the problem 2. A well thought-out, step-by-step solution to the problem 3. The most valuable part of learning to program is learning how to think about arranging the sequence of instructions to solve the problem or carry out the task
  • 13. Problem Solving? • A Good Problem Solver is Better Programmer • Problem Solving Steps - 1. U – Understand the Problem 2. D – Devise a Good Plan to Solve 3. I – Implement the Plan 4. E – Evaluate the Solution
  • 14. Step 1 - Understand the Problem • What  is the Problem to be solved?  is the unknown?  is the condition?  is the data?  is needed to solve the problem?  actions need to take place? • Identify the inputs and outputs • Identify the processes needed to produce the outputs from the given inputs • Draw a figure. Introduce suitable notation. • Isolate Principle parts of the problem.
  • 15. Step 2 - Devise a Plan  Find connections between the knowns and unknowns.  Simplify: Break the problem into smaller sub-problems  Design a solution  Make a plan or list of actions to implement the solution  Algorithm / Flowchart / Psuedocode
  • 16. Step 2 - Devise a Plan (cont.) • Algorithm • A FINITE set of clear, executable steps that will eventually terminate to produce the desired outcome • Logical design used to solve problems – usually a list of actions required to perform task • Pseudocode • Written like program code but more “English Like” and doesn’t have to conform to language syntax • Flowchart • Diagram that visually represents the steps to be performed to arrive at solution.
  • 17. Step 3 - Implement the Plan  Implement in a Programming Language  Carry out the plan checking the preliminary results at each step.  Code A Little - Test A lot
  • 18. Step 4 - Evaluate the Solution • Run the Code • Check results repeatedly and thoroughly • Use numerous test cases or data sets • Use highly varied test case, including expected as well as and unexpected cases • Look for new solutions • Is there a better, easier, or more efficient solution • Can other problems be solved using these techniques?
  • 19. FLOW CHART SYMBOLS TERMINAL – the beginning or ending of a program INPUT/OUTPUT – where the user of the program is asked for information (INPUT) or where the program displays a result (OUTPUT) PROCESSING – shows any mathematical operation CALL – shows any other pieces of the program that are called upon DECISION – represents any action where the computer is making a decision
  • 20. Problem 1: Write an algorithm and draw a flowchart that will read the two sides of a rectangle and calculate its area. Pseudocode: • Input the width (W) and Length (L) of a rectangle • Calculate the area (A) by multiplying L with W • Print A?
  • 21. Problem 1: Algorithm: Step 1: Input W, L Step 2: A  L x W Step 3: Print A FlowChart Start Input W and L A = L x W Print A Stop
  • 22. Problem 2: Write an algorithm to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of four marks (50). Pseudocode: • Input a set of 4 marks • Calculate their average by summing and dividing by 4 • if average is below 50 • Print “FAIL” • else • Print “PASS”
  • 23. Problem 2: Detailed Algorithm: Step 1: Input M1,M2,M3,M4 Step 2: GRADE (M1+M2+M3+M4)/4 Step 3: if (GRADE < 50) then Print “FAIL” else Print “PASS” Endif
  • 24. Programming Fundamentals: Putting the Instructions Together • Sequential Processing • A List of Instructions • Conditional Execution • Ifs • Repetition • Looping / Repeating • Stepwise Refinement / Top-Down Design • Breaking Things into Smaller Pieces • Calling Methods / Functions / Procedures / Subroutines • Calling a segment of code located elsewhere • Reuse of previously coded code segment
  • 25. Methods of Programming • Procedural • Defining set of steps to transform inputs into outputs • Translating steps into code • Constructed as a set of procedures • Each procedure is a set of instructions • Object-Oriented • Defining/utilizing objects to represent real-world entities that work together to solve problem • Basic O-O Programming Components • Class • Object/Instance • Properties • Methods
  • 26. Home Work Write an algorithm, pseudo code and flow chart to read three numbers and print the largest number.