Pseudocode and comments

From 22116
Jump to navigation Jump to search
Previous: The path and simple file reading Next: Python Input-Output

Required course material for the lesson

Powerpoint: Pseudocode, comments and user interface
Video: The use of pseudocode and comments
Video: Playing the guessing game, strategies and advice.
Video: Live Coding
Blog: On User Interface 1, by the founder of StackExchange.
Blog: On User Interface 2, by the founder of StackExchange.
Blog: On User Interface 3, by the founder of StackExchange.
Blog: Designing the software product, by the founder of StackExchange.

Subjects covered

Pseudo code, which is "pretend" code, that tries to look like a program.
Comments, which is essential for understanding, maintenance, explanation, memory and other good stuff.
User interface, how the program should interact with the user.

Advice

Are you looking for files? See the top line of the Programme page.

Exercises to be handed in

In all these exercises, start with writing pseudo code first and the program after. This is how you should do normally.
The pseudo code is part of the hand-in.

  1. Returning to last weeks exercise 4, where you had to ask for a file name and you program would then calculate the average of the numbers in the file. Do the same this time, except you have to continue to ask for file names and calculate the average until you enter nothing - no file name. Test on the same files as last time.

Exercises for extra practice