Lab Activity # 6

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 an integer (k) greater than 10:

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 which are multiples of 7.

Press 2 for the product of the integers from 1 to k which are multiples of 7.

 

  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).