Docsity

Introduction - Business Application Programming - Lecture Slides, Slides of Applications of Computer Sciences

Partial preview of the text

Download Introduction - Business Application Programming - Lecture Slides and more Slides Applications of Computer Sciences in PDF only on Docsity!

Chapter 1:

Introduction

Object-Oriented Program

Development Using Java: A

Class-Centered Approach

Objectives

  • Computer Science and Programming Languages
  • Objects and Classes
  • Constructing a Java Program
  • The PrintStream Class’s print() and println()

Methods

  • Using the javax.swing Package
  • Programming Style
  • Common Programming Errors

Fundamental Areas of

Computer Science

This text will focus on:

  • An introduction to computer architecture
  • The Java programming language
  • Class development and design
  • Algorithm development
  • An introduction to data structures

Programming Languages

  • Computer program
    • A self-contained set of instructions and data used to operate a computer to produce specific results
    • Also called software
  • Programming is the process of developing and

writing a program

  • A programming language is a set of instructions

that can be used to construct a program

Programming Languages

(continued)

  • High-level languages:
    • Use instructions that resemble natural languages
    • Can be run on a variety of computer types
    • Examples:
      • Pascal
      • Visual Basic
      • C
      • C++
      • Java

Programming Languages

(continued)

  • Source program
    • Programs written in a computer language
  • Interpreted language
    • Each statement is translated individually and executed immediately upon translation
  • Compiled language
    • All statements are translated as a complete unit before any one statement is executed

Procedure and Object

Orientations

  • Procedure-oriented language
    • Available instructions are used to create self-contained units
  • Object-oriented language
    • Program must first define objects it will be manipulating
  • Java is object-oriented

The Development of Java

(continued)

  • Web browser
    • A program located and run on a user’s computer to display Web pages
    • Java can run from a Web browser
  • Java provides:
    • Cross-platform compatibility
    • Write-once-run-anywhere capability

A Class Is a Plan

  • The structure for a class of objects must be created

at the start of the programming process

  • Class
    • Explicitly written plan
    • Complete set of parts and instructions needed to create items

From Recipe to Class

  • Data declaration section
    • Description of data to be used
  • Methods section
    • Defines how to combine data components to produce desired result

A First Java Class

  • A class consists of a class header line and a body
  • The class header line includes the words public

class nameofclass

  • Class body
    • Encloses data and methods that make up class
    • Typically two sections of code:
      • The types of data that will be used
      • Procedures that will be used on the data