chapter 8: introduction to high-level language programming

71
Chapter 8: Introduction to High-Level Language Programming Invitation to Computer Science, Java Version, Third Edition

Upload: clarke-morton

Post on 30-Dec-2015

32 views

Category:

Documents


0 download

DESCRIPTION

Chapter 8: Introduction to High-Level Language Programming. Invitation to Computer Science, Java Version, Third Edition. Objectives. In this chapter, you will learn about Where do we stand? High-level languages Introduction to Java Virtual data storage Statement types. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Chapter 8: Introduction to High-Level Language Programming

Chapter 8: Introduction to High-Level Language ProgrammingInvitation to Computer Science,

Java Version, Third Edition

Page 2: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 2

Objectives

In this chapter, you will learn about

Where do we stand?

High-level languages

Introduction to Java

Virtual data storage

Statement types

Page 3: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 3

Objectives (continued)

Meeting expectations

Managing complexity

Object-oriented programming

Graphical programming

The big picture: Software engineering

Page 4: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 4

Where Do We Stand? Early days of computing

Programmers were satisfied with assembly language Programs mostly written by very technically

oriented people

Later decades Programmers demanded a more comfortable

programming environment Programs were now also written by “nontechie”

people

Page 5: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 5

High-Level Languages

High-level programming languages

Called third-generation languages

Created to overcome deficiencies of assembly language

Expectations of a high-level language program

The programmer need not manage the details of the movement of data items within memory nor exactly where those items are stored

Page 6: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 6

High-level Languages (continued) Expectations of a high-level language program

(continued)

Programmer can take a macroscopic view of tasks; “primitive operations” can be larger

Program will be portable

Programming statements will be closer to standard English and use standard mathematical notation

Page 7: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 7

Transition of a High-level Language Program

High-level langauge program

compiler Low-levelcode

Secondtranslator

Object code in machine langauge

linkerComplete object code

Executable module loaded into memory

Harware Resultes

Page 8: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 8

Introduction to Java: A Simple Java Program Comments

Give information to human readers of code Class header

Announces that a class is about to be defined Class

A collection of methods Method

A section of code that performs a service

Page 9: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 9

Figure 8.2 A Simple Java Program

Page 10: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 10

Running a Java Program

File containing the Java code Same name as the class File extension .java Example: TravelPlanner.java

Running a Java program Program compiled

Example: File TravelPlanner.class created Translation to object code completed; program

linked, loaded, and executed

Page 11: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 11

Virtual Data Storage

Identifiers Names in a programming language

Keyword Has a special meaning in Java

Java is a case-sensitive, free-format language Variable

A named location in memory Must be declared before it can be used

Page 12: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 12

Figure 8.4

Some of the Java Primitive Data Types

Page 13: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 13

Virtual Data Storage (continued) An array

Groups together a collection of memory locations, all storing data of the same type

Figure 8.5

A 12-Element Array Hits

Page 14: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 14

Statement Types

Input/output statements

Input statement

Collects a specific value from the user for a variable within the program

Output statement

Writes a message or the value of a program variable to the user’s screen or to a file

Page 15: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 15

Statement Types (continued)

Assignment statement

Assigns a value to a program variable

Control statement

Directs the flow of control

Can cause it to deviate from the usual sequential flow

Page 16: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 16

Input Statements

A prompt

A message that tells the user what kind of input the program wants

Console class

Not a standard Java class; written for this book

Can be used to handle both the prompt and the retrieval of the value in one statement

Page 17: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 17

Input Statements (continued)

Methods readInt

readDouble

readChar

Syntax

variable1 = Console.readInt(prompt);

variable2 = Console.readDouble(prompt);

variable3 = Console.readChar(prompt);

Page 18: Chapter 8: Introduction to High-Level Language Programming

Eg

public class TravelPlanner { public static void main(String[] args) { int speed = 1; double distance = 0; double time;

speed = Console.readInt("Enter speed in mph:"); distance = Console.readDouble("Enter your distance in miles;"); time = distance/speed; System.out.print("At " + speed + "mph, it will take " + time + "hours to travel " +

distance + " miles"); } }

Invitation to Computer Science, Java Version, Third Edition 18

Page 19: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 19

Output Statements

Output to the screen

System.out.println(string);

