Presentation is loading. Please wait.

Presentation is loading. Please wait.

Programming 1 1. Introduction to object oriented programming and problem-solving.

Similar presentations


Presentation on theme: "Programming 1 1. Introduction to object oriented programming and problem-solving."— Presentation transcript:

1 Programming 1 1. Introduction to object oriented programming and problem-solving

2 Introduction Introduction to computers and programming Introduction to object oriented problem-solving Creating a Java program

3 Computers Physically a computer comprises of: A processor with memory The memory stores programs and data The processor executes the programs Input devices E.g. keyboard, mouse, scanner, barcode reader Output devices E.g. screen, printer Communications devices Modem, network card

4 Computer programs Perform tasks that would be otherwise less efficient, more difficult or impossible E.g. Stock control, satellite control, computer games, www, banking, eCommerce, mobile phones

5 Programming languages 1 Machine code The binary code that is directly executed by the processor - not designed for humans! Assembly language Machine code made more readable (e.g. ADD 12, 32) – needs to be translated into machine code

6 Programming languages 2 High-level languages Designed for humans to read and write, e.g. Fortran, Cobol, Basic, C, Java Provide higher level functionality than machine code Needs to be translated into machine code by an compiler and/or interpreter

7 Software Development The process of constructing a computer application Lifecycle: Gather requirements Design a solution Implement the design in a programming language May be linear (do each task once in order) or iterative (repeat each task in a cycle)

8 Software Design Break down a complex problem into smaller ‘chunks’ that are more easily solved Structured design Break down complex task into smaller ones Object-oriented design Break down an application into smaller ‘objects’ that provide specific functionality

9 Object-oriented design Objects Self-contained entities that often represent something in the real world Consist of attributes and methods Attributes are data that tell us something about the object Methods are the operations that an object can perform or can be performed on it

10 Example objects The train, bus or car that took you to University today The computer that you use in the lab A bank account A personnel record What are their attributes and methods?

11 Classes A class is a sort of template for an object. There are many bank accounts but they all have the same attribute and methods. The attributes will have different values but they are essentially the same. We say that an object is an instantiation of a class.

12 Organising classes into libraries - reuse In Java programming, we define classes that we may want to use again into packages (a package is a group of related classes) Visualisation of class libraries

13 Creating a Java program 1. Write the program in an editor 2. Compile the program 3. Run the program 4. Go back to 1 and fix the errors! All of these tasks can be performed using an Integrated Development Environment (IDE)

14 JCreator The IDE that we will use is called JCreator


Download ppt "Programming 1 1. Introduction to object oriented programming and problem-solving."

Similar presentations


Ads by Google