Load previous sting...8 III.. Library, function and variable declaration...9 2... Start the program - Before input... Left, right - Before operation... - Before operation cursor position
Trang 1FACULTY OF ELECTRICAL AND ELECTRONIC ENGINEERING
2021 – 2022
-* -Project: Data structure and algorithms
Topic 5 ECE391: Computer System Engineering
HOANG PHUOC VUONG-1751115
HO QUANG TAM-1751082 TRAN HOANG DUY-1751017
Ho Chi Minh City, 6/2021
Trang 2I Topic requirements 2
II Program operation 3
1 Basic structure 3
2 Results 4
a Start the program 4
b Left, right 5
c Delete 6
d Insert 7
e Load previous sting 8
III Program source code 9
1 Library, function and variable declaration 9
2 Main() function 9
3 Input() function 10
4 Kb() function 10
5 Read() function 11
6 Print() function 12
7 Move() function 13
1
Trang 31.Topic requirements
“Write a simple text editor using the list ADT (Problem P-6.3, Textbook, page 266).”
2 Program operation
1 Basic structure
Trang 42 Results
a Start the program
- Before input
Trang 5- After input string :”bachkhoahochiminh”
b Left, right
- Before operation
Trang 6- After press right arrow key:
-After press left arrow key :
c Delete
Trang 7- Before operation( cursor position at the last character)
- After operation ( we deleted “hochiminh” from the previous sting)
d Insert
Trang 8- Before operation
- After operation (we inserted “hochiminh2020”)
Trang 9e Load previous sting
- Before operation
- After operation
Trang 103 Program source code
1 Library, function, and variable declaration
2 Main() function
Trang 11- The function ask for the users ‘s desired operation and implement it right after recieve the input In the case the input is invalid, the program will ask them to input it again
Trang 12- In the third operation, the random file is input from the user so that we have to check whether the program can open that file or not If not, an announcement will be displayed and user will have to input it again The variable “o” is use for this purpose while o = 0 mean no file are currently opened and o = 1 mean a file is opened
4 Kb() function
5 Read() function
6 Print() function
Trang 138 Insert() function
Trang 1410 Save() function