The string can be Empty

System.out.println();

Literal stringSystem.out.println("Here's your answer." );

Composed of two or more itemsSystem.out.println("Give me " + 5);

Page 20: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 20

The Assignment Statement

General form

variable = expression;

Expression is evaluated first; the result is written into the memory location specified on the left

Page 21: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 21

The Assignment Statement (continued)

Examples

B = 2; Suppose that B is an integer variable

A = B + C; Suppose that A, B, and C are integer variables

Letter = 'm'; Suppose that Letter is a variable of type char

Page 22: Chapter 8: Introduction to High-Level Language Programming

Type casting: happen when an integer value is assigned to a double value.

Initialize variable as soon as they they declared, like: int count = 0;

Invitation to Computer Science, Java Version, Third Edition 22

Page 23: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 23

Control Statements

Types of control mechanisms Sequential

Instructions are executed in order

Conditional The choice of which instructions to execute next

depends on some condition

Looping A group of instructions may be executed many

times

Page 24: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 24

Control Statements (continued) Sequential is default mode of execution

Conditional flow of control

Evaluation of a Boolean condition (also called a Boolean expression)

The programming statement to execute next is based on the value of the Boolean condition (true or false)

Page 25: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 25

Control Statements (continued) Conditional flow of control (continued)

if-else statement

if (Boolean condition)

S1;

else

S2;

if variation of the if-else statement

if (Boolean condition)

S1;

S1, S2 may be compound statement (may have serval statements)

Page 26: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 26

Figure 8.10

Conditional Flow of Control

(If-Else)

Page 27: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 27

Figure 8.11

If-Else with Empty Else

Page 28: Chapter 8: Introduction to High-Level Language Programming

Comparison Operator

Symbol Example Example Result

== 2==5 F

< 2<5 T

<= 2<=5 T

> 2>5 F

>= 2>=5 F

!= 2!=5 T

Invitation to Computer Science, Java Version, Third Edition 28

Page 29: Chapter 8: Introduction to High-Level Language Programming

Boolean Operator

Operator Symbol Eg Eg result

AND && (2<5)&&(2>7) F

OR || (2<5)||(2>7) T

NOT ! !(2==5) T

Invitation to Computer Science, Java Version, Third Edition 29

Page 30: Chapter 8: Introduction to High-Level Language Programming

public class TravelPlanner

{

public static void main(String[] args)

{

int speed = 1;

double distance = 0;

double time;

int hours = 0;

int minutes = 0;

char choice = 'M';

speed = Console.readInt("Enter speed in mph:");

distance = Console.readDouble("Enter your distance in miles;");

choice = Console.readChar("Decimal hours or hours and mins");

if (choice == 'D')

{

time = distance/speed;

System.out.print("At " + speed + "mph, it will take " + time + "hours to travel " + distance + " miles");

}

else

{

time = distance/speed;

hours = (int) time;

minutes = (int)((time - hours)*60);

System.out.print("At " + speed + "mph, it will take " + hours + " hours " + minutes + " minutes " + distance + " miles");

}

}

}

Invitation to Computer Science, Java Version, Third Edition 30

Page 31: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 31

Control Statements (continued) Looping (iteration)

The loop body may be executed repeatedly based on the value of the Boolean condition

while statement

while (Boolean condition)

S1;

Page 32: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 32

Figure 8.13

While Loop

Page 33: Chapter 8: Introduction to High-Level Language Programming

public class TravelPlanner {

public static void main(String[] args) {

int speed = 1;

double distance = 0;

double time;

int hours = 0;

int minutes = 0;

char choice = 'M';

char more = 'Y';

more = Console.readChar("Want to plan a trip? (Y or N):");

while (more == 'Y') {

speed = Console.readInt("Enter speed in mph:");

distance = Console.readDouble("Enter your distance in miles;");

choice = Console.readChar("Decimal hours or hours and mins: ");

if (choice == 'D') {

time = distance / speed;

System.out.print("At " + speed + " mph, it will take " + time + " hours to travel " + distance + " miles ");

} else {

time = distance / speed;

hours = (int) time;

minutes = (int) ((time - hours) * 60);

System.out.print("At " + speed + " mph, it will take " + hours + " hours " + minutes + " minutes " + distance + " miles ");

}

}

System.out.println();

more = Console.readChar("Want to plan another trip? (Y or N):");

}

}

