Starting from:
$30

$24

Program 1 = Fortran

You are support staff for a Super Spy. You will need to write a program that will tell your Super Spy boss which locker the stolen nuclear bomb is located……..which locker in the Student Union Buliding….dun, dun, dun (dramatic drum beat music for intense effect).

This code must run on a tiny microchip on the end of the Super Spies ballpoint pen. It must be concise and reliable so of course you will choose the Fortran Programming language to complete this task.

The SUPER SPY will receive a number, you don’t know where it is going to come from, you don’t want to know, you must ask the SUPER SPY for the number. The SUPER SPY will then input the code via the fancy keyboard that bluetooths into the ballpoint pen…..it also has a fancy digital output on the side of the pen. It’s a Super Spy pen.

The SUPER SPY will input a number between 1000 and 1,000,000. You must take that number and send it to two procedures in your Fortran code, the first will return the second digit in the number, the second procedure will return the 3 rd digit in the number. Then you will output the two digits as a two digit locker number, the third digit which is returned will the ones, and the 2nd digit from the first procedure will be the tens……..example below. You will prompt the super spy to give you the number by

asking for the Super spies hat size. Cryptic because this is Super Spy stuff…..



Hat size?

348172

Use 71

In the example above you print “Hat size?” The Super Spy enters 348172. You then take 348172 and send it to your first procedure that will return the 7, hold on to that 7. You then send 348172 to the second procedure which will return the 1 (which is the 3 rd digit). You then take the 7 and the 1 and make the number 71 which you print out with the word “Use” back to your Super Spy.

First get this code working on the VM machine with the Fortran compiler…..we’ll worry about cross-

compiling for the SuperSpy microchip pen later. But since the SUPER SPY pen has very limited memory you only have so many lines of code to complete the task.

Maximum lines of code = 24 (this includes the required lines of Program, Subroutines, the three implicit none lines you need and declaration of all variables needed. Blank lines and commented lines were all that wasn’t counted)……..I was actually at 21 in my answer.

The Super Spy is going to pay you 50 bucks (points) for this program.

14 for getting it working.

8 for each subroutine working properly, (math, receiving returning values)

5 for proper output as above 

15 for staying under the maximum lines of code (24, see above) , subtract five for each line over the maximum given up to 15 points.

Here is my code running, notice the spaces are still there on the output, that is fine

More products