Csce 145 algorithmic design i
Download
1 / 28

CSCE 145: Algorithmic Design I - PowerPoint PPT Presentation


  • 108 Views
  • Uploaded on

CSCE 145: Algorithmic Design I. Chapter 1 Intro to Computers and Java Muhammad Nazmus Sakib. Computer Basics. Section 1.1. Computer Systems. Hardware The Physical Machine Software Set of programs Set of instructions. Hardware and Memory. Central Processing Unit (CPU)

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' CSCE 145: Algorithmic Design I' - salome


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Csce 145 algorithmic design i

CSCE 145: Algorithmic Design I

Chapter 1

Intro to Computers and Java

Muhammad NazmusSakib


Computer basics
Computer Basics

  • Section 1.1


Computer systems
Computer Systems

  • Hardware

    • The Physical Machine

  • Software

    • Set of programs

      • Set of instructions


Hardware and memory
Hardware and Memory

  • Central Processing Unit (CPU)

    • Also known as the Processor

    • Device that performs the instructions in a program

    • Example

      • Intel Core i7


Hardware and memory1
Hardware and Memory

  • Memory

    • Holds data for the computer to process

    • Two forms

      • Main Memory

        • Volatile

        • Example - RAM

      • Auxiliary Memory

        • Non-volatile

        • Example – Hard drive


Bits bytes address
Bits, Bytes & Address

  • Bit = Binary Digit (0,1)

  • Byte = groups of bits

    • 1 Byte = 8 Bits

    • Byte is the smallest addressable unit of memory

  • Address

    • Main memory consists of a long list of numbered bytes

    • The number of a byte in memory is called an Address


Memory locations
Memory Locations

  • 1 byte is not large enough to store all kinds of data

  • Data can be stored in several adjacent bytes

  • These adjacent bytes are considered a single Memory Location

  • Address of the Memory Location

    • Address of the first byte



Files directories
Files & Directories

  • File

    • A group of bytes stored in auxiliary memory

  • Directory

    • Also known as Folder

    • Contains groups of files


Programs
Programs

  • A set of instructions


Operating systems
Operating Systems

  • A program that supervises a computer’s operation

  • Examples

    • Windows XP/7/8

    • UNIX

    • Linux, Ubuntu

    • Mac OS X


Programming languages
Programming Languages

  • High Level Languages

    • Java, C, C++, C#, Visual Basic, Python

  • Low Level Languages

    • Assembly Language

    • Machine Language


Compilers
Compilers

  • A Translator

  • Translates from High Level Language to Low Level Language

  • Source code -> Object Code

  • Compile Once, Execute Often


Interpreters
Interpreters

  • Translator + Executor

  • Alternates between translation & execution

  • Translates every time

  • Interpreted programs are slower than compiled ones


Java bytecode
Java Bytecode

  • An intermediate language for Java

  • A compiler translated Java code into Bytecode

  • Java Virtual Machine (JVM)

    • Translator to translate & execute Java Bytecode

  • Bytecode runs in any computer that has JVM

    • Portability



Class loader
Class Loader

  • Java program consists of Classes

    • A piece of code

    • Generally reside in one file

  • Class loader connects the Classes

    • Similar to a Linker


A sip of java
A Sip of Java

  • Section 1.2


History of java
History of Java

  • Started in 1991

  • James Gosling and his team

    • Sun Microsystems


Applications applets
Applications & Applets

  • Applications

    • Regular programs

    • Runs in your computer

  • Applets

    • Little applications

    • Runs in your web browser

    • Sent over the Internet


Programming basics
Programming Basics

  • Section 1.3


Object oriented programming
Object-Oriented Programming

  • Objects

    • Attributes

    • States

    • Behaviors

  • Methods

    • Captures the behavior

  • Classes

    • Blueprint for Objects


Object oriented programming1
Object-Oriented Programming

  • Encapsulation

    • Information Hiding

  • Polymorphism

    • Many forms

    • Example – “Go play your favorite sport”

  • Inheritance

    • Way of organizing Classes



Algorithms
Algorithms

  • Like a Recipe!

  • A set of directions for solving a problem

  • Often written in Pseudocode

    • Combination of English & Programming Language


Pseudocode example
Pseudocode Example

  • Algorithm to compute the total cost of a list of items

    • Write the number o on the whiteboard.

    • For each item on the list

      • Add the cost of the item to the number on the whiteboard

      • Replace the number on the whiteboard with the result of this addition.

    • Announce that the answer is the number written on the whiteboard.


Testing debugging
Testing & Debugging

  • Bug

    • A mistake in a program

  • Debugging

    • Process of eliminating mistakes

  • Syntax error

    • Grammatical mistakes

  • Run-time error

    • Error during execution

  • Logic error

    • Conceptual mistakes in algorithm


Software reuse
Software Reuse

  • Java Class Library

    • Java API

  • Example

    • System.out.println


ad