COMP Computer Basics. Yi Hong May 13, 2015

Similar documents
Darrell Bethea May 10, MTWRF 9:45-11:15 AM Sitterson 011

Introduction to Computers and Java

Introduction to Computers and Java

9/11/08 (c) 2008 Matthew J. Rutherford Class (c) 2008 Matthew J. Rutherford Class

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java. Objectives. Outline. Harald Gall, Prof. Dr. Institut für Informatik Universität Zürich.

Introduction to Computers and Java

Introduction to Computers and Java

Introduction to Computers and Java

Chapter. Focus of the Course. Object-Oriented Software Development. program design, implementation, and testing

Electricity: Voltage. Gate: A signal enters the gate at a certain voltage. The gate performs operations on it, and sends it out was a new signal.

Chapter Two. Hardware Basics: Inside the Box

Chapter 1: Why Program? Computers and Programming. Why Program?

Intermediate Programming & Design (C++) Notation

Computer Basics 1/6/16. Computer Organization. Computer systems consist of hardware and software.

Introduction to Computers and Java

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Day 3. Storage Devices + Types of Memory + Measuring Memory + Computer Performance

Chapter 1. Introduction to Computers and Programming. M hiwa ahmad aziz

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

The Programming Process Summer 2010 Margaret Reid-Miller

Chapter 1 Computer and Programming. By Zerihun Alemayehu

System Unit Components Chapter2

CMSC 104 -Lecture 2 John Y. Park, adapted by C Grasso

Lab Determining Data Storage Capacity

INTRODUCTION TO COMPUTERS

Intentionally Blank 0

What did we talk about last time? Examples switch statements

Chapter 1: Introduction to Computers, Programs, and Java

Information Communications Technology (CE-ICT) 6 th Class

What is a computer? Units of Measurement. - A machine that: - Counts.

CHAPTER 1 Introduction to Computers and Java

Introduction to Computers. Joslyn A. Smith

Computer Training for Newcomers

LECTURE SCHEDULE 2. Units of Memory, Hardware, Software and Classification of Computers

Using sticks to count was a great idea for its time. And using symbols instead of real sticks was much better.

card slots CPU socket Monitor Computer case houses CPU (Central Processing Unit), CPU central power supply, DVD drive, etc processing unit Keyboard

Introduction to OOP Using Java Pearson Education, Inc. All rights reserved.

System Unit Components. Chapter2

Sahalsoftware college. Welcome To understanding Basic Computer Concept

An Overview of the Computer System. Kafui A. Prebbie 24

CSE 1223: Introduction to Computer Programming in Java Chapter 1 Computer Basics

A comprehensive view of software in detail.

Introduction to computers

15/09/15. Introduction to Computers & The Internet. Contents. Computer hardware and software. Input and output devices CPU. Memory.

Chapter 2. Prepared By: Humeyra Saracoglu

2011 Francisco Delgadillo

Zimmer CSCI /24/18. CHAPTER 1 Overview. COMPUTER Programmable devices that can store, retrieve, and process data.

Worksheet - Storing Data

Topics. Hardware and Software. Introduction. Main Memory. The CPU 9/21/2014. Introduction to Computers and Programming

Introduction to Java Programming

What is the typical configuration of a computer sold today? 1-1

Chapter 1: Introduction to Computers and Java

8/23/2014. Chapter Topics. Introduction. Java History. Why Program? Java Applications and Applets. Chapter 1: Introduction to Computers and Java

Chapter 1. Introduction to Computers and Java Objects. Background information. » important regardless of programming language. Introduction to Java

1.1 Bits and Bit Patterns. Boolean Operations. Figure 2.1 CPU and main memory connected via a bus. CS11102 Introduction to Computer Science

BUYING A COMPUTER TERM 2 AIT

CMSC 1513 Lecture 1.2

HARDWARE AND OPERATING SYSTEMS

Chapter 1: Introduction to Computers and Programming

12/22/11. Java How to Program, 9/e. Help you get started with Eclipse and NetBeans integrated development environments.

Elementary Computing CSC M. Cheng, Computer Science 1

Computers Are Your Future

TECHNOLOGY IN ACTION. Chapter 2. Alan Evans * Kendall Martin * Mary Anne Poatsy. Looking at Computers: Understanding the Parts

COMPUTER SYSTEM. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U. COMPUTER SYSTEM IB DP Computer science Standard Level ICS3U

CHAPTER 2: HOW DOES THE COMPUTER REALLY WORK

CIS260 Summer Exam 1 First Name Last Name: 2) is the brain of a computer. 2) A) Memory B) Hardware C) Disk D) CPU

National 5 Computing Science Software Design & Development

Chapter 4 The Components of the System Unit

Q1. Briefly describe the characteristic features of input and output devices of a computer system.

Java and Software Design

COMP-202: Foundations of Programming. Lecture 2: Java basics and our first Java program! Jackie Cheung, Winter 2015

Computer Hardware. Java Software Solutions Lewis & Loftus. Key Hardware Components 12/17/2013

Management Information Systems OUTLINE OBJECTIVES. Information Systems: Computer Hardware. Dr. Shankar Sundaresan

9/7/2012. Introduction. Peeking into Computer Science. Jalal Kawash Mandatory: Chapter 1 Optional: None. Reading Assignment

Computer Organization

Introduction to Java Applications; Input/Output and Operators

COMP String and Console I/O. Yi Hong May 18, 2015