Invitation to Computer Science, Java Version, Third Edition 33

Page 34: Chapter 8: Introduction to High-Level Language Programming

Another Example

Algorithm (Psudo code)

Get value for user’s choice about continuing

While user wants to continue, do the following steps

Get value for pool radius

Get value for choice of task

If taske choice is circumference

Compute pool circumference

print output

Else (task to aread)

Compute pool area

print output

Get value for user’s choice about continuing

Stop

Invitation to Computer Science, Java Version, Third Edition 34

Page 35: Chapter 8: Introduction to High-Level Language Programming

public class SportsWorld {

public static void main(String[] args) {

double radius = 0.0;

double circumference = 0.0;

double area = 0.0;

char taskToDo = ' ';

char more = 'Y';

more = Console.readChar("Want to process a pool? (Y or N):");

while (more == 'Y') {

System.out.println();

radius = Console.readDouble("Enter the value of radius:");

System.out.println("Enter your choice of task: ");

taskToDo = Console.readChar("C to circumference; A to compute area ");

if (taskToDo == 'C') {

circumference = 2 * Math.PI * radius;

System.out.print("The circumference for a pool of radius " + radius + " is " + circumference);

} else {

area = Math.PI * radius * radius;

System.out.print("The area for a pool of radius " + radius + " is " + area);

}

System.out.println();

more = Console.readChar("Want to process another trip? (Y or N):");

}

}

}

Invitation to Computer Science, Java Version, Third Edition 35

Page 36: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 36

Meeting Expectations

Java meets the four expectations for a high-level programming language

Expectations

The programmer need not manage the details of the movement of data items within memory nor pay any attention to where specifically they are stored

Page 37: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 37

Meeting Expectations (continued) Expectations (continued)

The programmer can take a macroscopic view of tasks, thinking at a higher level of problem solving

Programs written in high-level languages will be portable rather than machine-specific

Programming statements in a high-level language

Will be closer to standard English

Will use standard mathematical notation

Page 38: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 38

Managing Complexity: Divide and Conquer

Divide and conquer

Divide the problem into small pieces

In a computer program

Divide the code into modules or subprograms, each of which does some part of the overall task

Empower these modules to work together to solve the original problem

Page 39: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 39

Figure 8.20 Structure Charts

Page 40: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 40

Using Methods

Method

A module of code in Java

Named using ordinary Java identifiers

By custom, name starts with a lowercase letter

Page 41: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 41

Using Methods (continued)

Two types of methods

void method Does not pass any value back to the main method

nonvoid method Returns a single new value back to the main method

Overall form of a method invocation

method-identifier(argument list) (same class)

class-identifier.method-identifier(argument list) (different class)

Page 42: Chapter 8: Introduction to High-Level Language Programming

public class SportsWorld {

public static void main(String[] args) {

double radius = 0.0;

double circumference = 0.0;

double area = 0.0;

char taskToDo = ' ';

char more = 'Y';

more = Console.readChar("Want to process a pool? (Y or N):");

while (more == 'Y') {

System.out.println();

radius = Console.readDouble("Enter the value of radius:");

System.out.println("Enter your choice of task: ");

taskToDo = Console.readChar("C to circumference; A to compute area ");

System.out.println();

if (taskToDo == 'C') {

circumference = doCircumference(radius);

System.out.print("The circumference for a pool of radius " + radius + " is " + circumference);

} else {

area = doArea(radius);

System.out.print("The area for a pool of radius " + radius + " is " + area);

}

System.out.println();

more = Console.readChar("Want to process another trip? (Y or N):");

}

}

42

Page 43: Chapter 8: Introduction to High-Level Language Programming

public static double doCircumference(double radius)

{

double circumference = 0;

circumference = 2 * Math.PI * radius;

return circumference;

}

public static double doArea(double radius)

{

double area = 0;

area = Math.PI * radius * radius;

return area;

}

public static void Prompt(double radius)

{

System.out.println(“radius: “ + radius);

}

}

Invitation to Computer Science, Java Version, Third Edition 43

Page 44: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 44

Writing Methods

General form of the method headerscope-indicator return-indicator identifier(parameter list)

