In the case of count and replace, because the space character marks the end
of the string
|
- The first time that program is run it displays an introduction with a
brief description of the features: 1 mark
|
|
- When the user quits the program it displays a brief conclusion/signoff
message: 1 mark
|
|
- Program shows a menu of the main features of the program (count,
length and replace): 1 mark
|
|
- Declares a new type 'MyString' as a
one-dimensional character array: 1 mark
|
|
- Declares an instance of type 'MyString':
1 mark
|
|
- Can read user input into this instance of 'MyString':
1 mark
|
|
- Can display the contents of this instance of 'MyString':
1 mark
|
|
- Error prevention: Program prevents overflow of the array, it will
count the number of characters entered by user and stop reading after the
8th character: 6 marks
|
|
- Count: After the user enters a string and a character, the program can
count the number of occurances of that character: 6 marks
|
|
- Length: Determines the length of the string entered by the user
(excluding the space): 6 marks
|
|
- Replace: After the user enters a string and a search character and a
replacement character, the program can replace all occurances of the
search character with the replacement character: 6 marks
|
|
- General error checking: Can determine when an empty string has been
entered (e.g., the user hits enter without typing in a string) and when
one is encountered the program will not count occurances of letters nor
will it perform a search and replace. The length of the string will be
zero characters: 6 marks
|
|
- Error checking, counting occurances: Can determine when the user tries
to count the number of occurances of the space and in such a case the
program will display an error message and not perform the count: 3
marks
|
|
- Error checking, search and replace: Can determine when the user enters
a space as the search character and in such a case the program will
display an error message and not perform the search and replace: 3
marks
|
|
- Error checking, search and replace: Can determine when the user enters
a space as the replacement character and in such a case the program will
display an error message and not perform the search and replace: 3
marks
|