The purpose of this project is to help you begin to use standard and class-specific packages. Everything you need is in Chapters 1-3; you need not, and should not, use any "extra" statements or anything from later chapters. Part 1 is just a "spider program" for which you need only to turn in a listing file. No Case Study is needed. Part 2 is a word problem requiring a Case Study.
First compile the Screen and Spider packages:
gcompile screen.ads
gcompile screen.adb
gcompile spider.ads
gcompile spider.adb
Now write and test a program that instructs the spider to draw a pattern in the shape of a highway "yield" sign, that is,
XXXXXXX X X X X X
Hints: Start the spider facing West, draw the top line, etc. Also note that you can get the spider to draw a "blank" by changing its color to black.
The goal of this project is to give you some experience in working with the package Ada.Calendar and with enumeration types. The project depends upon material in Chapters 2 and 3.
Calendar dates are fascinating to study. Different countries use different ways to represent the same date. Of course, the names of the months vary from language to language, but so does the style of displaying the date. Some countries put the month first; others put the day first. Some countries use an Arabic numeral for the month (e.g., April is 4), while others use a Roman numeral (e.g., April is IV).
Find out the names of the months in some human language, other than English, that uses a similar alphabet (German, French, Spanish, etc.). If you don't know any other languages, find a classmate who does.
Then develop a program that will display the current date in several different forms, each on a separate line. Using April 27, 1997 as the example, here are the forms:
27 april 1997
27.IV.1997
4/27/97
Use Program 3.6 as an example of how to determine the current date/time from the computer's clock, using Ada.Calendar operations.
Use an enumeration type for the month names, and another for the Roman numerals in the second example.
Notes: