Lab Activity # 5

Implement and test a Fortran 90 program which has the following features:

  1. When the user runs the program he/she gets the following displayed on the screen:

Enter a positive integer (k):

After the user enters a value for k (the integer number will be assigned to a variable called k.), he/she gets the following menu

 

Press 1 for  the sum of the integers from 1 to k.

Press 2 for k!

 

  1. If the user selects 1 or 2 he/she gets the job described above performed and the result will be displayed on the screen. Then, the program displays the following:

Continue? If not, press n or N, else press any other key.

If the user hits n or N, then the program stops running. If the user hits any other key, the program repeats the whole process (i.e. goes back to step #1.)

  1. If the user hits a key different than 1 or 2, then he/she must get the following message:

Invalid Option

            And then, the program repeats the whole process (i.e. goes back to step #1).