Import JJIO Class RoutineExamples -- Name: Anon O'Mous -- Does: Show many routine methods Routine spellOut (number) is public Slot number ofType int -- Does spell out small digits If (number == 0) then Output "zero " ElseIf (number == 1) then Output "one " ElseIf (number == 2) then Output "two " -- ElseIf (number == etc.. Else Output number EndIf EndRoutine spellOut Routine formatMoney (amount) is public Slot amount ofType real Box iAmount ofType int Boxes dollars, cents ofType int -- Outputs money in form $ddddd.cc rounded Set amount = 100.0 * amount Set iAmount = RealToInt (amount + 0.5) Set dollars = iAmount / 100 Set cents = iAmount % 100 Output "$" Output dollars Output "." If (cents <= 9) then Output "0" -- fill tenths EndIf Output cents EndRoutine formatMoney Routine outRow (times, mark) is public Slot times ofType int Slot mark ofClass Str -- Does draw a row of marks many times Repeat ExitOn (times == 0) Output mark Dec times by 1 EndRepeat EndRoutine outRow Routine Tester (none) is private Boxes a,b,c ofType real Boxes i,j,k ofType int -- Does test or "drive" various routines Start Outputln "Enter a positive integer " Input i Outputln i Call spellOut with (i) Call outRow with (i, "*") Output " " -- gap EndRoutine Tester EndClass RoutineExamples