C++ program design, Have specific requirements, Full compliance is required

profileuraguy
project2_s19.pdf

CO SCI 243 Programming Project # 2 (100 points)

Your goal is to implement an application that reads a file, modify its content, and writes the

modification back to the same file. The file includes 2 lines of integers. The first line indicates which

integer on the third line has been selected (active). And the second line lists all the integers (maximum

of 10).

Your application should have a menu that is constantly displayed on the screen (see the menu below).

Right below the menu, the program should display list of all integers in the file (second line). Also it

should show which integer is currently selected (active).

The user should be able to select a menu item by entering its associated key or by pressing one of the

indicated extended keys on the keyboard.

“Insert” will insert an integer before the selected item and makes the newly inserted item active. The

integer is typed by the user. If the list is full, insertion will not be possible. Do not accept incorrect

values.

“Delete” deletes the active item.

“Sort” sorts the list in ascending order. The active item after the sort is same as the active item before

the sort.

“Select” selects the next item in the list. If the last item is selected, this option selects the first item in

the list.

“Move Right” moves the selected item one position to right. If the last item is selected, moving right

will not be possible. “Move Left” moves the selected item one position to left. If the first item is

selected, moving left will not be possible.

“Exit” ends the application.

Make sure to use the top-down design to break your program to many simpler tasks (at least one

function per task). Do not use global variables. Make sure to check the special cases. Example: list is

full or list is empty.

Your program should copy the content of the file into an array and a variable when you start the

program. The program write back the content of the array and the variable into the file when you exit

the program. When you are using the program, you should modify the array and variables and not the

file.

Make sure to test your program completely before submission. Do not forget to add comments.

Submit your well-documented C++ program via Canvas.

Menu: Insert "1" or "Insert" key

Delete "2" or "Delete" key

Sort "3" or "F2" key

Select "4" or "Down Arrow" key

Move Right "5" or "Page Down" key

Move Down "6" or "Page Up" key

Exit "7" or "F1" key