1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.

Slides:



Advertisements
Similar presentations
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Advertisements

Lecture 1: Overview of Computers & Programming
 Computer hardware components are the physical pieces of the computer.  The major hardware components of a computer are: – The central processing.
CSCE 145: Algorithmic Design I Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib.
Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
Chapter 1: An Overview of Computers and Programming Languages J ava P rogramming: From Problem Analysis to Program Design, From Problem Analysis to Program.
1 Engineering Problem Solving With C++ An Object Based Approach Fundamental Concepts Chapter 1 Engineering Problem Solving.
CS 201 Overview of Computers & Programming Debzani Deb.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Introduction to Computer Science I.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
CMPT 120 Introduction to Computer Science and Programming I Chris Schmidt.
Introduction to Computer Programming CSC 1401: Introduction to Programming with Java Lecture 2 Wanda M. Kunkle.
1 CS150 Introduction to Computer Science 1 Professor: Chadd Williams
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Starting Out with C++: Early Objects 5/e © 2006 Pearson Education. All Rights Reserved Starting Out with C++: Early Objects 5 th Edition Chapter 1 Introduction.
Chapter 1 - Introduction. Ch 1Goals To understand the activity of programming To learn about the architecture of computers To learn about machine code.
CS102 Introduction to Computer Programming
Introduction to Computers and Python. What is a Computer? Computer- a device capable of performing computations and making logical decisions at speeds.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
Why Program? Computer – programmable machine designed to follow instructions Program – instructions in computer memory to make it do something Programmer.
Chapter Introduction to Computers and Programming 1.
Introduction to Programming Dr Masitah Ghazali Programming Techniques I SCJ1013.
CSC 125 Introduction to C++ Programming Chapter 1 Introduction to Computers and Programming.
Chapter 1 An Overview of Computers and Programming Languages.
INTRODUCTION TO COMPUTER PROGRAMMING itc-314 LECTURE 01.
Topics Introduction Hardware and Software How Computers Store Data
There are different types of translator. An Interpreter Interpreters translate one instruction at a time from a high level language into machine code every.
What is a Computer ? Computers are Electronic Machines that process (performs calculation and manipulation) Data under the control of Set of Instructions.
COP1220/CGS2423 Introduction to C++/ C for Engineers Professor: Dr. Miguel Alonso Jr. Fall 2008.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Chapter 1: Introduction to Computers and Programming.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
IT253: Computer Organization Lecture 4: Instruction Set Architecture Tonga Institute of Higher Education.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with C++ Early Objects Seventh Edition by Tony Gaddis, Judy.
An Introduction to Computers August 12, 2008 Mrs. C. Furman.
Introduction to Computing Hardware & Software. INSIDE THE COMPUTER Hardware Physical components of the computer. Any part that you can see and touch Examples:
Computer Parts. Two Basic Parts Hardware & Software.
C++ Programming Language Lecture 1 Introduction By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
King Fahd University of Petroleum & Minerals College of Computer Science & Engineering Information & Computer Science Department Lecture 1 : Introduction.
Robert Crawford, MBA West Middle School.  Explain how the binary system is used by computers.  Describe how software is written and translated  Summarize.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 1: An Overview of Computers and Programming Languages.
Mrs. Ulshafer August, 2013 Java Programming Chapter 1.
Intro to Computers Computer Applications. What is a Computer? Initially the term computer referred to an individual whose job it was to perform mathematical.
SKILL AREA: 1.2 MAIN ELEMENTS OF A PERSONAL COMPUTER.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to.
Beginning Snapshots Chapter 0. C++ An Introduction to Computing, 3rd ed. 2 Objectives Give an overview of computer science Show its breadth Provide context.
Chapter 1 Computers, Compilers, & Unix. Overview u Computer hardware u Unix u Computer Languages u Compilers.
A.Abhari CPS1251 Topic 1: Introduction to Computers Computer Hardware Computer components Connecting Computers Computer Software Operating System (OS)
Computer Systems. Bits Computers represent information as patterns of bits A bit (binary digit) is either 0 or 1 –binary  “two states” true and false,
Chapter 1 Introduction. Components of a Computer CPU (central processing unit) Executing instructions –Carrying out arithmetic and logical operations.
Computer and Programming. Computer Basics: Outline Hardware and Memory Programs Programming Languages and Compilers.
ITP 109 Week 2 Trina Gregory Introduction to Java.
Chapter 1 An Overview of Computers and Programming Languages.
©2013 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. Introduction to Computers and Computing.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
1 Chapter 1 Background Fundamentals of Java: AP Computer Science Essentials, 4th Edition Lambert / Osborne.
Operating Systems A Biswas, Dept. of Information Technology.
Java Programming: From the Ground Up
Engineering Problem Solving With C An Object Based Approach
Topics Introduction Hardware and Software How Computers Store Data
Introduction
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Computer Science I CSC 135.
Computers: Hardware and Software
Topics Introduction Hardware and Software How Computers Store Data
Introduction CSC 111.
There are different types of translator.
Introduction to Computer Systems
Presentation transcript:

