You are to write a program that reads in competition results for asingle team from a file and calculates the final score for the team. The file name must be supplied by the user, and you must deal with incorrect file names appropriately. The input format and output formats are described below.
Input File Format. The input file will be of the following format:
² Row one of the file will have two integers: the number of problems and number of judges. You can assume that the number of problems will always be greater than zero and less than 10. You can assume that the number of judges will always be greater than two and less than 10.
² The next row in the file will be the di±culty rating for each of the problems.
² There will then be multiple rows giving results for the team for each problem. They will have the format:
problem number, time taken, score from judge 1, score from judge 2... etc.
Note that the team may not have attempted every problem.
For example:
3 6
2.1 1.9 1.8
2 10 6.0 2.1 6.5 7.0 8.0 7.5
1 30 2.3 7.0 7.0 7.0 7.0 7.0
3 15 1.9 5.0 6.5 7.0 7.0 5.5
could anyone give me clue how to start coding this program. I have to use arrays .
your kind help will be greatfull.
Hi there,
this is my first attempt and I need a help in solving the program.
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[])
{
FILE *DATA; //READS the file
char c;
char no_prob[5];
char no_judges[5];
/* -no_problems ,judges , difficulty , time , scores
*/
/*This program reads the file as every character , What I need is if it can store the
Character values in the appropriate strings so that we can start using it, what I found out is
that first I need to work on it as characters until I split the data then convert using atoi and atof.
sample for the test data