CS 172 Lab 4: Using and designing subprograms

In this lab you will use existing subprograms and write your own given a specification. If you look carefully, you may find code in this lab that will be particularly relevant to your first standalone programming assignment. Reading chapters 3 through 6 will help with the unfamiliar Ada concepts you might encounter in this lab. (Note the rapid increase in the speed at which we are covering material. . .)
  1. Launch Windows Explorer. Remember to set the View Options so that known file extensions are NOT hidden. View your Y:\Ada subdirectory.
     
  2. Save the following link: CalendarLab.adb Save the file as Y:\Ada\CalendarLab.adb
    View the directory listing in Windows NT Explorer to confirm that the file is now in your Y:\Ada subdirectory.
     
  3. Launch AdaGIDE. Open the file you just created, Y:\Ada\CalendarLab.adb.
     
  4. The code is an Ada program that has comments that indicate what its functionality should be. This program gets a date from the user, as well as a non-negative number of days. It outputs the date that results from adding the number of days to the original date.
     
  5. You need to extend and complete this program by:
  6. You will also find it to your advantage to try to understand how the rest of this program works, particularly the ValidDate function. This function is not exactly what is required for your first program, but it is pretty close. You should be able to understand the AddDays procedure as well. What kind of loop does it use?
     
  7. When you are ready you should bring me: