Presentation is loading. Please wait.

Presentation is loading. Please wait.

About the Presentations

Similar presentations


Presentation on theme: "About the Presentations"— Presentation transcript:

1 About the Presentations
The presentations cover the objectives found in the opening of each chapter All chapter objectives are listed in the beginning of each presentation You may customize the presentations to fit your class needs Some figures from the chapters are included; a complete set of images from the book can be found on the Instructor Resources disc 1

2 Java Programming: From Problem Analysis to Program Design, 4e
Chapter 1 An Overview of Computers and Programming Languages 2

3 Chapter Objectives Learn about different types of computers
Explore the hardware and software components of a computer system Learn about the language of a computer Learn about the evolution of programming languages Examine high-level programming languages Java Programming: From Problem Analysis to Program Design, 4e

4 Chapter Objectives (continued)
Discover what a compiler is and what it does Examine how a Java program is processed Learn what an algorithm is and explore problem-solving techniques Become aware of structured and object-oriented programming design methodologies Java Programming: From Problem Analysis to Program Design, 4e

5 Introduction Computers have greatly affected our daily lives – helping us complete many tasks Computer programs (software) are designed specifically for each task Software is created with programming languages Java is an example of a programming language Java Programming: From Problem Analysis to Program Design, 4e

6 An Overview of the History of Computers
The first device known to carry out calculations was the abacus The abacus uses a system of sliding beads on a rack for addition and subtraction Blaise Pascal invented the calculating device called the Pascaline Java Programming: From Problem Analysis to Program Design, 4e

7 An Overview of the History of Computers (continued)
In 1819, Joseph Jacquard, a French weaver, discovered that the weaving instructions for his looms could be stored on cards with holes punched in them In the early and mid-1800s, Charles Babbage, an English mathematician and physical scientist, designed two calculating machines: the difference engine and the analytical engine Java Programming: From Problem Analysis to Program Design, 4e

8 An Overview of the History of Computers (continued)
The first computer-like machine was the Mark I Built in 1944 Used punched cards to feed data into the machine 52 feet long, weighed 50 tons, and had 750,000 parts In 1946, ENIAC (Electronic Numerical Integrator and Calculator) was built at the University of Pennsylvania Contained 18,000 vacuum tubes and weighed some 30 tons Java Programming: From Problem Analysis to Program Design, 4e

9 An Overview of the History of Computers (continued)
In 1956, the invention of the transistors resulted in smaller, faster, more reliable, and more energy-efficient computers This era also saw the emergence of the software development industry with the introduction of FORTRAN and COBOL, two early programming languages In 1970, the microprocessor, an entire CPU on a single chip, was invented Java Programming: From Problem Analysis to Program Design, 4e

10 An Overview of the History of Computers (continued)
In 1977, Stephen Wozniak and Steven Jobs designed and built the first Apple computer in their garage In 1981, IBM introduced its personal computer (PC) Modern-day computers are very powerful, reliable, and easy to use Can accept spoken-word instructions and imitate human reasoning through artificial intelligence Java Programming: From Problem Analysis to Program Design, 4e

11 An Overview of the History of Computers (continued)
Although there are several categories of computers, such as mainframe, midsize, and micro, all computers share some basic elements Java Programming: From Problem Analysis to Program Design, 4e

12 Elements of a Computer System
A computer has two components Hardware Software Java Programming: From Problem Analysis to Program Design, 4e

13 Hardware Components of a Computer
Central Processing Unit (CPU) Main Memory Java Programming: From Problem Analysis to Program Design, 4e

14 Central Processing Unit
Arithmetic and logical operations are carried out inside the CPU Java Programming: From Problem Analysis to Program Design, 4e

15 Central Processing Unit and Main Memory
Java Programming: From Problem Analysis to Program Design, 4e

16 Main Memory Ordered sequence of cells (memory cells)
Directly connected to CPU All programs must be brought into main memory before execution When power is turned off, everything in main memory is lost Java Programming: From Problem Analysis to Program Design, 4e

17 Secondary Storage Provides permanent storage for information
Examples of secondary storage: Hard disks Floppy disks Flash memory ZIP disks CD-ROMs Tapes Java Programming: From Problem Analysis to Program Design, 4e

18 Input Devices Definition: devices that feed data and computer programs into computers Examples Keyboard Mouse Secondary storage Java Programming: From Problem Analysis to Program Design, 4e

19 Output Devices Definition: devices that the computer uses to display results Examples Printer Monitor Secondary storage Java Programming: From Problem Analysis to Program Design, 4e

