Task 1 Task 2 Task 3
Random Name

Task 1

A textfile stores messages of congratulation for graduates at a secondary school.

A computer program is required to manipulate the textfile. Here is a suggested algorithm written in structured English.

Algorithm - series of steps to be followed to solve a problem

A user is prompted to enter a message.

The message is stored.

The program calls a function checkLength() which accepts the message as a parameter and returns TRUE if the message has 12 or more characters and finishes with an exclamation mark, and FALSE otherwise. This is an example of data validation.

If true is returned, the message is valid and it is appended to a file called congrats.txt. If false is returned, a message Invalid message is displayed.

The user is then prompted to enter another message.

The program stops when the user enters 0 instead of a message and finally the contents of the file are displayed.

Write the program code to implement this structured English algorithm.

Include in your design a function called checklength which has the following pseudocode header:

FUNCTION checklength(msg:STRING) RETURNS BOOLEAN

Don't forget to close the file appropriately.

golf

Task 2

This task is taken from a past paper - June 2018 - Paper 21 - Question 5

golf

Task 3

This task is taken from a past paper - Nov 2018 - Paper 23 - Question 5

Write program code for the function SaveStatus.

Random Name

Additional 1

Have a go at the class register task on File Handling in Python.

Random Name

Additional 2

Have a go at the mp3 playlist task on File Handling in Python.