1 TOPIC 1 INTRODUCTION TO COMPUTER SCIENCE AND PROGRAMMING Topic 1 Introduction to Computer Science and Programming Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared by B. Ericson.

Outline  What will you get out of this course?  What is computation?  What is computer science?  Roles of Computer Science in our society  What's in a computer  What is a program  What is programming  What a compiler does  Lets learn about Java 3

Why this course?  Learn how to think like a computer scientist  Learn problem solving  Read and write code  Understand object oriented programming  Be well prepared for CS1027  Understand objects and classes  Know a bit about the computing field 4

What is computation?  The tool is the computer – the action is computation  Computers carry out actions  Think of a recipe...  Place butter in pan  Add eggs  If you like them cooked all the way Flip over  If not, keep cooking while they aren't done yet  Eat!! 5

What is computation?  A recipe is a set of steps  A computer carries out a set of steps based on what the programmer tells it  It can do any set of basic instructions 6

What is Computer Science? 7  The design, analysis, implementation, …  of algorithms (recipes),  that solve problems.

Roles of Computer Science  Maintaining the technical infrastructure  network, software  But also many algorithmic challenges  Artificial Intelligence (AI) for games  search or auction algorithms (Google, Bing)  medical imaging  cryptology (RIM)  low-power chips 8

Whats in a computer?  Memory  CPU – Central processing unit – ALU → arithmetic logic unit – Program Counter  Peripherals  I/O and secondary memory 9

Memory – Hard disk  Slow, cheap and huge  Its a physical item, so it actually has to move to do anything  Items here get loaded into RAM and then the cache if its being executed 10

Memory - RAM  Main memory – RAM  Random access memory  Faster, holds less  Disappears when you shut off the computer  Made of switches that are either 0 or 1  Holds programs currently executing 11

Memory - Cache  In the CPU  Small  Fast 12

Memory - Registers  Very few, nothing faster  Called “working registers”  Say you run a program... gets loaded to RAM, first part goes to cache, then current items go to registers 13

Peripherals Outside pieces of a computer that depend on it such as: Mouse Keyboard Speakers Printers Etc... 14

External memory and I/O 15  Secondary Memory: hard disks, CDs, DVDs, USB sticks  Provide long-term storage  Organized as files, each of which has a file name and a folder (directory) that contains it.  Input/Output (I/O) units: keyboard, mouse, screen, printer, webcam, etc.  Used for communications with the user

What is a program? 16 Programs consist of: Instructions to perform a task Data values used in performing the task In CS, the general simplest program is “Hello World”, making a computer print “Hello World” to the screen For example, in Python it would be: print "Hello, World!"

What is a program? 17  In Java, which we use, its a little more involved: public class HelloWorld { public static void main(String[ ] args) { System.out.println("Hello World!"); }

What is programming? 18  Programming is the process of creating detailed instructions that a computer can execute to accomplish some task  Much like writing out a recipe for someone who only understands explicit instructions  Take the recipe or instructions, boil them down to the key steps, and make the computer do these steps

How to Program 19  Computers don't just understand English  We as programmers prefer languages that are similar to English Called “high level languages”  Computers prefer low level languages

High-level languages 20 Java, C, C++, C#, Visual Basic, Turing, Python, Scheme, Lisp, Pascal, Fortran, etc. People-oriented: We understand them easier than a computer does Machine independent: Not brand specific – can run on Windows, Mac, Linux, etc

What the computer understands 21 Computer is just electricity – either on or off If its on, it can be thought of as a 1 If its off, it can be thought of as a 0 Computers do not understand English, they understand on or off: 0 or 1 At the basic level, all computers do is add, subtract or move what is stored in memory locations

Machine language 22  The machine language consists of the set of instructions that the CPU can execute directly  Instructions to the CPU are made up of 0’s and 1’s  Machine dependent: each type of computer has its own machine language

Binary 23 Binary 23  The numbers you are used to using are base 10 They go from 0 to 9 then start to repeat → there are only 9 options to make up all numbers  Computers only have 2 options to make all numbers with – 0 and 1 Because they are limited to on or off

24 Bits and Bytes 24  A bit is a binary digit – a 0 or 1  A string of 8 bits are a byte  A kilobit is 1000 bits, a megabit is 1,000,000 and so on  Computers can only do on or off, and a certain number of these at a time – hence a 64 bit processor a 32 bit processor, etc..

High-level to machine language 25 High-Level Language Program (source code) Compiler Machine Language Program (executable code) CPU

Java 26  A high-level language developed by Sun Microsystems in the early 1990s  Cross-platform  Object-oriented (later)  Widely used in business, science and education  One of the fastest-adopted technologies of all time!  Different from previous high-level languages

From program to execution 27 Java Compiler CPU Java source code Bytecode Java Virtual Machine

Helpful Hints 28 Pay attention to this little guy! Work hard to understand concepts where he appears.

Summary 29  Terminology introduced:  CPU, RAM, ALU  Bit  Program  High-Level Language  Machine Language  Compiler  Bytecode  Java Virtual Machine  My exam buddy