08.17.15 - 12.13.15
Introduction to Computer Programming
Tuesday
05:30 PM - 08:20 PM
Pseudocode is structured and in proper form | 15 pts |
Program allows required prompts and inputs | 5 pts |
All required validations are performed correctly | 20 pts |
Specific and informative error messages are displayed when validations fail | 10 pts |
Total | 50 pts |
For this lab the goal is to design a program using pseudocode that has the ability to safely rename a file.
We can assume that our program will have a "change" command that can be given an existing filename and a new name and can then cause the filename to become the new name.
For example, we might have a file called test1.txt and we want to change it's name to sample.txt. We could, in our program design, say "change test1.txt to sample.txt" and the program would change the name of the file for us. Either of the two names could be represented with variable data.
Our program will also have the ability to tell if a specific name already exists. For example, "x1 exists?" would give a boolean value. Again, the filename used could be variable.
For our program to make the process of renaming a file safe, we need for it to not allow the user to rename a file in four situations.
If any of these conditions are found to exist the program should display a specific and informative error message and then exit. The user will NOT be give a second opportunity to enter the information. (no loops)
If none of those conditions exist then the filename should be changed.