help

jomo's Avatar, Join Date: Jun 2007
Newbie Member
I have start learning c++ and face with this problem.
My problem is a minimization problem. Students are to be matched to University at a
minimised cost.
so i started by constrcting a struct. Please i will like to know if i am on the right path.
Here is my code
Code:
 
 struct universities   
  {
	  string name;
	  int places_left;
	  double average_grade;
	  }
university<universities>university_list;
	  
       

struct students
      {
      int id;
	  double my_average_grade;
      universities choice[6];
      universities average_grade;
      }
student<students>student_list;
      
      


struct matching_student{
	   universities match;
	   students matchd;
       }matching; 

Thanks a lot in advance
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
You don't say what you want to know. Also, in future, please use a descriptive, searchable subject line. I would suggest that you read the "Before you make a query" thread, then formulate a specific question or questions.
0
shabbir's Avatar, Join Date: Jul 2004
Go4Expert Founder
just constructing the struct does not mean you are on the right path or not but I don't understand what is the use of the matching struct.
0
jomo's Avatar, Join Date: Jun 2007
Newbie Member
The Problem is a miminimisation problem. Students ofa university have six choices to select their prefered universities.
The universities have limited places and select students according to their grades. The problem is to match as many student as possible at a miminimum cost.
So i started by constructing a struct.

Thanks
0
jomo's Avatar, Join Date: Jun 2007
Newbie Member
please is my construction okay?

Thanks
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
Construction of what? Your compiler will tell you if you have made syntactical errors, providing that you have enabled all errors and warnings (which you should do). No compiler can tell you if your approach is optimal, or even good. Neither can we, because we can't read your mind. Please think about these things in a rational manner, or hire us to come to your house, sit in your chair, and listen to your lectures. We can probably do faily well, given scanty information, but we have been given none.
0
jomo's Avatar, Join Date: Jun 2007
Newbie Member
The issue in question is out of about 300 students and 50 universities, one should match as many students as possible subject to the constraint of the university.
please i want to create an array of universities , but i am not sure wheather my code is correct.

university <universities> university_list;
0
DaWei's Avatar, Join Date: Dec 2006
Team Leader
Have you tried your code? Why do you think it is either correct or incorrect? Is your compiler bitching with error messages? Do you think your approach is bad? Do you know what you want, and have attempted to achieve that? If so, how has your approach failed you?

Are you picking up on, at all, what I'm getting at here? If not, you need to go sit behind the barn and watch the cotton grow, while you think. This is a programming forum. We try to answer real questions. There is little chance that we can read your mind or deal with your personal uncertainties.