Pseudocode and comments: Difference between revisions

From 22116
Jump to navigation Jump to search
(Created page with "__NOTOC__ {| width=500 style="float:right; margin-left: 10px; margin-top: -56px;" |Previous: The path and simple file reading |Next: Python Input-Output |} == Required course material for the lesson == Powerpoint: [https://teaching.healthtech.dtu.dk/material/22116/22116_03-PseudoComments.ppt Pseudocode, comments and user interface]<br> Video: [https://panopto.dtu.dk/Panopto/Pages/Viewer.aspx?id=79ac24c4-603c-4a6e-9343-af2701292c8c The use of pseudocode and comme...")
 
Line 23: Line 23:


== Exercises to be handed in ==
== 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.
In all these exercises, start with writing pseudo code first and the program after. This is how you should do normally.<br>
The pseudo code is part of the hand-in.
<font color="#AA00FF">
<font color="#AA00FF">
# 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.
# 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.

Revision as of 17:37, 25 August 2025

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