``Computer Literacy'' Assignment 4 1. Write a Fortran and a C program to read a file of numbers (one-per-record), do a bubble sort, and print the numbers. The length of the file is not known in advance. Make a file of 10 numbers ("random" order) and use it as input to your program. 2. Write a C function float numbers( int n, TWICE, int ind) that allocates n units of float storage; and returns an array of length n that is filled with the numbers 2.0, 4.0, ..., 2.*float(n) if the optional argument TWICE is present and nonzero, and is filled with the numbers 1.0, 2.0, ..., float(n) otherwise. Write a main program that initializes n to 10, calls numbers with the optional argument present and nonzero, prints the result, calls numbers with the optional argument absent, and prints the result. 3. Write a C function that accepts a floating point arguments x1 and x2, and an integer argument n and then uses SGI's GL to plot sin(x) versus x for x = x1 to x2 by (x2-x1)/n. Your routine should check to see that x2 is greater than x1 and "return gracefully" if it is not. Test your routine with two or three choices of input values. Use #include #include #include #include "aux.h" For information on GL, see the README file in /usr/people/4Dgifts/examples/glpg, and the examples in the various chapter subdirectories. There are man pages for the individual functions (not the auxiliary functions, but the others): man glClearColor To compile and link, use something like cc $1.c -lgl_s -lc_s -o $1 Add an entry to your Web page for ``Assignment 4'', in which you give links to the source programs above.