CS 180 Lab 1: Getting Started with Ada GIDE
This is a lab exercise to help you get started with using the Ada GIDE
development environment. You will learn the process we will use
throughout this class for editing, compiling and executing Ada
programs. Completion of this lab requires getting the program from
the professor.
- Launch Windows Explorer. You should always have Explorer
running when you program, to keep track of your files. Set the View
Options so that known file extensions are NOT hidden. Create a Y:\Ada
subdirectory by viewing your Y: directory, making sure nothing else is
selected, and choosing New, then Folder from the File menu. View your
Y:\Ada subdirectory.
- Launch Ada GIDE. You do this by choosing GNAT Ada 95 Compiler
from the Program menu, then choosing Ada GUI IDE (usually referred to as
Ada GIDE). Choose New from the File menu of Ada GIDE. This will give
you a blank
file in which to type in your program. If you have already been
working on your program and want to edit your file, choose Open and
select the file from your Ada directory.
- Type in the program given to you in the class. (If you are doing
this lab outside of class, you need to get a copy of the program from
the instructor.) Be sure to type it exactly as written,
paying particular attention to semi-colons and colons. In most
situations, extra blank spaces are okay. Save your program by
choosing Save from the File menu or the Disk icon from the icon bar
(third from the right). The first time you save your file, Save will
ask you for the name. You should name your file Temperature.adb. It is
important that the name of your file correspond to the name after the
word procedure in the code that you typed in (without the
.adb extension). You should save your file
early and often, so
that you do not lose any work if there are problems.
- When you have finished typing in the complete program, you will
use the compiler to produce an executable program. There are two
steps to this process, compiling and linking. There are several ways
to perform these steps, as I will show you in the lab. Probably the
easiest is to just choose the Build icon from the icon bar at the top of
the window. It looks kind of like a car battery and is just to the
left of the Stop sign. This will both compile and (assuming the
compilation was successful) link your program. If it is successful,
you will see the word "Completed" at the bottom of the lower pane. If
there are problems, you will see error messages in this pane. Some of
these might be self-explanatory, some probably require the instructor
to explain them.
- When you are able to successfully compile and link your program,
you can run it. Do this by choosing the Green circle from the icon
bar. You should run your program several times with different inputs
to convince yourself that it is performing as it should.
- This is important. When you are ready to hand in your
completed program, you need to generate a listing file. You
do this by choosing Compile to Listing from the Run menu. This will
ask you if you want to open the listing file. You should do so and
look at it to make sure everything is okay. At the bottom it will
summarize any errors that might exist. If it is okay, you should
print this file. Be sure not to edit the listing file. You should
only ever edit the .adb file. You can go back and forth between
files using the Window menu.
- When you are done you should bring me a printout of your listing file.