Introduction To Computer & Programming PDF
Document Details
Uploaded by DeliciousHeliotrope4330
Universiti Tun Hussein Onn Malaysia
Tags
Related
- Introduction to Computers and Programming PDF
- Introduction to Computers and Programming PDF
- Introduction to Programming with Python PDF 2023
- Ch.01-Introduction to Computers and Programming (1) PDF
- Introduction to Computers and Programming Preparatory Year PDF
- Introduction to Computers and Programming Language PDF
Summary
This document provides an introduction to computer and programming concepts. It covers topics such as computer hardware, software, memory, and operating systems. The document focuses on explaining basic concepts using diagrams and examples.
Full Transcript
CHAPTER 1: INTRODUCTION TO COMPUTER & PROGRAMMING INSTRUCTORS: MOHD HADRI BIN MOHAMED NOR (C) MUHAMMAD HANAFI BIN ASRIL RAJO MANTARI AHMAD FAIZ BIN MAT ZIAN @ MAT ZIN OBJECTIVES In this chapter you will learn: Basic comput...
CHAPTER 1: INTRODUCTION TO COMPUTER & PROGRAMMING INSTRUCTORS: MOHD HADRI BIN MOHAMED NOR (C) MUHAMMAD HANAFI BIN ASRIL RAJO MANTARI AHMAD FAIZ BIN MAT ZIAN @ MAT ZIN OBJECTIVES In this chapter you will learn: Basic computer concepts Computer Software and hardware Computer classification The different types of programming languages Introduction To Computer & Programming What is a computer? Electronic device that operates under the control of instructions stored in memory units Computer systems divided into two: Hardware: physical components of computer system Software refers to a program or set of instructions that instructs a computer to perform some task. Introduction To Computer & Programming Computer Hardware Introduction To Computer & Programming Computer Hardware Introduction To Computer & Programming : Software Computer Software Software can be divided into two major categories called system software and application software. Systems software includes operating systems and various device drivers. (eg: Windows, UNIX, LINUX, & OS/2) Application software are used to perform real-world tasks and solve specific problems. (sistem SMAP untuk data pelajar UTHM.) A program is simply a set of instructions that tells a computer how to perform a particular task. Programs are developed using programming languages. A programming language provides a set of rules to develop a program. A person who writes a program using a programming language is called a programmer. Introduction To Computer & Programming Computer Organization : Input Unit Output Unit Memory Unit Arithmetic and Logic Unit Central Processing Unit Secondary Storage Unit Introduction To Computer & Programming : Input/Output Unit The most common types of I/O in PCs are: Monitor - The monitor is the primary device for displaying information from the computer. Keyboard - The keyboard is the primary device for entering information into the computer. Mouse - The mouse is the primary device for navigating and interacting with the computer Introduction To Computer & Programming : Memory Unit Memory - This is very fast storage used to hold data. It has to be fast because it connects directly to the microprocessor. There are several specific types of memory in a computer: Random-access memory (RAM) - Used to temporarily store information that the computer is currently working with Read-only memory (ROM) - A permanent type of memory storage used by the computer for important data that does not change Basic input/output system (BIOS) - A type of ROM that is used by the computer to establish basic communication when the computer is first turned on Caching - The storing of frequently used data in extremely fast RAM that connects directly to the CPU Virtual memory - Space on a hard disk used to temporarily store data and swap it in and out of RAM as needed Introduction To Computer & Programming : Arithmetic Logic Unit The arithmetic logic unit (ALU) is a digital circuit that calculates an arithmetic operation (like an addition, subtraction, etc.) and logic operations (like an Exclusive Or) between two numbers ALU is a fundamental building block of the central processing unit of a computer. Introduction To Computer & Programming: CPU A microprocessor -- also known as a CPU or central processing unit -- is a complete computation engine that is fabricated on a single chip. Introduction To Computer & Programming: Secondary Storage Removable storage - Removable storage devices allow you to add new information to your computer very easily, as well as save information that you want to carry to a different location. › Floppy disk - The most common form of removable storage, floppy disks are extremely inexpensive and easy to save information to. › CD-ROM - CD-ROM (compact disc, read-only memory) is a popular form of distribution of commercial software. Many systems now offer CD-R (recordable) and CD-RW (rewritable), which can also record. Introduction To Computer & Programming: Secondary Storage Flash memory - Based on a type of ROM called electrically erasable programmable read-only memory (EEPROM), Flash memory provides fast, permanent storage. CompactFlash, SmartMedia and PCMCIA cards are all types of Flash memory. DVD-ROM - DVD-ROM (digital versatile disc, read-only memory) is similar to CD-ROM but is capable of holding much more information. Introduction To Computer & Programming: Operating Systems Operating systems Manage transitions between jobs Increased throughput Amount of work computers process Batch processing Do only one job or task at a time Multitasking Computer resources are shared by many jobs or tasks Timesharing Computer runs a small portion of one user’s job then moves on to service the next use https://edu.gcfglobal.org/en/computerbasics/understanding-operating-systems/1/ Introduction To Computer & Programming: Operating Systems Batch processing Multitasking https://edu.gcfglobal.org/en/computerbasics/understanding-operating-systems/1/ Introduction To Computer & Programming Personal Computing, Distributed Computing, and Client/Server Computing Personal computers Economical enough for individual Distributed computing Computing distributed over networks. Components of a software system are shared among multiple computers. Client/server computing Sharing of information across computer networks between file servers and clients (personal computers) Introduction To Computer & Programming Programming Languages Machine Language Assembly Language High-Level Languages Introduction To Computer & Programming 1. Machine languages Strings of numbers giving machine specific instructions Write in binary codes “0” and “1”. 2. Assembly languages English-like abbreviations representing elementary computer operations (translated via assemblers) Using mnemonic codes Example: Introduction To Computer & Programming 3. High-level languages Codes similar to everyday English Use mathematical notations (translated via compilers) FORTRAN, COBOL BASIC, Pascal, Ada, C, C++ Example: grossPay = basePay + overTimePay Introduction To Computer & Programming: High level languages Fortran › developed by IBM Corporation in the 1950s › used for scientific and engineering applications that require complex mathematical computations COBOL › developed in 1959 by computer manufacturers, the government and industrial computer users › used for commercial applications that require precise and efficient manipulation of large amounts of data Introduction To Computer & Programming: High level languages Pascal Developed by Professor Niklaus Wirth in 1971 Designed for teaching structured programming Ada Developed under the sponsorship of the U.S. Department of Defense (DOD) during the 1970s and early 1980s Able to perform multitasking ALGORITHM PSEUDO CODE FLOW CHART ALGORITHMS A typical programming task can be divided into two phases: Problem solving phase produce an ordered sequence of steps that describe solution of problem this sequence of steps is called an algorithm Implementation phase implement the program in some programming language Steps in Problem Solving First produce a general algorithm (one can use pseudocode) Refine the algorithm successively to get step by step detailed algorithm that is very close to a computer language. Pseudocode Artificial, informal language that helps us develop algorithms Similar to everyday English Not actually executed on computers Helps us “think out” a program before writing it Easy to convert into a corresponding C++ program Consists only of executable statements 25 Pseudocode & Algorithm Example 1: 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. Pseudocode & Algorithm Pseudocode: 1.0 Start 2.0 Input a set of 4 marks 3.0 Calculate their average by summing and dividing by 4 4.0 if average is below 50 Print “FAIL” else Print “PASS” 5.0 End Pseudocode & Algorithm Detailed Algorithm 1.0 Start 2.0 Input M1,M2,M3,M4 3.0 GRADE ← (M1+M2+M3+M4)/4 4.0 if (GRADE < 50) then Print “FAIL” else Print “PASS” endif 5.0 End The Flowchart (Dictionary) A schematic representation of a sequence of operations, as in a manufacturing process or computer program. (Technical) A graphical representation of the sequence of operations in an information system or program. Information system flowcharts show how data flows from source documents through the computer to final distribution to users. Program flowcharts show the sequence of instructions in a single program or subroutine. Different symbols are used to draw each type of flowchart. The Flowchart shows logic of an algorithm emphasizes individual steps and their interconnections e.g. control flow from one action to the next Flowchart Components Start/End Flow Lines Process Input/Output Connector Condition Statement 31 Flowchart Symbols Name Symbol Use in Flowchart Oval Denotes the beginning or end of the program Parallelogram Denotes an input operation Rectangle Denotes a process to be carried out e.g. addition, subtraction, division etc. Diamond Denotes a decision (or branch) to be made. The program should continue along one of two routes. (e.g. IF/THEN/ELSE) Hybrid Denotes an output operation Flow line Denotes the direction of logic flow in the program Example START 1.0 Start 2.0 Input M1,M2,M3,M4 Input 3.0 GRADE ← (M1+M2+M3+M4)/4 M1,M2,M3,M4 4.0 if (GRADE