Alternative-9 1PP
Alternative-9 1PP
Overview
Purpose: Apply your functional decomposition skills to a new task with familiar
elements.
Learning Outcomes: 2 3 4 5
Submission Details
Assessment Criteria
In this task it is left to you to decide how the program should be broken down into methods (as a
rough guide, a 🏁 Completed solution will have between 5 and 9 relatively small methods,
including main). We will accept a broad range of solutions, not merely the sample solution we
created when designing the task.
A description of the program and its functionality is given next, followed by a number of
suggestions for how to implement some of the more advanced functionality.
Text Editor
Steps:
1 Display the program's name
2 Prompt the user to enter a piece of text
(any characters are allowed)
3 Convert that String to upper case and then an array of its
individual characters
4 Do
4-1 | Display the array's current contents as a single piece of text,
| prefixed by "Text line: "
4-2 | Display a menu of operations for interacting with that text
5 While the user has not selected quit
After step 2 the original line of text is no longer used, only the array of characters, but whenever it
is displayed it will appear as a single piece of text. For example, if the user typed ‘Hello World’ then
it will be displayed later (at line 4-1) as ‘Text line: hello world’.
Implementation advice
(If you really want to try to do it with library functions then look at the StringBuilder, but be aware
it works with Strings, not char[], so you will need to create a String first.)