Exercise 2: Enhanced Simulation Program (40%)




Document: Software Engineering 1: Lab Exercises

next Session 12: Week 24/25: Exploring Pointers
up Session 11: Week 22/23: Simulating an RC
gif Exercise 1: Basic Simulation Program (60%)

Exercise 2: Enhanced Simulation Program (40%)

Now enhance your program in the following ways.

Instead of automatically prompting for the required parameter values, the program should offer the user a choice of reading the values from the keyboard or from a file (which would have been prepared in advance). When the user opts for reading from the keyboard, the program should prompt for, and read the parameters just as before. Where the users opts for a file, the program should prompt for the file name, and then read the parameter values from the file (without issuing any prompts). If the program encounters any difficulty reading the parameters from the specified file, it should offer the user a choice between giving up, or respecifying the file to read from, or reverting to reading the parameters from the keyboard.

Once the program has successfully got a set of parameter values, it should offer the user a choice between output to the screen, or output to a file. Again, in the former case, the program should continue as before; but in the latter case, it should prompt for the name of the file to output the results to.




Document: Software Engineering 1: Lab Exercises

next Session 12: Week 24/25: Exploring Pointers
up Session 11: Week 22/23: Simulating an RC
gif Exercise 1: Basic Simulation Program (60%)



McMullin@eeng.dcu.ie
Tue Apr 30 14:15:37 GMT 1996