CCS102 Fall 2024-2025 Introduction to Computer Programming Lecture (1) PDF

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Summary

These lecture notes for CCS102, Fall 2024-2025, cover introduction to computer programming, including computer organization, different types of languages, hardware and software. The lecture explores data hierarchy beginning with bits, up to fields and files.

Full Transcript

Faculty of Information Technology Fall 2024-2025 Introduction to Computer Programming CS 102 Lecture (1) 1 Assessment Schedule Assessment Method Week Weight Exam (1) Week#6...

Faculty of Information Technology Fall 2024-2025 Introduction to Computer Programming CS 102 Lecture (1) 1 Assessment Schedule Assessment Method Week Weight Exam (1) Week#6 20% Semester Work Exam (2) Week#11 20% Final Practical Exam Week#14 20% Final Written Exam Week#15 40% 2 Textbook 3 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 3 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 4 Introduction C++—a powerful computer programming language that’s appropriate for technically oriented people with little or no programming experience, and for experienced programmers to use in building substantial information systems. You’ll write instructions commanding computers to perform those kinds of tasks. Software (i.e., the instructions you write) controls hardware (i.e., computers). 6 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 7 Computers and the Internet in Industry and Research Many of the most influential and successful businesses of the last two decades are technology companies, including Apple, IBM, Hewlett Packard, Dell, Intel, Motorola, Cisco, Microsoft, Google, Amazon, Facebook, Twitter, eBay and many more. These companies are major employers of people who study computer science, computer engineering, information systems or related disciplines. 8 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 9 Hardware and Software Computers can perform calculations and make logical decisions phenomenally faster than human beings can. Today’s personal computers can perform billions of calculations in one second—more than a human can perform in a lifetime. Supercomputers are already performing thousands of trillions (quadrillions) of instructions per second! 10 Hardware and Software (Cont.) Computers process data under the control of sequences of instructions called computer programs. These programs guide the computer through ordered actions specified by people called computer programmers. The programs that run on a computer are referred to as software. A computer consists of various devices referred to as hardware. – e.g., the keyboard, screen, mouse, hard disks, memory, DVD drives and processing units. 11 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 12 Computer Organization Regardless of differences in physical appearance, computers can be envisioned as divided into various logical units or sections. 13 Computer Organization (Cont.) 14 Computer Organization (Cont.) 15 Computer Organization (Cont.) 16 Computer Organization (Cont.) 17 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 18 Data Hierarchy Data items processed by computers form a data hierarchy that becomes larger and more complex in structure as we progress from bits to characters to fields, and so on. 19 Data Hierarchy (Cont.) Bits – The smallest data item in a computer can assume the value 0 or the value 1. – Bit (short for “binary digit”—a digit that can assume one of two values). 20 Data Hierarchy (Cont.) Characters – Tedious to work with data in the low-level form of bits. – People prefer to work with decimal digits (0–9), letters (A–Z and a–z), and special symbols (e.g., $, @, %, &, *, (, ), –, +, ", :, ? and /) – Digits, letters, and special symbols are Known as characters. – The computer’s character set is the set of all the characters used to write programs and represent data items. – Computers process only 1s and 0s, so a computer’s character set represents every character as a pattern of 1s and 0s. 21 Data Hierarchy (Cont.) Fields – Just as characters are composed of bits, fields are composed of characters or bytes. – A field is a group of characters or bytes that conveys meaning. A field consisting of uppercase and lowercase letters can be used to represent a person’s name. A field consisting of decimal digits could represent a person’s age. 22 Data Hierarchy (Cont.) Records – Several related fields can be used to compose a record. – In a payroll system, for example, the record for an employee might consist of the following fields. Employee identification number (a whole number) Name (a string of characters) Address (a string of characters) Hourly pay rate (a number with a decimal point) Year-to-date earnings (a number with a decimal point) Amount of taxes withheld (a number with a decimal point). – A company might have many employees and a payroll record for each. 23 Data Hierarchy (Cont.) Files – A file is a group of related records. – It’s not unusual for an organization to have many files, some containing billions, or even trillions, of characters of information. 24 Data Hierarchy (Cont.) Database – A database is a collection of data organized for easy access and manipulation. – The most popular model is the relational database. Data is stored in simple tables. A table includes records and fields. You can search, sort and otherwise manipulate the data based on its relationship to multiple tables or databases. 25 Outline Introduction Computers and the Internet in Industry and Research Hardware and Software Computer Organization Data Hierarchy Machine Languages, Assembly Languages and High-Level Languages 26 Machine Languages, Assembly Languages and High-Level Languages Programmers write instructions in various programming languages, some directly understandable by computers and others requiring intermediate translation steps. These may be divided into three general types:- – Machine languages. – Assembly languages. – High-level languages. 27 Machine Languages, Assembly Languages and High-Level Languages (Cont.) Machine Languages – Any computer can directly understand only its own machine language (also called machine code), defined by its hardware architecture. – Machine languages generally consist of numbers (ultimately reduced to 1s and 0s). Such languages are cumbersome for humans. 28 Machine Languages, Assembly Languages and High-Level Languages (Cont.) Assembly Languages – English-like abbreviations to represent elementary operations. These abbreviations formed the basis of assembly languages. – Translator programs called assemblers were developed to convert early assembly-language programs to machine language. 29 Machine Languages, Assembly Languages and High-Level Languages (Cont.) High-Level Languages – To speed up the programming process further, high-level languages were developed in which single statements could be written to accomplish substantial tasks. – Translator programs called compilers convert high-level language programs into machine language. – Allow you to write instructions that look more like everyday English and contain commonly used mathematical expressions. 30 Machine Languages, Assembly Languages and High-Level Languages (Cont.) High-Level Languages – Compiling a large high-level language program into machine language can take a considerable amount of computer time. – Interpreter programs were developed to execute high- level language programs directly (without the need for compilation), although more slowly than compiled programs. – Scripting languages such as the popular web languages JavaScript and PHP are processed by interpreters. 31

Use Quizgecko on...
Browser
Browser