jkh1919 wrote: |
---|
Right now I am pretty far behind in C++. I studied the syntax and a few examples of if statements, for while and do loops, and case statements, I did one assignment with a 2 dimensional array that I had a good bit of help with but seriously doubt I could do it on my own, another random program.That's all I can remember. One of my other classes keeps me so busy it is very difficult to focus the amount of attention on this class that I need to. But oh well I have no choice but to somehow make a miracle happen in the next 6 days and if it is humanly possible, I plan to do it. I have no choice but to get this right the first time so I'm pretty much all in at this point. Here's the assignment that is due on the 14th On a given exam, the points awarded for each problem are recorded in a text file, with one line of the file for each student that took the exam. Create a program that reads this text file and determines • each student’s total grade for the exam • the class average for the exam • the average number of points given for each problem Program Requirements • The input data file will be a plain text file with each number separated by a single space. • All numerical data (student ID, scores) must be stored in a 2-dimensional array. o The final column of the array should hold the total score for each student. Caution: do not include the student ID in the sums! o The final should hold the averages for each column. o There will be 4 problems and 5 students, so the array should hold 6 rows (5 students + average) and 6 columns (ID, 4 grades, and exam total). • All calculations and array access must be performed using pointers and dereferencing. You may use [ ] only when reading and writing the data files. • The results must be printed to the screen as well as written to a file in table format. Program Organization Your program should contain the following functions: main, loadDataFile, calculateResults, writeResultsFile, and printResults. • main – create empty 6x6 2-D array to hold data and then call other functions as needed, passing them the array • loadDataFile – read the input file, storing the data in the 2-D array • calculateResults – performs all calculations • writeResultsFile – creates and writes the resulting array to the output data file • printResults – prints the results to the screen Example Input: 1 20 22 12 10 2 20 10 19 25 3 10 0 20 21 4 25 25 25 25 5 15 20 19 17 Example Output File 1 20 22 12 10 64 2 20 10 19 25 74 3 10 0 20 21 51 4 25 25 25 25 100 5 15 20 19 17 71 0 18 15.4 19 19.6 72 I'm sure this will be no easy task, but if it is at all possible, or just possible to be able to at least "half way" (for lack of a better word) do it, because right now, I would have no clue where to start. And please, before anyone says it I'll just say it myself. I know this is not all the result of my other classes yes, I am responsible for my own situations, just like everyone else. That's not why I'm here, I am here because I need some serious help and quick. With that being said, I need as much advice as I can get on how to possibly cram that much info into my brain in that amount of time, given the time it will take me study for other classes, sleeping, and everything else that is non condusive to studying programming. Believe me if I didn't have to sleep I wouldn't. If anyone knows of any crash course like tutorials (besides the one on C Programming.com with Alex Allain (used that one already). If there is anything else anyone can offer me I will take it into consideration as these last few days are pretty much my last chance to pull out of a serious rut of a semester altogether. I need help with accounting and Access databases also, ESPECIALLY databases. Any help is appreciated thanks. |