Data structures to be used
The program should use two distinct structure-types to store the students’ scores: the 1st type used for keeping scores of 4 quizzes while the 2nd type is used to keep the scores of 2 exams. A student can have either quizzes (if Engineering student) or exams (if Computer Science student) but not both, so you need to define a union structure to keep both structure types. The program must then use a single general structure called student that contains student’s first-name, last-name, college, grade (which to be calculated later) and the scores.
Finally, the data read from the file should be stored in a linked list of type student.

struct student{
    string first_name;
    string last_name;
    string college;
    char grade ;
    double *scores;
};
struct node1
{
    student data;
    node1 *next;
};

i do not know if its ok or not

can any one help me please ???

i cant start my code without this structur

change your scores from a double to a struct. You need two types, one for quizzes and one for exams.

Comments
what about union struct??

The program should use two distinct structure-types to store the students’ scores: the 1st type used for keeping scores of 4 quizzes while the 2nd type is used to keep the scores of 2 exams.

Where are the structures that keep scores? You're missing them, and they're necessary for everything else, so start there.

Comments
struct Science { double exam[size]; }; struct Engineering { double quizzes[size]; }; union S_Eng_sci { Science S_exam; Engineering S_quizzes; }
struct Science 
{
    double exam[size];
};
struct Engineering  
{
    double quizzes[size];
};
union S_Eng_sci
{
    Science S_exam;
    Engineering S_quizzes;
};
struct student{
    string first_name;
    string last_name;
    string college;
    char grade ;
    S_Eng_sci scores;
    student *next;
};
Comments
Please do not be rude to others who answered. Also, what is the naming convension for variable names? And array variable inside struct can be dynamic?

We're trying to help without doing the work for you. Those structs weren't in your original post; how am I supposed to know what you've done?

On to the code...

double exam[size];
double quizzes[size];

Assuming you're getting size from somewhere, should those really be the same? Forget arrays for a moment; you already know exactly how many scores each structure should have.

union S_Eng_sci
struct student

Sure, those work. Now, given student s, you can get "science" scores from s.scores.S_exam and "engineering" score from s.scores.S_quizzes.

All of the basic parts seem to be there; try putting them together in a simple program that just creates a few students and scores. See if you can get the data back out of your structures.

If that works, then...

struct node1

You can use that to construct a singly-linked list, but you'll still need to write code to manage the list.

This article has been dead for over six months. Start a new discussion instead.