8. A is approximately one billion bytes a. Kilobyte b. Bit c. Gigabyte d. Megabyte 9. SMPT, FTP and DNS are applications of the layer a. Data link b.

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Chapter 1 Introduction to Computers, Programs, and Java

The personal computer system uses the following hardware device types -

Java Module Lesson 2A Practice Exercise

Introduction To Computers: Hardware

Chapter 1: Why Program? Main Hardware Component Categories 8/23/2014. Main Hardware Component Categories: Why Program?

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Introduction To Computer Hardware. Hafijur Rahman

Week One: Introduction A SHORT INTRODUCTION TO HARDWARE, SOFTWARE, AND ALGORITHM DEVELOPMENT

Chapter 1: An Overview of Computers and Programming Languages. Objectives. Objectives (cont d.) Introduction

Computer Memory. Data Structures and Algorithms CSE 373 SP 18 - KASEY CHAMPION 1

Computers Are Your Future

Class List. Java Must Have. Class Goals. Class Goals. Schedule

Terminology, Types of Computers & Computer Hardware

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Chapter 1 Introduction to Computers and Programming

Components of a Computer System

Computer Basics PC-100

Chapter 1 Introduction to Computers, Programs, and Java

Lecture Set 2: Starting Java

Copyright 2012 Pearson Education, Inc. Publishing as Prentice Hall

Transcription:

COMP 110-001 Computer Basics Yi Hong May 13, 2015

Today Hardware and memory Programs and compiling Your first program 2

Before Programming Need to know basics of a computer Understand what your program is doing Talk intelligently about computers 3

Computer System Hardware: Physical components for computation CPU, Memory, Keyboard. Software: Programs that give instructions to the computer Windows, Office, Games, Eclipse 4

Hardware Main components of a computer CPU (Central Processing Unit): Performs the instructions in a program Memory: Holds programs and data Input devices: Provide data to a computer Output devices: Display data carried out by a computer 5

CPU the Brain Central processing unit Clock speed: GHz, how many clock cycles a CPU can perform per second (1GHz = 1 billion CPU cycles per second) Dual core: Multiple processing units per CPU 6

Memory the Brain Holds data for the computer Main memory Holds the current program and much of the data that the program is manipulating Volatile, disappears when shutting down the computer Auxiliary memory (secondary memory) Hard disk drives, CDs, flash drives Exists even when the computer s power is off 7

RAM (Random Access Memory) The main memory 4 gigabytes of RAM A bit: the basic unit of information in computing (binary digit, 0 or 1) A byte: A quantity of memory, 8 bits 2^0 + 2^2 + 2^4 + 2^5 = 53 8

Measuring Memory Both main memory and auxiliary memory are measured in bytes 1 byte = 8 bits 1 Kilobyte (KB) = 1024 bytes 1 Megabyte (MB) = 1024 KB = 1024*1024 bytes 1 Gigabyte (GB) = 1024 MB Terabyte (TB), Petabyte (PB) 9

Software Program: A set of computer instructions Program Data (input for the program) Computer Output 10

Programming Languages Different levels Java / C++ Program High-Level Languages (Human readable) Compiler Assembly languages Machine Language Low-Level Languages (Computer readable) 11

Translation A high-level language à? a low-level language Compiler: translate once, run forever Interpreter: translation alternates with execution, directly executes instructions Java: combines a compiler and an interpreter 12

Java Bytecode Java Code (.java) JAVAC compiler A compiler translates Java code into bytecode Java Bytecode (.class) JVM JVM Windows Linux JVM Mac The Java Virtual Machine (JVM) is an interpreter that translates and executes bytecode 13

Why Using Java Bytecode? The bytecode is not the machine language for any particular computers Can be easily translated into the machine language of a given computer Portability Java bytecode runs on any computer has a JVM No need to recompile the Java code 14

Objects, Methods, and Classes Object: a combination of attributes (data) and methods (actions) Yi s Car (has wheels, can start, stop, ) Class: defines a type or kind of object Car (blueprint for defining the objects, e.g., Yi s car, Bob s car ) Methods: actions performed by objects start(), stop(), forward(), back() 15

Invoking a Method A Java program uses objects to perform actions that are defined by methods Yi s car.forward (); System.out.println( Welcome to COMP 110 ); Object to perform actions Method of the object System.out Print the string in quotes to screen Semicolon at the end of each statement Argument 16

First Java Program A simple task Print a message: Welcome to COMP 110 Each class is in *.java A class contains methods Every application has a main method The body of the method 17

Begin the Program Begin a program named FirstProgram Program names should make sense Capitalize the first letter of each word in the program name 18

Run the First Program Compile: javac FirstProgram.java Bytecode is in the file, FirstProgram.class Execute: java FirstProgram Or use IDE (integrated develoment environment) 19

Second Java Program Ask the user to input his/her name, and print a welcome message 20

What s New (1): Java Package import java.util.scanner Gets the Scanner class from the package java.util Package = Library of classes Different libraries provide different functionalities Math library: math equations Network library: send / receive packages java.util : allows you to read data from keyboard 21

What s New (2): Create Objects Scanner keyboard = new Scanner(System.in) Create an object (i.e., keyboard) of the Scanner class Then the object performs actions: String name = keyboard.next(); Read a string from the keyboard Keyboard.close(); Close the keyboard, stop getting data from a user 22

First & Second Java Programs Import a package / class Define a class A main method Create an objects Invoke methods 23

Next Class Object-Oriented Programming (OOP) Primitive data types and variables Reading and coding assignments Chapter 1.3, 2.1 Try the two sample programs in class 24