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...
![Page 1: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/1.jpg)
The Software Construction Process
![Page 2: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/2.jpg)
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
![Page 3: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/3.jpg)
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.
![Page 4: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/4.jpg)
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
![Page 5: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/5.jpg)
Boards, Tubes, and Patch Cables
01001101101101011101100110110100001010110101100110101010010110111010011001001011
Application Program
![Page 6: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/6.jpg)
Setting Switches
01001101101101011101100110110100001010110101100110101010010110111010011001001011
Application Program
![Page 7: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/7.jpg)
I/O Devices and Operating System
01001101101101011101100110110100001010110101100110101010010110111010011001001011
01010101101010101010111001001011
ApplicationProgram
OperatingSystem
![Page 8: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/8.jpg)
Assembly Language, Monitor, and Keyboard
010011011011010111011001101101000010101101011001
01010101101010101010111001001011
ApplicationProgram
OperatingSystem
LOOP: LOAD A, R1LOAD 7, R2TEST R1, R2BRZ LOOP
101110101010101001011011
Assembler
![Page 9: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/9.jpg)
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;}
![Page 10: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/10.jpg)
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
![Page 11: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/11.jpg)
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
![Page 12: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/12.jpg)
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
![Page 13: The Software Construction Process. Computer System Components Central Processing Unit (Microprocessor) 01001101 10110101 11011001 10110100 00101011 01011001.](https://reader030.fdocuments.us/reader030/viewer/2022032723/56649f535503460f94c7787a/html5/thumbnails/13.jpg)
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