I'm stuck

I'm new to c++ and my latest homework is really confusing to me. Here is the exact problem:
Create a program which will read from a file named "scores.txt" containing
a student's scores for this class. Assume the following about this fi le:
 The fi rst line contains 8 quiz scores, each out of 10.
 The second line contains 8 homework scores, each out of 10.
 The third line contains 8 classwork scores, each out of 10.
 The fourth line contains 3 project scores, each out of 20.
 The fifth line contains 2 exam scores, each out of 50.
Note: Because you know how many lines are in this file, and the number
and types of each score, you do not need a while loop to read in the data.
Your program should calculate: a quiz percentage, homework percentage,
classwork percentage, project percentage, and exam percentage out of the
total number of points possible for each category. Using the information
from our class syllabus on the weight of each category, use these percent-
ages to come up with a score from 0 to 100 representing the student's work
for the semester. Your program should place all of this information in a
table in a file named "summary.txt".

I know how to input and output, and I know how to calculate averages in c++ but here each line doesn't have the same amount of values. Also, he said we don't need a while loop. The only other loop we learned was the for loop. Do I need to use that? I'm also assuming there should be a few functions in this program but I can't figure out what they should be. This is what I have so far, but I got stuck:
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

double avg(double,double);

int main ()
{
ifstream inFile;
inFile.open("scores.txt");

ofstream outFile;
outFile.open("summary.txt");

string type;
double

return 0;
}
Last edited on
The clue your instructor gave you is "Because you know how many lines are in this file, and the number and types of each score ..." just hard-code the input:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

/*    The first line contains 8 quiz scores ...    */

Read into quiz variable 1
Read into quiz variable 2
(etc.)

/*    The second line contains 8 homework scores ...    */

Read into homework score 1
Read into homework score 2
(etc.)

Are you getting the idea?
Each line should be it's own statement? No loops or anything?
Topic archived. No new replies allowed.