You are on page 1of 2

a. A brief description of notable obstacles you overcame.

There is no large obstacles, excepting translating notes, but


provided function is working well and resolve most of problems
b. A description of the design of your program.
there is follow pseudocode for isTuneWellFormed.
set previous symbol to slash
repeatedly:
for each symbol in tune string
if current symbol is slash
store current symbol to previous symbol and continue loop
elseif current symbol is letter in 'A'..'G' range then
store current symbol to previous symbol and continue loop
elseif current symbol is accidental sign and previous symbol is letter in
'A'..'G' range then
store current symbol to previous symbol and continue loop
elseif current symbol is digit and (previous symbol is accidental sign
or previous symbol is letter in 'A'..'G' range) then
store current symbol to previous symbol and continue loop
else
return false;
next symbol
if prevopis symbol is slash
return true
else
return false;
there is follow pseudocode for translateTune.
if tune is not well formed then return 1
set accumulated beat to ""
set beat count to 0
set temporary instructions to ""
repeatedly:
for each symbol in tune string
if symbol is slash then
if accumulated beat has 0 length
add space to temporary instructions
if accumulated beat has 1 length
add accumulated beat to temporary instructions as is
if accumulated beat has more than 1 length
add accumulated beat to temporary instructions within brackets
clear accumulated beat
increase beat count
else
set note letter to current symbol
if current symbol is not last then
if next symbol is accidental sign
store accidental sign
move to next symbol
if current symbol is not last then
if next symbol is digit sign
store octave
move to next symbol
translate note with octave, note letter and accidental sign

if translation is successull
add trabslated note to accumulated beat
else
store beat count
return 2
next symbol
return 0
c. A list of the test data that could be used to thoroughly test your program,
there is used all other test data, mentioned in assignment, because there is p
resent
correct answers too. it included empty stirng, empty beats and many other thi
ngs.

You might also like