CSCI P415/515 | Fri Jan 6 15:18:04 EST 2012 [SDJ] |
https://www.cs.indiana.edu/svn/csci_p415_svn/class/your-id
In subdirectory
https://www.cs.indiana.edu/svn/csci_p415_svn/class/your-id/0/
you will find a text file,
profile.txt
.
Edit this file, providing information about yourself; for instance,
P415/515 Participant Profile ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ NAME : Steve Johnson LOGIN-ID : sjohnson LIST COMPUTER SCIENCE COURSES YOU HAVE TAKEN :
c211, c343, c335, c241, c311, p436, b441&2 LIST COMPUTER SCIENCE COURSES YOU ARE TAKING :
p423, b401 GIVE A BRIEF STATEMENT OF YOUR INTERESTS, CAREER GOALS, AND PURPOSE IN TAKING THIS COURSE :
This course satisfies distributional requirements for my BS degree. Also, I'm interested in programming language implementation and am curious about the issue of compiler correctness.
% svn commit -m "hw0" profile.txt Sending 0.txt Transmitting file data . Committed revision 332.
Below is an incomplete C program that reads list of numbers into an array, reverses those numbers in place, and outputs the results.
#include <stdio.h> int i, n, a[1000000]; int test_in () { while (!feof(stdin)) { scanf("%d\n", &a[n]); n = n+1; } return( n ); } void test_out (int n) { for (i = 0; i < n; i++) { printf("%d\n", a[i]); } } void reverse () { – Reverse the order of the first n numbers in array a – } int main () { n = test_in(); reverse(); test_out(n); return ( 1 ); }
There is a copy of this program at
reverse()
procedure
as specified in red above.
rev
. You may need to re-compile to get rid of syntax errors, but again,
do not test your solution.
rev
to the rev
must be a stand-alone, self-contained executable object that runs on a CS Network Linux machine.
The command
rev < in-file > out-file
NOTE: If you do not know C or C++ write a program that
reverses an array in the language of your choice, excluding scripting languages
like Python. Unless your result is a stand-alone, self-contained executable
object, do not copy it to the
rev
.
Test only for correct reversing of valid inputs. No provisions are specified for invalid inputs.
You will be provided with a pre-formatted file to report your results.