LIBRARY ROUTINES L1 and L100 should be used and only questions 9 and 11 should be treated as complete programs.
(1) Read a floating point number from input stream 1 and output its modulus in fixed point form, on a new line, on output stream 1. The number is less than 100 and is required to two decimal places.
(2) Read ten mixed numbers from input stream one to the store locations starting at word 10000.
(3) Modify the solution to example 2 so that n numbers are read, where n is an integer at the head of the data.
(4) Output the floating point numbers stored in locations 550 to 577 inclusive, in floating point form to 7 significant figures, each number on a new line. Use output two.
(5) Search the information on input stream 2 ignoring everything until the letter X (internal code 7.0) is encountered. Then read the following number to the accumulator and arrange that any further information on this line is ignored.
(6) Output the 20 numbers stored in word 512 onwards, five per line, in signed fixed point form, separated by at least two spaces. The numbers are less than 1000 and are required to four decimal places. Use output stream one.
(7) Input stream 1 consists of a set of numbers of the order 105 terminated by -1 (which does not form part of the set). Form the sum of these numbers and print it, preceded by the number of numbers read. End output on this line.
(8) How could the solution to example 7 be modified to accept * (internal code 1.6) as the terminator? Set any parameters required by L100.
(9) Read a set of 10 numbers from input stream 6, For each number x, output x on a new line, followed by sqrt(x). If x is negative, replace sqrt(x) by the letter I (internal code 5.1). Output should be in floating point form to five significant figures. Arrange to separate the exponent from the mantissa by a comma instead of enclosing it in brackets.
(10) Write a subroutine, R2, to evaluate sine θ and cosine θ given (in degrees) in the accumulator on entry. Store the functions in A99/0 and 1A99/0 respectively. (Use B50 for the link and make use of the extracodes 1730, am' = sin s and 1732, am' = cos s where s must be in radians. π = 3.141593).
(11) Use this routine to tabulate sine θ and cosine θ for θ at 10° intervals between 0° and 180°. Print θ as a three digit unsigned integer and sine θ, cosine θ as five digit fractions preceded by + or -. Ensure there are two spaces between each number and use output three.
(12) Print, on output zero, the character ≠. Output zero is a 7 hole paper tape punch, Write out the contents of B81 in binary just before exit to L1.
(13) Store the text:-
TAPE FAULT φ ≠ 7
in successive character locations in the store. Put the address of the first character in B21 and the number of characters in B22.
(14) In question 11, assuming output to be to 7 hole paper tape, arrange for the columns to be headed sin θ, cos θ respectively.
(15) Adapt the program of question 9 to read a title of one line from immediately before the first x on the data tape and to print it, followed by 13 new lines, after the last sqrt(x).
For the following examples use input and output extracodes.
(16) If input 5 is at the end of the current record read the first character of the next record; if not read the next character. Store it in the least significant 6 bits of halfword A10 if it is a six bit character or A11 and 0.4A11 if it is a binary character.
(17) Delete all previous output 4. Write the binary representation of M on 7 hole paper tape to Output 4, end the record and arrange for printing as soon as possible.
(18) Read a record (not binary) from input 3 and write it to output 5 unless there are more than 12 characters. In this case write the first 12 only and do not end the record. What alterations would be necessary to end the record in the latter case with 5 new lines?
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
Omit the instructions in store locations A1, 1A3, 2A3, 4A3. Replace "4)" by "21/L100".
(9)
(10)
(11)
(12)
(13)
(14)
(15)
(16)
(17)
(18a)
(18b)