Programming Process - Concordia University Wisconsin

Download Report

Transcript Programming Process - Concordia University Wisconsin

Quiz
5 points
CSC 175 - Dr. Gary Locklair
1 An algorithm must be:
A
B
C
D
CSC 175 - Dr. Gary Locklair
specifically focused
general purpose
ambiguous
analytical
2 In Word, sections allow:
A text wrapping around
images
B multiple author
collaboration
C fast USB-key storage
D different layouts
CSC 175 - Dr. Gary Locklair
Systems Assignment 1
due today
2 brochures
one with name
one without
CSC 175 - Dr. Gary Locklair
Programming Process
A review of programming
and the C++ language
(from CSC 150)
Chapter 7 in ICS
CSC 175 - Dr. Gary Locklair
Programming
the process used by
programmers when
using a programming
language to create
application packages
CSC 175 - Dr. Gary Locklair
Programming Language
A programming
language is a collection
of possible instructions
for the CPU (control unit)
CSC 175 - Dr. Gary Locklair
Purpose
allow a programmer to
create application
packages;
create
effective algorithms
in a computer language
CSC 175 - Dr. Gary Locklair
problem-solving levels:
Level 1 – creating
problem-solving tools
(programmers)
Level 2 – using problemsolving tools
(users)
CSC 175 - Dr. Gary Locklair
Steps in programming
level 1 problem solving
A - analysis
B - synthesis
CSC 175 - Dr. Gary Locklair
First Step
A. Understand the Problem
Example problems:
determine carpeting cost
CSC 175 - Dr. Gary Locklair
Programming Process
A1. To understand the
problem, determine
exactly what the
problem is
define the problem
CSC 175 - Dr. Gary Locklair
Programming Process
A2. To understand the
problem, determine
user requirements
what does the user
need in order to solve
the problem?
CSC 175 - Dr. Gary Locklair
Programming Process
requirements state:
the problem (clearly) &
what’s needed for a
solution
CSC 175 - Dr. Gary Locklair
Programming Process
To understand the
requirements,
determine
what output is needed
eg, cost of carpet
CSC 175 - Dr. Gary Locklair
Programming Process
don’t consider solutions
yet
focus on what’s required
to solve the problem
CSC 175 - Dr. Gary Locklair
Programming Process
AB. Plan the Solution
the segue between
analysis and synthesis
develop specifications
CSC 175 - Dr. Gary Locklair
Programming Process
specifications state:
A3. what the solution
“looks like” &
B1. what it does
CSC 175 - Dr. Gary Locklair
Programming Process
AB. Plan the Solution
Develop an outline to
solve the problem
How do you get started?
CSC 175 - Dr. Gary Locklair
Programming Process
Information Processing
order of specification:
1. Output 
2. Input 
3. Process 
4. Storage
CSC 175 - Dr. Gary Locklair
Programming Process
A3. specifications:
output - cost of carpeting
a room
input - length & width of
rooms in feet
(next, plan algorithm )
CSC 175 - Dr. Gary Locklair
Programming Process
B. Synthesis
plan and create the
solution (algorithms)
CSC 175 - Dr. Gary Locklair
Programming Process
once have specifications
for outputs and inputs,
then
create an algorithm
stating how to convert
inputs to outputs
CSC 175 - Dr. Gary Locklair
Programming Process
B1. design algorithms
use: Pseudocode (PDL)
Algorithms written in
English
CSC 175 - Dr. Gary Locklair
Programming Process
PseudoCode (PDL)
1. Input room length in ft
2. Input room width in ft
3. convert ft to yds
4. determine sq yds
CSC 175 - Dr. Gary Locklair
Programming Process
PseudoCode
3. convert ft to yds
3a. multiply length by 3
3b. multiply width by 3
CSC 175 - Dr. Gary Locklair
Programming Process
PseudoCode
4. determine sq yds
4a. multiply width in
yards by length in yards
CSC 175 - Dr. Gary Locklair
Programming Process
1. Input room length in ft
2. Input room width in ft
3. convert ft to yds
4. determine sq yds
step 5?
CSC 175 - Dr. Gary Locklair
Programming Process
B2. Implement algorithms
Create Code
Code = Algorithms in a PL
Can’t use English as it is
not precise (detailed and
unambiguous)
CSC 175 - Dr. Gary Locklair
Programming Process
{ // implementation
cout << “what is the length of room?”
cin >> length_ft;
cout << “what is the width of room?”
cin >> width_ft;
length_yds = length_ft * 3;
…
}
CSC 175 - Dr. Gary Locklair
Programming Process
3. Create Code
CSC 175 - Dr. Gary Locklair
Programming Process
B3. Test the Application
Run the application with
“test data” to ensure it
works correctly
(level 2)
CSC 175 - Dr. Gary Locklair
Reading Programs
ICS page 299
others as time …
CSC 175 - Dr. Gary Locklair
Programming Process
Assignment 2
modified problem 31,
page 369
(end of chapter 7 in ICS)
CSC 175 - Dr. Gary Locklair
Programming Process
Assignment 2
create codewarrior project
file on your Chemnitz
student data folder
under a folder called CSC175
under a folder called assn2
CSC 175 - Dr. Gary Locklair