Question
IT 1090C Computer Programming I Prof. Tom Wulf Lab 13: File ListMaker Fall 2019-20 20 Points Directions: You will refactor our Lab 11 Listmaker lab.(For
IT 1090C Computer Programming I
Prof. Tom Wulf
Lab 13: File ListMaker
Fall 2019-20
20 Points
Directions:
You will refactor our Lab 11 Listmaker lab.(For your convenience, I have attached the lab 11 directions here at the end of this doc.You should not have to redo Lab 11...)
Instead of a single list held in memory, the new refactored program will be able to save and load lists from disk.
In addition to these existing options:
A - Add an item to the list
D - Delete an item from the list
P -Print the list to the screenChange this to V for view
Q - Quit the program
You will add:
O - Open a list file from disk
S - Save the current list file to disk
C - Clear removes all the elements from the current list
V -CHANGE THE P Print OPTION to V for View
You might notice that there is no explicit option for creating a new list. we merely use the add option to build the list in memory.
The big challenge here is to keep track of the program state:
oUse a boolean variable like needsToBeSaved to keep track of list edits. (Traditionally this has been called a 'dirty' flag.The file becomes 'dirty' when it needs to be saved.
oIf the user loads a list it does not need to be saved until it is changed by adding or deleting items.(The user could load a list only to view it and then would want to load another in its place without saving...)
oIf the user begins to build a list by adding items and does not load an existing list keep track of this new list. Prompt the user on exit to save the list or abandon it.
oSimilarly, prompt the user to save an unsaved list before loading a new list from disk.. etc.
oLoaded lists are always saved with the same filename.
oAll list files have the .txt extension
1.Name your project: ListFileMaker
2.Implement and thoroughly test your refactored code.
3.Provide a series of screen shots that document and establish that your program:
- Will load a list from disk
- Will save a list loaded from disk that has been modified by deleting or adding items using the same filename so it overwrites the file. Reload the changed file to clearly show that you were able to save the changes
- Will allow the user to make a new list and save it to disk with a provided basename.List files should have the .txt extension.
- bullet proof the program so that a user can't loose data:
- if they ask to load a file but have an unsaved list in memory, prompt them to first save the list.
- if they go to quit the program and have an unsaved list prompt them
Submission:
Submit your lab using the Lab 13 submission point in Canvas,
Submit a Lastname_Firstname_Lab_13_FileListMaker.zip include your word Lastname_Firstname_Lab_13_FileListMaker.docx file and also submit the docx file separately.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started