Please help in c++ I have this code with some mistakes help i don't have time!!!?

Discussion in 'Programming' started by SAKAVAN, Jul 18, 2007.

  1. #1
    # include < iostream>
    using namespace std ;
    using std :: cout;
    using std :: cin;
    using std :: endl;

    class student{
    public:
    bool ok;
    bool woman;
    bool instudy;
    int finalchoice ;
    int a;
    bool success;
    string name ;
    int grade ;
    int choice[9] ;

    student(){
    instudy=false;
    ok= false ;
    success = true ;
    woman = true ;
    finalchoice = 0;
    a=1;
    }

    }

    int calcu(int ,int ,bool ,int , student [] );



    void main (){
    student students[800];
    int s[]={60,80,40,40,40,60,50,80,5...
    int xx[9];
    int yy[9];
    for(int i=0; i<800; i++){

    cout<<"enter student name ";


    cout<<" enter the student grade ";
    cin>> students.grade;
    cout<<" put the choices (1.......9)";
    for(int j=0;j=9;j++){
    cin>>students.choice[j];
    }
    }
    int x=240,y=240;
    for(int k=1;k<=9;k++){
    int fcounter = 0; int mcounter=0;
    for( int i=0;i<800; i++)
    if(students.choice-1==k)

    if(students.woman == true ){

    Additional Details

    47 minutes ago
    fcounter++;
    students.instudy=true;}
    else{ mcounter++;
    students.instudy=true;}
    int size=s[k-1]/2;
    x=calcu(fcounter,x,true,size,s...
    xx[k-1]=x;
    for (i=0; i<800;i++)
    {
    if (students.instudy==true)
    if(students.grade>=x)
    {students.ok=true;
    students.finalchoice=k;
    students.instudy=false;}
    else{students.a=students... + 1;
    }
    }
    y=calcu(mcounter,y,true,size,s...
    yy[k-1]=y;
    for (i=0; i<800;i++)
    {
    if (students.instudy==true)
    {if(students.grade>=y)
    {students.ok=true;
    students.finalchoice=k;
    students.instudy=false;}
    else{students.a=students[i]... + 1;
    }
    }
    }
    }
    }
    int calcu(int fmale,int x,bool gender,int size,student students[])//fmale=fcounter or mcounter
    {
    int fnumber=fmale;
    while (fnumber>size)
    {
    fnumber=0;
    for (int i=0;i<800;i++)
    {if (students[i].instudy==true)
    if(students[i].grade==x)
    fnumber++;}
    x--;

    }

    return x++;
    }
    :([/i][/i][/i]
     
    SAKAVAN, Jul 18, 2007 IP
  2. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #2
    What are the mistakes? what is this code supposed to do?
     
    it career, Jul 19, 2007 IP
  3. rosiee007

    rosiee007 Notable Member

    Messages:
    3,352
    Likes Received:
    179
    Best Answers:
    0
    Trophy Points:
    230
    #3


    Why do you have Additional Details and 47 minutes ago there? This seems like the problem to me. If they are remarks, use // with them.
     
    rosiee007, Jul 19, 2007 IP
  4. it career

    it career Notable Member

    Messages:
    3,562
    Likes Received:
    155
    Best Answers:
    0
    Trophy Points:
    270
    #4
    :D Seems like OP posted it in Yahoo answer and no one is doing his homework for free, so he copied and pasted the same project assignment here thinking someone will solve his project assignment :D
     
    it career, Jul 19, 2007 IP
  5. TwistMyArm

    TwistMyArm Peon

    Messages:
    931
    Likes Received:
    44
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Exactly.

    He's even got truncated lines in there... eg:
    x=calcu(fcounter,x,true,size,s...

    I looked over it but generally ignore posts like the above, for two reasons:
    1) I didn't go through university to do someone else's homework; and
    2) if the OP can't even be bothered to post the code within the 'code' tags, why should I be bothered to read it?
     
    TwistMyArm, Jul 19, 2007 IP
  6. SAKAVAN

    SAKAVAN Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank You All
     
    SAKAVAN, Jul 25, 2007 IP