The purpose of this lab is to gain practice using control statements.
Your friend is interested in being able to sort a media collection. There will be a file containing media, and the request is to accept or delete each entry in the media file. File is attached here: movie_list.txt
Constraints:
Hint:
1. Add your input text file to the resource files folder
2. Use preprocessor directives to include input/output, file input/output, and string variables.
3. Declare the input file variable you will use in place of cin for file input.
4. Declare the output file variable you will use in place of cout for keep file output.
5. Declare the output file variable you will use in place of cout for delete file output.
6. Declare a variable to contain movie titles, of type string
7. Declare a variable to contain a user keystroke choice, of type char.
8. Separate Task 1 from Task 2 by pressing ENTER on your keyboard. This provides a single line of whitespace in your code
1. Use the variable from Task 1.3 to open the text file in Task 1.1.
2. Use the variable from Task 1.3 to assign value to Task 1.6.
3. Use a control statement to determine if the variable from Task 1.6 has value.
4. If Task 2.2 returns TRUE, prompt to either keep or discard the media identified by the string variable. The user decision will be stored in the variable from Task 1.7.
5. Use a control statement ( cannot be the same kind of control statement from Task 2.2 ) to read the variable from Task 1.7.
If it is the case that the user enters 'Y' for yes, write variable from Task 1.6 to the variable from Task 1.4.
If it is the case that the user enters 'N' for no, write the variable from Task 1.6 to the variable from Task 1.5.
If it is the case that the user enters any other variable, notify the user the input is invalid, then write the variable from Task 1.6 to the variable from Task 1.4.
6. Store an empty string to the variable from Task 1.6
7. Repeat Task 2.1 - 2.5 for each entry in movie_list.txt
8. Separate Task 2 from Task 3 by pressing ENTER on your keyboard. This provides a single line of whitespace in your code
1. Close the connection from the variable in Task 2.3.
2. Close the connection from the variable in Task 2.4.
3. Close the connection from the variable Task 2.5.
1. Determine appropriate locations to comment your code.
2. Is there a confusing section of code?
3. Is there a math operation?
4. Is there a control statement?
5. Is there a defined function?
6. You should not include "teaching comments" to explain:
Program run: see image.
Movies to Keep:
Army_of_Darkness_(1992).avi
Donnie_Darko.mp4
Life_of_Brian_(1979).avi
Lock,_Stock_and_Two_Smoking_Barrels_(1998).avi
National_Lampoon's_Christmas_Vacation_2_Cousin_Eddie's_Island_Adventure_(2003).mkv
Spaceballs_(1987).mkv
Movies to Discard:
Batman_&_Robin_(1997).m4v
Dr._Strangelove_or_How_I_Learned_to_Stop_Worrying_and_Love_the_Bomb_(1964).m4v
Repo!_The_Genetic_Opera_(2008).mkv
To_Wong_Foo_Thanks_for_Everything,_Julie_Newmar.mp4