28
Lesson 3 McManus COP1006 1

Lesson 3 McManus COP1006 1. You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Embed Size (px)

Citation preview

Page 1: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Lesson 3

McManusCOP1006 1

Page 2: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

You have to tell them ◦ what to do◦ what to use◦ in what order to do it and◦ what to do if your user

does not do what you want them to do!

McManusCOP1006 2

Page 3: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Don’t reinvent the wheel! Use solutions that have been

◦ already proven successful ◦ been created just to be reused

McManusCOP1006 3

Page 4: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Speed Readability Understandability Maintainability Reusability

McManusCOP1006 4

We take these into consideration We take these into consideration every timeevery time we create a program. we create a program.

Page 5: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Files◦ Program – set of instructions◦ Data – raw pieces of facts

McManusCOP1006 5

database

records

Data (fields)

files

Page 6: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

McManusCOP1006 6

DBMS

Database Management Systemmade up of one or more databases

DB

A databasemade up of one or more tables, queries, forms, reports, etc

Tableinformation related to one topicmade up of one or more records Rooms Instructors

Record

information related to one specific entitymade up of one or more fields Inventory Classes

Field

information related to one specific part of an entitymade up of one particular data type

Item NameItem Number

Student NameStudent SSN

Northwest Florida State College

FWB

ExampleDefinition

Page 7: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Memory location Used to store data during transfer between

internal memory and the external storage (hard drive or floppy)

Speeds up transfer of information◦ Input & output processes

McManusCOP1006 7

Page 8: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Semantics◦ The concept or idea of the item◦ Ex. The numeral three is an idea that humans

have established representing the concept of three items

Syntax◦ The physical/visible representation of the idea ◦ Ex. “three” “3”

McManusCOP1006 8

Page 9: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Tools◦ Problem Analysis Chart (PAC)◦ Structure/Interactivity Charts◦ Input Processing Output (IPO) Chart◦ Flowcharts◦ Hierarchy Charts

But…first we have to understand the Software Life Cycle

McManusCOP1006 9

Page 10: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

McManusCOP1006 10

Problem Definition

Software & Architectural DesignSystemRequirements Detailed Design

SpecificationsDesign Validation

Coding*Testing/

AcceptanceOperations/

Maintenance

Indicates= reiterative steps after testing and verification of each phase

*Implementation

The Waterfall Model

Page 11: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Understand the Problem Analyze the Requirements of the Problem Figure out what will be the outcome

Very often we’re not given the inputs to a problem, only the desired output.

McManusCOP1006 11

Page 12: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Given Data Required ResultsHours

PayRate

Gross Pay

Processing Required Solution AlternativesGrossPay = Hours * PayRate Define the Hours Worked and Pay

Rate as constantsDefine the Hours Worked and Pay Rate as variablesDefined the Hours Worked and Pay Rate as input values

McManus COP1006 12

Page 13: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

McManusCOP1006 13

Calculate Gross Pay

ObtainInput Values

Calculate Gross Pay

Print Pay Check

PR

HRS PR

HRSGP

GP

Page 14: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Input Processing Output

Hours Worked

Pay Rate

1. Enter Hours Worked

2. Enter Pay Rate

3. Calculate Pay

4. Print Pay

Gross Pay (the pay check)

McManus COP1006 14

Page 15: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Originally used to describe the entire program.

Now, used to define ◦ selection (decision) and ◦ repetition (looping) structures

McManusCOP1006 15

Page 16: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Flowlines◦ used when direction is in doubt

Start/(End/Stop/Exit) Processing I(input)/O(output) Decision

McManusCOP1006 16

Begin End

Calculate Gross Pay

Print Pay Check

MoreEmployees?

Page 17: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

McManusCOP1006 17

Snoozeor Off?

Alarm goes off!

Sleep or Get up?

Zzzzz!

Snooze

Sleep

Get Dressed. . .

Snooze= 9?

< 9

Ignore Alarm, Forget Boss,

Forget Instructor – Probably creating a problem?

Page 18: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Everything is included, but written in English rather than any one language’s syntax

Useful for debugging Ex.

McManusCOP1006 18

Obtain PayRateObtain HoursWorkedGrossPay equals PayRate Multiplied by HoursWorkedPrint GrossPay

Page 19: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Internal External

Written in different language styles

McManusCOP1006 19

Page 20: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Used to explain what is being done (and why) within the program

Most often takes the form of comments within the program◦ Written in Language that Programmer, not user,

will understand

McManusCOP1006 20

' Insert a new node in the binary search tree.

' If the root node is null, create the root node here.

' Otherwise, call the insert procedure of class TreeNo

Page 21: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Manuals or Help menus to assist the user◦ Includes

User Manuals System Manuals

User must be able to understand…

McManusCOP1006 21

Make text bold

1. Select the text you want to change.

2. Click Bold on the Formatting Toolbar.

Page 22: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Walkthroughs◦ Walking through the process to verify that the

solution is solving the right problem and works correctly

◦ You can use any of the charts or Pseudocode for this step

Helps find bugs

McManusCOP1006 22

Page 23: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

After determining that the solution is correct

Select the appropriate language Code the program

McManusCOP1006 23

Page 24: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Test the coded solution Best done by someone other than the

programmer

McManusCOP1006 24

Page 25: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

found in large-scale software projects are specification and design faults.

Where do most of these faults originate?◦ Not fully understanding the problem and ◦ then creating a specification based on an

erroneous problem definition. Industry’s high priority

◦ involves the development and use of techniques that will help find faults during the earliest phases.

McManusCOP1006 25

Page 26: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

Nowhere!It is not the

purpose to place blame when a fault is found…

Only to fix the fault!

McManus COP1006 26

Page 27: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

new problems arise, such as:◦ different styles of writing code, ◦ interface difficulties, ◦ different declared types (integer vs real)◦ different understandings of the problem caused

by communication problems, and ◦ even something as simple as the order in which

variables are listed within a procedure’s call statement.

McManusCOP1006 27

Page 28: Lesson 3 McManus COP1006 1.  You have to tell them ◦ what to do ◦ what to use ◦ in what order to do itand ◦ what to do if your user does not do what

McManusCOP1006 28