Name of Course Introduction to Java Programming ipc202/wiki.files/Class_Java_1.pdfآ  Memory Unit : Byte

  • View
    0

  • Download
    0

Embed Size (px)

Text of Name of Course Introduction to Java Programming ipc202/wiki.files/Class_Java_1.pdfآ  Memory Unit :...

  • Name of Course : Introduction to Java Programming Lecturer: Alexander Shkolnik E- mail: shkol@bgu.ac.il Office Hours: Sun 12:00 - 14:00 build 37,room 520 Course number : 202.1.9031 Credits : 4 Course Site : http://www.cs.bgu.ac.il/~ipc202 1

    mailto:shkol@bgu.ac.il http://www.cs.bgu.ac.il/~

  • Course Objectives

    • The main purpose of the course - introduction to Java language programming methods, based on new approaches in computer science.

    • On the first part of the course students will acquire procedural programming:

    software development technique that imposes a hierarchical structure on

    the design of the programs. On the second part of the course students will

    learn the principles of Object-Oriented Programming (OOP): programming

    technique based on objects.

    • Students will learn operation system Windows and Integrated Development

    Environment (IDE) Eclipse, which provides first – class Java programming

    tools.

    • The course includes: algorithm building principles, basic Java commands,

    control structure, arrays, different kinds of methods (including recursion

    methods), principles of object-oriented programming (OOP), collections,

    dynamic data structures and files manipulations.

    2

  • Course requirements : • 1. 13 x 3 hours lectures

    • 2. 13 x 2 hours (4 x 2 lab, 9 x 2 frontal) practical lessons

    • 3. 5 programming assignments (about 20 hours each)

    (every assignment 6 % of the final grade).

    The only 4 first assignments must be submitted frontally.

    Submissions: alone only.

    • 4. Final exam 3 hours long ( 70% of final grade,

    a "Pass" requirement regarding final exam: 56 ) .

    No auxiliary material allowed, except for a single two-sided

    A4 paper sheet (neither printed nor copied).

    3

  • Our course site

    4

    http://www.cs.bgu.ac.il/~ipc202/Main

  • Review computer basics

    User

    Application Programs

    Operating System

    Hardware

    5

  • HARDWARE VS SOFTWARE

    ● The hardware and software are the main components of the

    computer system and therefore one is nothing without others.

    ● Computer hardware (חומרה) is the collection that constitutes

    the physical components of the system.

    ● The software (תכנה) is the set of instructions that make the

    hardware work.

    6

  • Computer Structure

    CPU

    Internal Memory

    Input

    Output

    Mouse Keyboard Microphone Detectors

    Monitor Speakers Motors External

    Memory

    Hard Disk CD / DVD Tape DiskOnKey

    7

  • CPU ( מעבד )

    The Central Processing Unit (CPU) is the brain of a computer.

    It retrieves instructions from memory and executes them. The CPU speed is

    measured in megahertz (MHz), with 1 megahertz equaling 1 million pulses per second. The speed of the CPU has been improved continuously.

    CPU

    e.g., Disk, CD,

    and Tape

    Input

    Devices

    e.g., Keyboard,

    Mouse

    e.g., Monitor,

    Printer

    Communication

    Devices

    e.g., Modem,

    and NIC

    Storage

    Devices

    Memory Output

    Devices

    Bus

    8

  • Memory ( זיכרון ) Memory is to store data and program instructions for CPU to execute.

    A memory unit is an ordered sequence of bytes, each holds eight bits. A

    program and its data must be brought to memory before they can be

    executed. A memory byte is never empty, but its initial content may be

    meaningless to your program. The current content of a memory byte is lost

    whenever new information is placed in it.

    CPU

    e.g., Disk, CD,

    and Tape

    Input

    Devices

    e.g., Keyboard,

    Mouse

    e.g., Monitor,

    Printer

    Communication

    Devices

    e.g., Modem,

    and NIC

    Storage

    Devices

    Memory Output

    Devices

    Bus

    9

  • Memory Unit : Byte • Byte (בית) is a unit of digital information.

    It is an ordered collection of 8 bits ( binary

    digit), in which each bit denotes the binary

    value of 1 or 0.

    • number of bits (סיביות) used to encode a character of text in the computer, which depended on computer hardware architecture.

    • A byte can represent 28 = 256 distinct values, such as the integers from 0 to 255.

    • ASCII (American Standard Code for Information Interchange).

    10

  • How Data is Stored?

    ● Data of various kinds, such as numbers, characters, and strings, are encoded as a series of bits (zeros and ones).

    ● Computers use zeros and ones because digital devices have two stable states, which are referred to as zero and one by convention. The programmers need not to be concerned about the encoding and decoding of data, which is performed automatically by the system based on the encoding scheme.

    ● A byte is the minimum storage unit.

    .

    .

    .

    2000

    2001

    2002

    2003

    2004

    .

    .

    .

    01001010

    01100001

    01110110

    01100001

    00000011

    Memory content

    Memory address

    Encoding for character ‘J’ Encoding for character ‘a’ Encoding for character ‘v’ Encoding for character ‘a’ Encoding for number 3

    1 KB = 1,024 bytes

    1 MB = 1,048,576 bytes

    1 GB = 1,073,741,824 bytes

  • 12

    ● The modern computers are based on a stored-program concept introduced

    by John Von Neumann.

    In this stored-program concept, programs and data are stored in a separate

    storage unit called memories and are treated the same.

    Von Neumann architecture

  • Storage Devices ( התקני אחסון ) Memory is volatile ( נדיף ), because information is lost when the power is off.

    Programs and data are permanently stored on storage devices and are

    moved to memory when the computer actually uses them.

    There are three main types of storage devices: Disk drives, CD drives and

    Tape drives.

    CPU

    e.g., Disk, CD,

    and Tape

    Input

    Devices

    e.g., Keyboard,

    Mouse

    e.g., Monitor,

    Printer

    Communication

    Devices

    e.g., Modem,

    and NIC

    Storage

    Devices

    Memory Output

    Devices

    Bus

    13

  • USB flash drive

    ● A USB flash drive is a data storage device that includes flash

    memory (a special type of memory that can be erased and

    reprogrammed ) with an integrated Universal Serial Bus (USB)

    interface.

    ● USB flash drives are typically removable and rewritable, and

    physically much smaller than an CD.

    14

  • Operating system ( מערכת ההפעלה )

    • An operating system ( OS ) is a software program that enables the

    computer hardware to communicate and operate with the computer

    software.

    • An operating system also has a vital role to play in security. Its job

    includes preventing unauthorized users from accessing the computer

    system.

    • Examples of popular modern operating systems include Microsoft

    Windows, Android,, Linux, Mac OS X, and IBM z/OS.

    15

    http://en.wikipedia.org/wiki/Microsoft_Windows http://en.wikipedia.org/wiki/Microsoft_Windows http://en.wikipedia.org/wiki/Android_(operating_system) http://en.wikipedia.org/wiki/Linux http://en.wikipedia.org/wiki/Mac_OS_X http://en.wikipedia.org/wiki/IBM_z/OS

  • What's the difference between Mac/Apple, Windows and Linux ?

    If operating systems “could talk”, this is what they would say:

    16

    Operating system ( מערכת ההפעלה )

    Do whatever you want, BUT stay within these boundaries,

    and use what tools I give you.

    Do only what I allow you to do, in the way that I make it

    possible. Don't try to be smart. You aren't.

    Do whatever you want with whatever you need to make it

    work. You will have the minimal tools available, and you

    have to look for it, otherwise, someone else will have the

    appropriate tool for you. Use them.

  • Operating system, cont.

    At the simplest level, an operating system does two things: 1. It manages the hardware and software resources of the computer

    system. These resources include such things as the processor, memory,

    disk space, etc.

    2. It provides a stable, consistent way for applications to deal with the

    hardware without having to know all the details of the hardware.

    Today's major operating systems provide a

    Graphical User

Recommended

View more >