Answer:

    PRINT "Enter the number of repeats"
    INPUT LIMIT

|   IF LIMIT < 0 THEN
|     PRINT "Number must be zero or greater"
|
|   ELSE
|
|     LET COUNT=1
| |   DO WHILE COUNT <= LIMIT
| | |   IF COUNT < LIMIT / 2 THEN
| | |     PRINT "Hello"
| | |   ELSE
| | |     PRINT "Mars"
| | |   END IF
| |
| |   LOOP
|     PRINT "Done"
|
|   END IF

    END

All the brackets are matched up, each bracket matches one of its own type, and inside brackets match inside brackets.

End of the Chapter

If you have carefully gone through this chapter, you have learned much more about programming than you might think! This chapter discusses fundamental ideas about program creation that are used in nearly all programming languages, and are used in nearly all programming projects, large and small. Perhaps you would like to review what you have learned?

You have reached the end of the chapter.

go to previous page   go to home page