You are on page 1of 13

The Software

Construction Process
Computer System Components
Interne
t Primary Storage
Network Interface Devices
(RAM)
(Modem, Network Card) 01001101
10110101
Input Devices Output Devices
(Mouse, Keyboard) (Monitor, Printer) 11011001
10110100
Communications Bus 00101011
01011001
10101010
Central Processing 01011011
Secondary Storage Unit 10100110
(Hard Drive, (Microprocessor)
CD-ROM Drive) 01001011
A Software Requirement
Develop a program that finds and prints
all numbers between 1 and 10,000 that
are divisible by both 7 and 3. For each
number found, display the number and
the product of the two quotients.
The Requirement and the Design
S
Set number to 1
Develop a program
No
that finds and prints Number less than
all numbers between or equal to 10,000

1 and 10,000 that are Yes


divisible by both 7 and 3. No
Number divisible by 7
For each number found,
Yes
display the number and
No
the product of the two Number divisible by 3
quotients. Yes
Print number information

Increment number by 1

F
Boards, Tubes, and Patch Cables
Application Program
01001101
10110101
11011001
10110100
00101011
01011001
10101010
01011011
10100110
01001011
Setting Switches
Application Program
01001101
10110101
11011001
10110100
00101011
01011001
10101010
01011011
10100110
01001011
I/O Devices and Operating System
01010101
Operating 10101010
System 10101110
01001011
01001101
10110101
11011001
10110100
Application 00101011
Program 01011001
10101010
01011011
10100110
01001011
Assembly Language, Monitor,
and Keyboard
01010101
Operating 10101010
System 10101110
01001011
10111010
10101010
Assembler
01011011

01001101
10110101
LOOP: LOAD A, R1 11011001
Application
LOAD 7, R2 10110100
Program
TEST R1, R2 00101011
BRZ LOOP 01011001
Compiler (Syntax and Semantics)
01010101
Operating 10101010
System 10101010
#include <stdio.h> 10111010
int main (void) Assembler 10101110
{ 01001011
int anAnswer;
float aValue;
10101011
anAnswer = aValue / 3; Compiler 00101010
printf(“%d\n”,anAnswer); 01101011
return 0;
} 11011001
Application 10110100
Program 00101011
01011001
Algorithm in C Source Code
aNumber = LOWNUMBER;
while (aNumber <= HIGHNUMBER)
{
firstQuotient = aNumber / FIRSTDIVISOR;
if ( (aNumber % FIRSTDIVISOR) == 0 )
{
secondQuotient = aNumber / SECONDDIVISOR;
if ( (aNumber % SECONDDIVISOR) == 0)
{
theProduct = firstQuotient * secondQuotient;
printf("%d %7.2f %7.2f %8.2f\n",aNumber, firstQuotient,
secondQuotient, theProduct);
} // End if
} // End if
aNumber++; // Increment aNumber by one

Note: This is only a portion of the complete C program


From Requirements to Running Program
Design Fundamentals Software Requirements
Design Method
Coding Standards Software Design

Text Editor
C Header Files program.c (Source Code)

Compiler (and
Preprocessor)
Function Libraries program.o (Object Code)

Linker
Input/Output Facilities program.exe (Executable Code)

Operating System
Software Construction Process
Requirements
1

DESIGN 2 3 COMPILE

8 4
EDIT and A
SAVE
BASELINE E LINK
B
D
C
7 5
TEST and
RUN
SQA 6
Note: See next slide for meanings of A - E
Categories of Errors
• A: Compiler errors – doesn’t follow preprocessor or C
syntax
• B: Linker errors – functions declared but not defined;
no main function; function library not found
• C: Run-time errors – segmentation fault; out-of-range
errors; wrong data types
• D: Logic errors – wrong use of control statements;
errors in function arguments; algorithm coded incorrectly
• E: Design errors – doesn’t follow design or satisfy
requirements; design has flaws

You might also like