Pass Task 3.2 Name tester.docx - Swinburne University of...

This preview shows page 1 - 4 out of 4 pages.

Swinburne University of Technology Introduction to Programming Doubtfire Submission Pass Task 3.2 - Name Tester Submitted By: Isaac Kar Wai Low Tutor: Tanya Linden October 29, 2015 File 1 of 2 1 program NameTester ; 2 uses TerminalUserInput ; 3 4 procedure OutputSillyName ( name : String ) ; 5 var 6 i : Integer ; 7 8 begin 9 i := 0; 10 Write (name , ’ is a ’ ) ; // Write output w/o going to new line 11 while i < 100 do 12 begin 13 WriteLn ( ’silly ’ ) ; 14 i += 1; 15 end ; // loop statement repeats till ´ı reaches 100 16 17 WriteLn ( ’name.’ ) ; 18 end ; 19 Produced by Doubtfire 3
Swinburne University of Technology Introduction to Programming Doubtfire Submission 20 procedure Main () ; 21 var 22 name : String ; 23 24 begin 25 name := ReadString( ’Please enter your name: ’ ) ; // nested if-then in pascal 26 if name = ’Isaac’ then 27 begin 28 WriteLn ( ’Your name is the best in the world!’ ) ; 29 end

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture