0% found this document useful (0 votes)
30 views4 pages

12SDD Task 1 - Task Description

This document describes a task to create algorithms for encoding and decoding secret messages. It provides examples of different encoding algorithms and documentation requirements, including providing the source code, pseudocode, and flowcharts for the encoding and decoding algorithms, as well as responses to questions about debugging tools, parameters, and data structures used.

Uploaded by

tedzone9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views4 pages

12SDD Task 1 - Task Description

This document describes a task to create algorithms for encoding and decoding secret messages. It provides examples of different encoding algorithms and documentation requirements, including providing the source code, pseudocode, and flowcharts for the encoding and decoding algorithms, as well as responses to questions about debugging tools, parameters, and data structures used.

Uploaded by

tedzone9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

12SDD task 1: Secret messages

Known variously by secret agent “big ant” as segassem terceS, eSrctem seasegs, ecret messageS,
esSecret messag, Ltektz dtllqitl, Vhfuhw phvvdjhv, Sr sgeemsecteas, certeS sesgesam

Overview
In this task, you are required to construct a series of algorithms to encode and decode secret messages as
part of a body of work including other documentation. You will create a program to accept a message
and produce encoded and decoded versions of it. The best programs will also be able detect if a given
message was already encoded, decide which encoding algorithm was used and then show the decoded
message. You will also create some documentation and answer some written questions.

Submission
Use OneNote to document and complete your task. When accessing the “11-12SDD” notebook, you will
see a section just for you with a Secret messages template already copied in – paste algorithms and
flowcharts into the allocated spots and you can provide the other documentation under the appropriate
headings. There is also a Handy hints page available for the task in OneNote.

Task details
Complete as many algorithms as possible and provide the following documentation:

 Encoding algorithms : a secret agent may wish to use your program to encode a message with
their chosen encoding algorithm. Provide the source code and matching pseudocode and
algorithm flowchart for each of your completed message encoding algorithms. Each should be
copied into the provided appropriate cell in your personal OneNote encoding algorithms table
 Decoding: messages entered by the secret agent may already have been encoded by one of the
encoding algorithms, so your program should attempt to reverse the encoding for each encoding
algorithm. Show your decoding algorithms and supporting subprograms
 Desk check : provide a desk check of one of your buggy algorithms, identifying and explaining the
bug and an appropriate fix for it. Include the code as it was when desk checked (ie the buggy
code).
 IPO chart : provide an IPO chart of your most complex working encoding algorithm
 Structure chart : provide a structure chart that matches your final solution
 Reflective responses : provide responses to each of the following questions in terms of your
program
o Debugging tools question : Including evidence for a sample bug, describe how 2
automated debugging tools available in your IDE helped you to locate a particular bug.
Evidence should include cropped screen grabs showing the use of your debugging
techniques and the buggy code. If your IDE doesn’t include any automated debugging
tools, describe how 2 manual debugging methods helped you to locate a particular bug.
Evidence should include the buggy code showing your debugging techniques.
o Parameters question : Using an example from your code, explain how the use of
parameters assisted one aspect of your coding.
o Data structures question: Describe and explain the impact on your code of changing the
data structure you used to store the secret agent’s entered message to another type. For
example you may like to consider Strings, arrays or another more complex data type.
Secret message encoding algorithms
A brief description and example of each encoding algorithm is shown below for secret agent “big ant”.
Some algorithms have an easier and a harder version: you only need to do one of each of these, but will
get extra difficulty marks with each harder versions (see marking guidelines). Case (capitalisation) should
be preserved in all algorithms.

 reverse : reverse the order of characters in a message string. Rather than using any language’s
inbuilt reversing functionality, recode the sample given here to make it work with a loop going in
the opposite direction. Make the loop start at the index of the last character in the string,
continuing as long as the index is at least 0 and decrementing by 1 each iteration. You will
probably need to build up the result by adding the i’th character to the end of the result in each
iteration. Use .charAt(i) to get the i’th character of a string.
Example: reverse(“Secret message”) should return “egassem terceS”

 swap pairs : swap adjacent pairs of characters in a message string. If there is an odd number