Arguments in Java are passed by value

A variable declared within a method can be used only within that method

Return statement Syntax

return expression;

Page 45: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 45

Figure 8.27

Some Java Terminology

Page 46: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 46

Object-Oriented Programming: What Is It? Object-oriented programming (OOP)

A program is a simulation of some part of the world that is the domain of interest

Each object is an example drawn from a class of similar objects

Key elements of OOP Encapsulation

A class consists of its subtask modules and its properties, and both components are “encapsulated” with the class

Page 47: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 47

What Is It? (continued)

Key elements of OOP (continued)

Inheritance

Once a class A of objects is defined, a class B of objects can be defined as a “subclass” of A

Polymorphism

One name, the name of the service to be performed, has several meanings, depending on the class of the object providing the service

Page 48: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 48

Java and OOP

Java is an object-oriented programming language

Objects: Instances of a class

Instance variables: Properties

Instance methods: Services

Static method Can be invoked by giving the class name, a dot,

the method name, and a list of arguments. Use class to call static method

Page 49: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 49

Java and OOP (continued)

Syntax to request an object to invoke a method

object-identifier.method-identifier(argument list)

Calling object

The object that invokes a method

Page 50: Chapter 8: Introduction to High-Level Language Programming

package myproject; public class SportsWorld { public static void main(String[] args) { double newRadius = 0.0; char taskToDo = ' '; char more = 'Y'; Circle SwimmingPool = new Circle(); more = Console.readChar("Do you want to prcess a new pool? (Y or N): "); while (more == 'Y') { System.out.println(); newRadius = Console.readDouble("Enter the value to the radius of the pool: "); SwimmingPool.setRadius(newRadius); System.out.println("Enter your choice of task."); taskToDo = Console.readChar("C to compue ciucumference, A to compute area: "); System.out.println(); if (taskToDo == 'C') System.out.println("the ciccumference for a pool radius " + SwimmingPool.getRadius() + " is " + SwimmingPool.doCircumference()); else System.out.println("the area for a pool radius " + SwimmingPool.getRadius() + " is " + SwimmingPool.doAreaY());

more = Console.readChar("Do you want to prcess a new pool? (Y or N): "); } } }

Invitation to Computer Science, Java Version, Third Edition 50

Page 51: Chapter 8: Introduction to High-Level Language Programming

public class Circle {

public void setRadius(double value)

{

radius =value;

}

public double getRadius()

{

return radius;

}

public double doCircumference()

{

return 2 * Math.PI * radius;

}

public double doArea()

{

return Math.PI * radius * radius;

}

private double radius;

}

Invitation to Computer Science, Java Version, Third Edition 51

Page 52: Chapter 8: Introduction to High-Level Language Programming

One more examplepublic class Circle {

public void setRadius(double value)

{

radius =value;

}

public double getRadius()

{

return radius;

}

public double doCircumference()

{

return 2 * Math.PI * radius;

}

public double doArea()

{

return Math.PI * radius * radius;

}

private double radius;

}

Invitation to Computer Science, Java Version, Third Edition 52

Page 53: Chapter 8: Introduction to High-Level Language Programming

public class Rectangle {

public void setWidth(double value)

{

width =value;

}

public void setHeight(double value)

{

height =value;

}

public double getWidth()

{

return width;

}

public double getHeitgh()

{

return height;

}

public double doArea()

{

return width * height;

}

protected double width, height;

}

Invitation to Computer Science, Java Version, Third Edition 53

Page 54: Chapter 8: Introduction to High-Level Language Programming

public class Square {

public void setSide(double value)

{

side = value;

}

public double getSide()

{

return side * side;

}

public double doArea()

{

return side * side;

}

private double side;

}Invitation to Computer Science, Java Version, Third Edition 54

Page 55: Chapter 8: Introduction to High-Level Language Programming

public class Square2 extends Rectangle{

public void setSide(double value)

{

width = value;

height = value;

}

}

Invitation to Computer Science, Java Version, Third Edition 55

Page 56: Chapter 8: Introduction to High-Level Language Programming