20 Input/Output Devices Java Programming: From Problem Analysis to Program Design, 4e 20

21 Software Software consists of programs written to perform specific tasks Two types of programs System programs Application programs Java Programming: From Problem Analysis to Program Design, 4e

22 System Programs System programs control the computer
The operating system is first to load when you turn on a computer Java Programming: From Problem Analysis to Program Design, 4e

23 Operating System (OS) OS monitors overall activity of the computer and provides services Example services Memory management Input/output Activities Storage management Java Programming: From Problem Analysis to Program Design, 4e

24 Application Programs Written using programming languages
Perform a specific task Run by the OS Example programs Word processors Spreadsheets Games Java Programming: From Problem Analysis to Program Design, 4e

25 Language of a Computer Machine language: the most basic language of a computer A sequence of 0s and 1s Every computer directly understands its own machine language A bit is a binary digit, 0 or 1 A byte is a sequence of eight bits Java Programming: From Problem Analysis to Program Design, 4e

26 Language of a Computer (continued)
Java Programming: From Problem Analysis to Program Design, 4e

27 Evolution of Programming Languages
Early computers programmed in machine language Assembly languages were developed to make programmer’s job easier In assembly language, an instruction is an easy-to-remember form called a mnemonic Assembler: translates assembly language instructions into machine language Java Programming: From Problem Analysis to Program Design, 4e

28 Instructions in Assembly and Machine Language
Java Programming: From Problem Analysis to Program Design, 4e

29 Evolution of Programming Languages
High-level languages make programming easier Closer to spoken languages Examples Basic FORTRAN COBOL C/C++ Java Java Programming: From Problem Analysis to Program Design, 4e

30 Evolution of Programming Languages (continued)
To run a Java program: Java instructions need to be translated into an intermediate language called bytecode 2. Then the bytecode is interpreted into a particular machine language Java Programming: From Problem Analysis to Program Design, 4e

31 Evolution of Programming Languages (continued)
Compiler: a program that translates a program written in a high-level language into the equivalent machine language In the case of Java, this machine language is the bytecode Java Virtual Machine (JVM): hypothetical computer developed to make Java programs machine independent Java Programming: From Problem Analysis to Program Design, 4e

32 A Java Program Output: Java Programming: From Problem Analysis to Program Design, 4e

33 Processing a Java Program
Two types of Java programs: applications and applets Source program: written in a high-level language Loader: transfers the compiled code (bytecode) into main memory Interpreter: reads and translates each bytecode instruction into machine language and then executes it Java Programming: From Problem Analysis to Program Design, 4e

34 Processing a Java Program (continued)
Java Programming: From Problem Analysis to Program Design, 4e

35 Internet, World Wide Web, Browser, and Java
The Internet is an interconnection of networks that allows computers around the world to communicate with each other In 1969, the U.S. Department of Defense’s Advanced Research Project Agency (ARPA) funded research projects to investigate and develop techniques and technologies to interlink networks This was called the internetting project, and the funding resulted in ARPANET, which eventually became known as the “Internet” The Internet allows computers to be connected and communicate with each other Java Programming: From Problem Analysis to Program Design, 4e

36 Internet, World Wide Web, Browser, and Java (continued)
World Wide Web (WWW) or Web uses software programs that enable computer users to access documents and files (including images, audio, and video) on almost any subject over the Internet with the click of a mouse Computers around the world communicate via the Internet; the World Wide Web makes that communication a fun activity Java Programming: From Problem Analysis to Program Design, 4e 36

37 Internet, World Wide Web, Browser, and Java (continued)
The primary language for the Web is known as Hypertext Markup Language (HTML) Java applets are programs that run from a Web browser and make the Web responsive and interactive Two well-known browsers are Mozilla Firefox and Internet Explorer Java applets can run in either browser Through the use of applets, the Web becomes responsive, interactive, and fun to use Java Programming: From Problem Analysis to Program Design, 4e 37

38 Problem-Analysis-Coding-Execution Cycle
Algorithm: a step-by-step problem-solving process in which a solution is arrived at in a finite amount of time Java Programming: From Problem Analysis to Program Design, 4e 38

39 Problem-Solving Process
Analyze the problem and outline the problem and its solution requirements Design an algorithm to solve the problem Implement the algorithm in a programming language, such as Java Verify that the algorithm works Maintain the program by using and improving it and modifying it if the problem domain changes Java Programming: From Problem Analysis to Program Design, 4e