characters, include it at the end of your result without any swaps. You could loop through the
message, going up by 2 each iteration, adding the next character and then the current character
to a result string.
Example: swapPairs(“Secret message”) should return “eSrctem seaseg”
 rotate left :
o easier version : move each character one position to the left, with the first character
wrapping to the end. You could store the first character in a temporary variable, then
loop through all characters of the message after the first, adding it into a result string;
when the loop completes, you could then add the first character you saved to the end.
Example : rotateLeft(“Secret message”) should return “ecret messageS”
o harder version : move each character n positions to the left, where n is the alphabetic
position of the first character of your last name. The first n characters should each wrap
to the back. You don't have to rotate if the message is too small (but can if you want).
Example : rotateLeft(“Secret message”, 2) should return “cret messageSe”
 rotate right :
o easier version : move each character one position to the right, with the last character
wrapping to the front. You could start a result string with the last character from the
message, then loop through all message characters except the last, adding each to the
result.
Example: rotateRight(“Secret message”) should return “eSecret messag”
o harder version : move each character in the message n positions to the right where n is
the alphabetic position of the first letter of your first name. The last character should
wrap to the front. You don't have to rotate if the message is too small (but you can if you
want).
Example : rotateRight(“Secret message”, 2) should return “geSecret messa”
 qwerty : use qwertyiuopasdfghjklzxcvbnm or QWERTYUIOPASDFGHJKLZXCVBNM replacements
for a-z or A-Z (ie a->q, b->w, e->e, A->Q etc). You could have 52 binary selections (ugly and slow
to code) or a String or array containing the qwerty alphabet (perhaps one for upper case as well).
The index of the qwerty character would be the position in the normal alphabet that a character
from the message is.
Example: qwerty(“Secret message”) should return “Ltektz dtllqit”
 add :
o easier version : add one position in the alphabet to each character in the message.
z or Z should become a or A. Eg a->b, b->c, x->y, y->z, z->a, A->B etc.
Example: qwerty(“Secret message”) should return “Tfdsfu nfttbhf”
o harder version: add n positions in the alphabet to each character in the message where n
is the number of characters in your last name
Example: add(“Secret message”, 3) should return “Vhfuhw phvvdjh”
 realign :
o easier version : imagine rewriting the message character by character spread
across two separate lines. Add a full stop to the 2nd line if it’s shorter than the first.
The result should then be each of the two lines joined together in order.
Example: realign(“Secret message”) should return “Sce esgertmsae”
o harder version : as above, but the message is initially rewritten of n separate
lines, where n is the number of characters in your first name. Add a full stop to
any line that is shorter than the first before joining them for the final result.
Example: realign(“Secret message”, 3) should return “Sr sgeemsectea.”
 vowels and consonants : vowels rotate left to the previous vowel position and consonants move
right to the next consonant position within each separate word. A word is anything bounded by
non-alphabetic characters
Example: vowelsAndConsonants(“Secret message”) should return “certeS sesgema”

The UI is not marked for this task, but showing everything may help when coding, especially to help
identify bugs. Here are 2 examples of secret agent “big ant” using one version of the program, hoping to
encode a message (on the left) and hoping to decode a message (on the right).
Marking guidelines
Component Description Marks

A desk check that correctly tracks variable values through an algorithm 5


to correctly identify and explain a bug and an appropriate fix. Your
Desk check
desk check should have a column for each relevant variable in the
algorithm, showing how they change

An IPO chart that succinctly but accurately describes the input, 5


IPO chart
processing and output of one of your encoding algorithms

A structure chart that matches your final solution and follows the 5
Structure chart appropriate conventions, showing loops, decisions, parameters and
results on calls to subprograms

Descriptive information (features of each aspect) and explanatory 10


information (effect of or reason for each aspect) for each question that
Reflective responses
shows good understanding of the relevant concepts. Matching
evidence and examples included where appropriate

1 point for each pseudocode or algorithm or flowchart where they 24


Encoding
match

Decoding ½ point for each successful decoding 4

½ point for each harder version encoding; 5


½ point for each harder decoding which loops over all possibilities (eg
Difficulty different values of n);
1 point for automated decoding of encoded messages based on which
decoding produces the highest number of dictionary word

You might also like