Sample run of angles.f90.
To avoid typing the same input values over and over, you can put test cases in
text files and then use the input redirection capability of unix to
feed them into your program.
To test my angles program against the turn-in cases, I created four
text files, one for each case. These files are just plain text files that
contain the input in the exact same format that my program wants it:
angles1.txt contains:
001D13'41"
134D46'28"
angles2.txt contains:
095D00'13"
158D20'57"
angles3.txt contains:
273#01'17"
330D50'35"
angles4.txt contains:
318D11'12"
112D11'48"
Now to run my program for the first turn-in case, all I have to do is
./angles <angles1.txt
So here's what the last part of my session log (a.k.a. script file) would
look like:
[~/angles]$ ./angles < angles1.txt
Please enter the first angular measurement, in dddDmm'ss" format:
Please enter the first angular measurement, in dddDmm'ss" format:
001D13'41"
+ 134D46'28"
------------
136D00'09"
[~/angles]$ ./angles < angles2.txt
Please enter the first angular measurement, in dddDmm'ss" format:
Please enter the first angular measurement, in dddDmm'ss" format:
095D00'13"
+ 158D20'57"
------------
253D21'10"
[~/angles]$ ./angles < angles3.txt
Please enter the first angular measurement, in dddDmm'ss" format:
illegal input, missing unit indicator(s)
[~/angles]$ ./angles < angles4.txt
Please enter the first angular measurement, in dddDmm'ss" format:
Please enter the first angular measurement, in dddDmm'ss" format:
318D11'12"
+ 112D11'48"
------------
070D23'00"
Back to Bobs CmpSc 201-F page.