40 Problem-Analysis-Coding-Execution Cycle (continued)
Java Programming: From Problem Analysis to Program Design, 4e

41 Programming Methodologies
Two basic approaches to programming design Structured design Object-oriented design Java Programming: From Problem Analysis to Program Design, 4e

42 Structured Design A problem is divided into smaller subproblems
Each subproblem is solved The solutions of all subproblems are then combined to solve the problem Java Programming: From Problem Analysis to Program Design, 4e

43 Object-Oriented Design (OOD)
In OOD, a program is a collection of interacting objects An object consists of data and operations Steps in OOD Identify objects Form the basis of the solution Determine how these objects interact Java Programming: From Problem Analysis to Program Design, 4e

44 What is Eclipse? An Integrated Development Environment
Provides many features to ease Java programming (and others, e.g. C/C++) Editor Debugger Source Control

45 Getting Eclipse At the CS labs… At home… It’s already installed
Download the latest version at: You may need to install Java SDK1.5 or JRE if you haven’t from For help, send to the course mailing list

46 Installing and Running Eclipse
Installation is very simple Just unpack the downloaded package Running Eclipse Then click eclipse.exe (under Windows) Run eclipse (under Linux) Eclipse will start running if all the prerequisites are met Demo: Run Eclipse

47 Setting up your Workspace
Workspace is where your projects and programs are stored. Usually some directory in the file system The workspace is set when Eclipse starts In this course, for instance, we may set the work space to /home/usrname/course/cs112b1 All code will be saved in this directory Demo

48 Some important concepts about Eclipse Environment
Workbench Perspective Views Editor

49 Workbench The term Workbench refers to the desktop development environment The Workbench aims to achieve seamless tool integration and controlled openness by providing a common paradigm for the creation, management, and navigation of workspace resources.

50 Understanding Perspective
Each Workbench window contains one or more perspectives Each perspective provides a set of functionality aimed at accomplishing a specific type of task or works with specific types of resources. For example, the Java perspective combines views that you would commonly use while editing Java source files, while the C/C++ perspective contains the views that you would use for editing C++ files You might need switch perspectives frequently.

51 Built-in Eclipse Perspectives
Resource Arrange your files and projects. Java Develop programs in the Java language. Debug Diagnose and debug problems that occur at runtime. Java Browsing Java Type Hierarchy Plug-in Development CVS Repository Exploring Team Synchronizing

52 Views Views support editors and provide alternative presentations as well as ways to navigate the information in your Workbench.  For example, the Navigator and other navigation views display projects and other resources that you are working with.

53 Editors Most perspectives in the Workbench are comprised of an editor area and one or more views You can associate different editors with different types of files. Any number of editors can be open at once, but only one can be active at a time.

54 Creating Java Projects
Demo: Creating a project for assignment1 in the workspace

55 Creating Java Packages
A Package in Java is a group of classes which are often closely or logically related in some way Package corresponds to the directory hierarchy in the file system. course.cs112b1.assignment1 Organizing source files into different packages is a good programming style. Demo: creating a package

56 Adding Java Classes Class is the basic compilation unit in Java.
Demo: Creating the Employee class of assignment1

57 Import existing files Some files are given and you want to import them to your projects rather than creating them again Demo: Importing other files of assignment1 to the project You can also copy-and-paste files to your project folder Refresh the file view if you don’t see them

58 Running the code Currently, no implementation is provided in the given files. You are expected to fill the implementation details. We need a class which has a main() method as the entrance for execution Demo: Adding the main() method in TestPayroll.java and run the program

59 Other issues Demo: Eclipse provides a very good Help system
Removing files from the project Check (or not) “Build Automatically” Window->Preferences Project->Properties Eclipse provides a very good Help system “Help->Help Contents” for more information

60 Chapter Summary A computer system is made up of hardware and software components Computers understand machine language; it is easiest for programmers to write in high-level languages A compiler translates high-level language into machine language Java steps to execute a program: edit, compile, load, and execute Java Programming: From Problem Analysis to Program Design, 4e

61 Chapter Summary (continued)
Algorithm: step-by-step problem-solving process in which a solution is arrived at in a finite amount of time Three steps to problem solving: analyze the problem and design an algorithm, implement the algorithm in a programming language, and maintain the program Two basic approaches to programming design: structured and object-oriented Eclipse Java Programming: From Problem Analysis to Program Design, 4e

62 Questions


Download ppt "About the Presentations"

Similar presentations


Ads by Google