HELP!Urgent!

I can't seem to do this.
How to do this? Need Help Quick!?
Task: Numbers game
Two players A and B have created two files "data1.txt" and
"data2.txt", each stores exactly 5 integers between 1 and 5 in any order.

You are are to determine which player will win the game by
comparing the corresponding integers in the files and produce the
follwing report ( See Sample output ):

Sample input:
File("data1.txt")
2 1 5 3 4

File("data2.txt")
1 4 5 2 3

Sample output:( Display on screen )
Game A B
1. 2 1 A
2. 1 4 B
3. 5 5 Draw
4. 3 2 A
5. 4 3 A

A Won: 3-1



Open data1.txt for input
open data2.txt for input

Variables list:
int a, b, a_score, b_score, i;

Initialise a_score, b_score to 0

display the heading "Game A B" and an End of line
Repeat 5 times (i=1 to 5 ) {
read integer a from data1.txt
read integer b from data2.txt
display i, a, b
if ( a > b ) {
display "A"
add 1 to a_score
} else if ( a < b ) {
display "B"
add 1 to b_score
} else {
display "Draw"
}
display an End of Line
}

display a blank line
if ( a_score > b_score )
display "A Won " and a_score "-" b_score (eg. 3-1)
elseif ( a_score < b_score )
display "A Lost " and a_score "-" b_score
else
display "Draw" and a_score "-" b_score

close all files

End of algorithm



(Note: Output should be A Won: ?-?, A Lost: ?-? or Draw: ?-? )
How does your program look so far? Or should we just solve your homework?
show us the code you have so far.
Topic archived. No new replies allowed.