Read, predict, and change your first Ada program · 3 Lessons
English

Ada Engineering

Module 1 – Read, predict, and change your first Ada program

Page 2 of 3 · About 15 minutes per lesson, including practice.

Make one change and collect evidence

Save the complete example as main.adb in your practice folder, or use the Ada practice editor provided by the code lab. With an installed GNAT toolchain, build with gnatmake main.adb, then run ./main. Keep compiler messages separate from program output: the first describes translation problems, while the second comes from your running program.

Now change the initial count to one without changing the condition. Write down your expected output before you run again. Does the second message still appear? Track the count on paper after each statement. Restore the original, remove one semicolon, and read the first diagnostic. Fix that one problem before investigating any later messages, which may be consequences of the same mistake.

Example code on Agila Forge ↗

Complete this lesson

Answer every check correctly to earn your lesson certificate. Feedback helps you review and try again.

Sign in · Save your progress and earn a certificate for this lesson.