GC101 Introduction to computers and programs Lecture 1 Sara Alhajjam
Course syllabus OFFICE: Room 2 OFFICE HOURS: 10-11 TUE; THR E-MAIL ADDRESS: salhajjam@ksu.edu.sa WEB PAGE: http://fac.ksu.edu.sa/salhajjam CLASS HOURS: 10-12 MON; 10-12 WED; 8-10 THR Credit Hours: 3
Course Description: This course introduces the importance of computation in solving problems. It aims to make students confident of their ability to write small programs that allow them to accomplish useful goals. The course uses Java programming language.
Methods of Assessment: Assessment task Week due Proportion of Final Assessment 1 Assignments random 20% 2 Quizzes 10% 3 Mid Term 1 3/2 15% 4 Mid Term 2 9/3 5 Final Exam last 40%
Course Policies: No late homework will be accepted. Homework assignments are considered individual efforts. However, students are encouraged to share thoughts with others. Absolutely no copying and no plagiarism. Copyright should be respected. Academic dishonesty cases will be dealt with severely. All exams are closed book. The final exam will be comprehensive.
introduction Why care about computers and programming? Computers are now a part of everyone's existence, including work, school, learning and play. Many modern activities, such as social media, information sharing and business applications require computers, and people cannot complete these actions without one. Human Beings are really good at analyzing and solving problems but get easily bored with repetitive tasks. On the other hand, a program can perform lots of repetitive tasks, efficiently.
Learn the Core Concepts of all Programming Languages There are many programming languages available: Pascal, c, Java, Perl and Python. All of these languages share core concepts. By focusing on these concepts, you are better able to learn any programming language. Hence, by learning Java, you are poised to learn other languages, such as C++ or Perl. By learning the core concepts, you are also much more marketable as you are able to learn new technologies quicker.
Learn the Basics of Java Programming Java is a popular programming language, widely used in industry. We will learn all the specifics of how to program in Java. This includes all the rules that are specific to Java. We will cover the fundamentals: Variables, Arithmetic, If / Else, For Loops, While Loops, Arrays, Methods, etc.
How is a computer defined? Electronic device operating under the control of instructions stored in its own memory. A computer is a device that accepts information (in the form of digitalized data) and manipulates it for some result based on a program or sequence of instructions on how the data is to be processed.
information processing cycle Input Processing Output Storage
What Is a Computer? Computer Computer programs Hardware Software Performs computations and makes logical decisions Millions / billions times faster than human beings Computer programs Sets of instructions by which a computer processes data Hardware Physical devices of computer system Software Programs that run on computers
Computer components Input Units Output Units Storage Units Central processing unit (CPU) (ALU) and (CU)
Input Unit An input unit performs the following functions: It accepts (or reads) the list of instructions and data from the outside world. It converts these instructions and data in computer acceptable format. It supplies the converted instructions and data to the computer system for further processing.
Output Unit The following functions are performed by an output unit: It accepts the results produced by the computer which are in coded form and hence cannot be easily understood by us. It converts these coded results to human acceptable (readable) form. It supplied the converted results to the outside world.
Storage Unit The specific functions of the storage unit are to store: All the data to be processed and the instruction required for processing (received from input devices). Intermediate results of processing. Final results of processing before these results are released to an output device.
Central Processing Unit (CPU) Arithmetic and Logic Unit (ALU) It consists of circuits that perform arithmetic operations (e.g. addition, subtraction, multiplication, division over data received from memory, and capable to compare numbers (less than, equal to, or greater than). Control Unit (CU) directs and controls the activities of the internal and external devices. Does not perform any actual processing on the data,
Why Is a Computer So Powerful? Speed Reliability Accuracy Storage Communications
Programs Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs. Programs are written using programming languages. Without programs, a computer is an empty machine. Computers do not understand human languages, so you need to use computer languages to communicate with them.
Programming Languages Machine Language Machine language is a set of primitive instructions, in the form of binary code. Program with native machine language is a tedious process and it is highly difficult to read and modify. Example, to add two numbers, you might write an instruction in binary like this: 1101101010011010
Programming Languages Assembly Language Assembly languages were developed to make programming easy. Since the computer cannot understand assembly language, a program called assembler is used to convert assembly language programs into machine code. Example, to add two numbers, you might write an instruction in assembly code like this: ADD R1, R2
Programming Languages High-Level Language The high-level languages are English-like and easy to learn and program. Example, the following is a high-level language statement that computes the area of a circle with radius 5: area = 5 * 5 * 3.1415;