public class Ceometry {

public static void main(String[] args) {

Circle joe = new Circle();

joe.setRadius(23.5);

System.out.println("The area of a circle with radius " + joe.getRadius() + " is " + joe.doArea());

Rectangle luis = new Rectangle();

luis.setWidth(12.4);

luis.setHeight(18.1);

System.out.println("The area of a rectangle with dimensions " + luis.getWidth() + " and " + luis.getHeight() + " is " + luis.doArea());

Square anna = new Square();

anna.setSide(3);

System.out.println("The area of a square with side " + anna.getSide() + " is " + anna.doArea());

Square2 tyler = new Square2();

tyler.setSide(4.2);

System.out.println("The area of a square with side " + tyler.getWidth() + " is " + tyler.doArea());

}

}

Invitation to Computer Science, Java Version, Third Edition 56

Page 57: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 57

What Have We Gained?

Two major advantages of OOP

Software reuse

A more natural “world view”

Page 58: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 58

Graphical Programming: Graphics Hardware

Bitmapped display The screen is made up of thousands of individual

picture elements, or pixels, laid out in a two-dimensional grid

Frame buffer Memory that stores the actual screen image

Terminal hardware displays the frame buffer value of every individual pixel on the screen

Page 59: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 59

Figure 8.34

Pixel Numbering System in a Bitmapped Display

Page 60: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 60

Graphics Software

Graphics library Contains a collection of software routines that

control the setting and clearing of pixels

Abstract Windowing Toolkit (AWT) Contains routines that allow users to create

powerful interfaces

Swing components Even more powerful GUI components than AWT

Page 61: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 61

Graphics Software (continued) Graphics class

Contains drawing commands that allow you to

Draw geometric shapes (lines, rectangles, ovals, polygons, and so on)

Set, change, and define colors

Fill in or shade objects

Create text in a range of fonts and sizes

Produce graphs and charts

Page 62: Chapter 8: Introduction to High-Level Language Programming

Egimport java.awt.*;

public class Graph {

public static void main(String[] args) {

Frame f = new Frame("Eg 1");

f.setSize(500, 500);

f.setVisible(true);

Graphics g;

g = f.getGraphics();

g.setColor(Color.blue);

while (true)

{

g.drawLine(168, 112, 112, 168);

g.drawOval(100, 100, 80, 80);

g.drawString("No Entry", 112, 145);

}

}

}

Invitation to Computer Science, Java Version, Third Edition 62

Page 63: Chapter 8: Introduction to High-Level Language Programming

Other functions

drawRect(int x, int y, int width, int height); drawRoundRect(int x, int y, int width, int

height, int arcWidth, int arcHeight); fillRect(int x, int y, int width, int height); fillRoundRect(int x, int y, int width, int height,

int arcWidth, int arcHeight); fillOvel(int x, int y, int width, int height);

Invitation to Computer Science, Java Version, Third Edition 63

Page 64: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 64

The Big Picture: Software Engineering Software life cycle

The overall sequence of steps needed to complete a large-scale software project

Implementation represents a relatively small part of the cycle

Page 65: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 65

Figure 8.36

Steps in the Software Development Life Cycle

Page 66: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 66

Scaling Up

Programs written by students No longer than a few hundred lines

Real-world programs 2, 3, or 4 orders of magnitude larger

Large-scale software development Extensive planning and design needed

A team of programmers needed

Software engineering

Page 67: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 67

The Software Life Cycle

Each step in the software development life cycle

Has a specific purpose and activities

Should result in a written document

The feasibility study

Problem specification

Program design

Page 68: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 68

The Software Life Cycle (continued) Algorithm selection or development, and

analysis

Coding

Debugging

Testing, verification, and benchmarking

Documentation

Maintenance

Page 69: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 69

Modern Environments

Integrated Development Environment (IDE) speeds program development by providing

A text editor

A file manager

A compiler

A linker and loader

Tools for debugging

Page 70: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 70

Summary

In a high-level language, the programmer

Need not manage storage nor movement of data values in memory

Can use more powerful program instructions that are more like natural language

Can write a much more portable program

Java is an object-oriented, high-level programming language

Page 71: Chapter 8: Introduction to High-Level Language Programming

Invitation to Computer Science, Java Version, Third Edition 71

Summary (continued)

In Java, an if-else statement can be used to create a conditional flow of control

In Java, a while loop can be used for iteration

Software life cycle: Overall sequence of steps needed to complete a large-scale software project