The Software Construction Process. Computer System Components Central Processing Unit...
-
Upload
julia-mosley -
Category
Documents
-
view
216 -
download
0
Transcript of The Software Construction Process. Computer System Components Central Processing Unit...
The Software Construction Process
Computer System Components
Central ProcessingUnit
(Microprocessor)
01001101101101011101100110110100001010110101100110101010010110111010011001001011
Secondary Storage(Hard Drive,
DVD-ROM Drive)
Primary Storage(RAM)
Input Devices(Mouse, Keyboard)
Output Devices(Monitor, Printer)
Communications Bus
Network Interface Devices(Modem, Network Card)
Internet
A Software Requirement
Develop a program that finds and prints all integers between 1 and 10,000 that are evenly divisible by 7, and whose last digit on the right is a 4 or 6.
The Requirement and the Design
Develop a programthat finds and printsall numbers between1 and 10,000 that areevenly divisible by 7,and whose last digiton the right is a 4 or 6.
Set number to 1
Number less than or equal to 10,000
Number divisible by 7
4 or 6 in ones column
Print number
Increment number by 1
S
F
Yes
Yes
Yes
No
No
No
Boards, Tubes, and Patch Cables
01001101101101011101100110110100001010110101100110101010010110111010011001001011
Application Program
Setting Switches
01001101101101011101100110110100001010110101100110101010010110111010011001001011
Application Program
I/O Devices and Operating System
01001101101101011101100110110100001010110101100110101010010110111010011001001011
01010101101010101010111001001011
ApplicationProgram
OperatingSystem
Assembly Language, Monitor, and Keyboard
010011011011010111011001101101000010101101011001
01010101101010101010111001001011
ApplicationProgram
OperatingSystem
LOOP: LOAD A, R1LOAD 7, R2TEST R1, R2BRZ LOOP
101110101010101001011011
Assembler
Compiler (Syntax and Semantics)
11011001101101000010101101011001
010101011010101010101010
ApplicationProgram
OperatingSystem
101110101010111001001011
Assembler
101010110010101001101011
Compiler
#include <stdio.h>
int main (void){int answer;float value;
scanf(“%d”, &value);answer = value / 3;printf(“%d\n”,answer);return 0;}
Algorithm in C Source Code
#include <stdio.h>
int main(void){int number = 1;
while (number <= 10000) { if ( (number % 7) == 0 ) { if ( ((number % 10) == 4) || ((number % 10) == 6) ) { printf("%d\n", number); } // End if } // End if number++; // Increment number by one } // End whilereturn 0;} // End main
From Requirements to Running Program
Software Design
program.c or program.c (Source Code)
program.o (Object Code)
program.exe (Executable Code)
Software Requirements
Text Editor
Compiler (andPreprocessor)
Linker
Operating System
Design Method
Design Fundamentals
Coding Standards
Header Files
Function Libraries
Input/Output Facilities
Software Construction Process
EDIT andSAVE
COMPILE
LINK
RUNTEST and
SQA
BASELINE
DESIGN
Requirements
A
B
CD
2 3
1
4
5
6
7
8
E
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