[Year 12 SofDev] Your homework!

Mark Kelly kel at mckinnonsc.vic.edu.au
Fri Oct 12 13:09:11 EST 2007


Refer to SD VITTA exam 2, Q10b - algorithm...

Module Print_marks
Begin
     Display heading
     Enter Test_mark1
     Enter Test_mark2
     If Test_mark1 < 0 or Test_mark1 > 100
         Display error message
         End program
     Else
         Display prompt for user
         Input Test_mark1
     End if
     Test_total <- Test_mark1 + Test_mark2
     Case of Test_total
     Case: Test_total > 100
         Display ‘S’
     Case: Test_total >= 160
         Display ‘HD’
     Case: Test_total < 100
         Display 'F'
     End Case
End

Q10b. Under what circumstances will the user be asked to enter 
'Test_mark1’ again?

The suggested answer is "If test_mark1 is < 0 or > 100"

Can you spot something rather odd with this?
Only 4 of my 13 kids did :-)

-- 
Mark Kelly
Manager - Information Systems
McKinnon Secondary College
McKinnon Rd McKinnon 3204, Victoria, Australia
Direct line / Voicemail: 8520 9085
School Phone +613 8520 9000
School Fax +613 95789253
kel AT mckinnonsc.vic.edu.au

Webmaster - http://www.mckinnonsc.vic.edu.au
IT Lecture notes: http://vceit.com
Moderator: IT Applications Mailing List

You'll know when we are officially a civilised race: our schools have 
all the money they need and the Air Force has to run a chook raffle to 
buy a new bomber.



More information about the sofdev mailing list