Jump to content

nurul_h5

Members
  • Content Count

    81
  • Joined

  • Last visited

Posts posted by nurul_h5


  1. [quote name='syahmixp' timestamp='1300783519' post='1065416']
    tak boleh, array mesti ada saiz.
    sila tengok malloc, realloc dan free

    [url="http://www.cplusplus.com/reference/clibrary/cstdlib/malloc/"]http://www.cplusplus...cstdlib/malloc/[/url]

    ubah mark_*... menjadi integer pointer
    [code]int* mark_bm1, mark_bm2, mark_math ...[/code]

    sebelum
    [code] for(a=0;a<bil;a++)[/code]
    letak kod ini untuk allocate memory
    [code]mark_bm1 = (int)malloc(sizeof(int)*bil);[/code]
    [/quote]



    ok............dh try tp ade 6 error..........camni ke???????

    #include<iostream>
    #include <string>
    using namespace std;
    using std::string;
    class Teacher
    {
    protected:
    char stafname[25],stafid[10];
    public:
    void accept()
    {
    cout<<"\nEnter your name :"<<endl;
    cin>>stafname;
    cout<<"\nEnter staffid :"<<endl;
    cin>>stafid;
    }
    };
    class Student:public Teacher
    {
    private:
    char Class[3],subject[12],name[25];
    int *mark_bm1[100],*mark_bm2[100],*mark_math[100],*mark_science[100],*mark_bi[100];
    int a,bil, total,*average[100];0
    public:
    void Accept();
    void display();
    };
    void Student::Accept()
    {
    cout<<"****************SELAMAT DATANG KE**************************";
    cout<<"\nSISTEM PENGIRAAN PURATA PERMAKAHAN DAN GRED PELAJAR UPSR";
    cout<<"\n*********************************************************";
    cout<<"\nEnter Class :";
    cin>>Class;
    cout<<"\nEnter number of student :";
    cin>>bil;
    mark_bm1 = (int)malloc(sizeof(int)*bil);
    mark_bm2 = (int)malloc(sizeof(int)*bil);
    mark_math = (int)malloc(sizeof(int)*bil);
    mark_science = (int)malloc(sizeof(int)*bil);
    mark_bi = (int)malloc(sizeof(int)*bil);
    for(a=0;a<bil;a++)
    {
    cout<<"\nEnter student name :";
    cin>>name;
    cout<<"\nEnter mark for Bahasa Melayu 1 :";
    cin>>*mark_bm1[a];
    cout<<"\nEnter mark for Bahasa Melayu 2 :";
    cin>>*mark_bm2[a];
    cout<<"\nEnter mark for Mathematics :";
    cin>>*mark_math[a];
    cout<<"\nEnter mark for Science:";
    cin>>*mark_science[a];
    cout<<"\nEnter mark for English:";
    cin>>*mark_bi[a];
    total=*mark_bm1[a]+*mark_bm2[a]+*mark_math[a]+*mark_science[a]+*mark_bi[a];
    *average[a]=total/5;

    }
    }
    void Student::display()
    {
    cout<<"\n==========================================";
    cout<<"\nClass :"<<Class;
    cout<<"\t\tBil. Student :"<<bil;
    for(a=0;a<bil;a++)
    {
    if(*mark_bm1[a]>=80)
    {
    cout<<"\nName :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<*mark_bm1[a];
    cout<<"\tGred A";
    }
    else if(*mark_bm1[a]>59&&*mark_bm1[a]<80)
    {
    cout<<"\nName :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<*mark_bm1[a];
    cout<<"\tGred B";
    }
    else if(*mark_bm1[a]>39&&*mark_bm1[a]<60)
    {
    cout<<"\nName :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<*mark_bm1[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\nName :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<*mark_bm1[a];
    cout<<"\tGred D";
    }
    if(*mark_bm2[a]>=80)
    {
    cout<<"\n\nBahasa Melayu 2 :"<<*mark_bm2[a];
    cout<<"\tGred A";
    }
    else if(*mark_bm2[a]>59&&*mark_bm2[a]<80)
    {
    cout<<"\n\nBahasa Melayu 2 :"<<*mark_bm2[a];
    cout<<"\tGred B";
    }
    else if(*mark_bm2[a]>39&&*mark_bm2[a]<60)
    {
    cout<<"\n\nBahasa Melayu 2 :"<<*mark_bm2[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\n\nBahasa Melayu 2 :"<<*mark_bm2[a];
    cout<<"\tGred D";
    }
    if(*mark_math[a]>=80)
    {
    cout<<"\n\nMathematics :"<<*mark_math[a];
    cout<<"\t\tGred A";
    }
    else if(*mark_math[a]>59&&*mark_math[a]<80)
    {
    cout<<"\n\nMathematics :"<<*mark_math[a];
    cout<<"\t\tGred B";
    }
    else if(*mark_math[a]>39&&*mark_math[a]<60)
    {
    cout<<"\n\nMathematics :"<<*mark_math[a];
    cout<<"\t\tGred C";
    }
    else
    {
    cout<<"\n\nMathematics :"<<*mark_math[a];
    cout<<"\t\tGred D";
    }
    if(*mark_science[a]>=80)
    {
    cout<<"\n\nScience :"<<*mark_science[a];
    cout<<"\t\tGred A";
    }
    else if(*mark_science[a]>59&&*mark_science[a]<80)
    {
    cout<<"\n\nScience :"<<*mark_science[a];
    cout<<"\t\tGred B";
    }
    else if(*mark_science[a]>39&&*mark_science[a]<60)
    {
    cout<<"\n\nScience :"<<*mark_science[a];
    cout<<"\t\tGred C";
    }
    else
    {
    cout<<"\n\nScience :"<<*mark_science[a];
    cout<<"\t\tGred D";
    }
    if(*mark_bi[a]>79)
    {
    cout<<"\n\nBahasa Inggeris :"<<*mark_bi[a];
    cout<<"\tGred A";
    }
    else if(*mark_bi[a]>59&&*mark_bi[a]<80)
    {
    cout<<"\n\nBahasa Inggeris :"<<*mark_bi[a];
    cout<<"\tGred B";
    }
    else if(*mark_bi[a]>39&&*mark_bi[a]<59)
    {
    cout<<"\n\nBahasa Inggeris :"<<*mark_bi[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\n\nBahasa Inggeris :"<<*mark_bi[a];
    cout<<"\tGred D";
    }
    cout<<"\n\nAverage :"<<*average[a];
    }
    cout<<"\n==========================================";

    }
    void main()
    {
    Student obj1;
    obj1.accept();
    obj1.Accept();
    obj1.display();
    }

  2. [quote name='syahmixp' timestamp='1300778205' post='1065408']
    Rasa musykil bila tengok kod...

    [code] int a,bil,mark_bm1[ ],mark_bm2[ ],mark_math[ ],mark_science[ ],mark_bi[ ],total_bm1,total_bm2,total_math,total_science,total_bi;[/code]
    mungkin sebab array mark_bm1, mark_bm2, dan lain2 diisytihar tanpa saiz.
    [/quote]

    maybe..........tapi aku nk wt array yg infinate...........ade cara ke???????

  3. atucara ni digunakan untuk bagi gred markah n kira purata. ada error dan pada masa yang sama kena masuk polymorphism. camner ek????????aku dh buntu ni.........btw thanks for your help

    #include<iostream>
    using namespace std;
    class Teacher
    {
    protected:
    char stafname[25],stafid[10];
    public:
    void accept()
    {
    cout<<"\nEnter your name :"<<endl;
    cin>>stafname;
    cout<<"\nEnter staffid :"<<endl;
    cin>>stafid;
    }
    };
    class Student:public Teacher
    {
    private:
    char Class[3],subject[12],name[25];
    int a,bil,mark_bm1[ ],mark_bm2[ ],mark_math[ ],mark_science[ ],mark_bi[ ],total_bm1,total_bm2,total_math,total_science,total_bi;
    int average_bm1,average_bm2,average_math,average_science,average_bi;
    public:
    void Accept();
    void display();
    };
    void Student::Accept()
    {
    cout<<"\nEnter Class :";
    cin>>Class;
    cout<<"\nEnter number of student :";
    cin>>bil;
    for(a=0;a<bil;a++)
    {
    cout<<"\nEnter student name :";
    cin>>name;
    cout<<"\nEnter mark for Bahasa Melayu 1 :";
    cin>>mark_bm1[a];
    cout<<"\nEnter mark for Bahasa Melayu 2 :";
    cin>>mark_bm2[a];
    cout<<"\nEnter mark for Mathematics :";
    cin>>mark_math[a];
    cout<<"\nEnter mark for Science:";
    cin>>mark_science[a];
    cout<<"\nEnter mark for English:";
    cin>>mark_bi[a];
    total_bm1=total_bm1+mark_bm1[a];
    total_bm2=total_bm2+mark_bm2[a];
    total_math=total_math+mark_math[a];
    total_science=total_science+mark_science[a];
    total_bi=total_bi+mark_bi[a];
    average_bm1=total_bm1/bil;
    average_bm2=total_bm2/bil;
    average_math=total_math/bil;
    average_science=total_science/bil;
    average_bi=total_bi/bil;
    }
    }
    void Student::display()
    {
    cout<<"\nClass :"<<Class;
    cout<<"\t\tBil. Student :"<<bil;
    for( a=0;a=bil;a++)
    {
    if(mark_bm1[a]>=80)
    {
    cout<<"Name :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<mark_bm1[a];
    cout<<"\tGred A";
    }
    else if(mark_bm1[a]>59||mark_bm1[a]<80)
    {
    cout<<"Name :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<mark_bm1[a];
    cout<<"\tGred B";
    }
    else if(mark_bm1[a]>39||mark_bm1[a]<60)
    {
    cout<<"Name :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<mark_bm1[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"Name :"<<name;
    cout<<"\n\nBahasa Melayu 1 :"<<mark_bm1[a];
    cout<<"\tGred D";
    }
    if(mark_bm2[a]>=80)
    {
    cout<<"\n\nBahasa Melayu 2 :"<<mark_bm2[a];
    cout<<"\tGred A";
    }
    else if(mark_bm2[a]>59||mark_bm2[a]<80)
    {
    cout<<"\n\nBahasa Melayu 2 :"<<mark_bm2[a];
    cout<<"\tGred B";
    }
    else if(mark_bm2[a]>39||mark_bm2[a]<60)
    {
    cout<<"\n\nBahasa Melayu 2 :"<<mark_bm2[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\n\nBahasa Melayu 2 :"<<mark_bm2[a];
    cout<<"\tGred D";
    }
    if(mark_math[a]>=80)
    {
    cout<<"\n\nMathematics :"<<mark_math[a];
    cout<<"\tGred A";
    }
    else if(mark_math[a]>59||mark_math[a]<80)
    {
    cout<<"\n\nMathematics :"<<mark_math[a];
    cout<<"\tGred B";
    }
    else if(mark_math[a]>39||mark_math[a]<60)
    {
    cout<<"\n\nMathematics :"<<mark_math[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\n\nMathematics :"<<mark_math[a];
    cout<<"\tGred D";
    }
    if(mark_science[a]>=80)
    {
    cout<<"\n\nScience :"<<mark_science[a];
    cout<<"\tGred A";
    }
    else if(mark_science[a]>59||mark_science[a]<80)
    {
    cout<<"\n\nScience :"<<mark_science[a];
    cout<<"\tGred B";
    }
    else if(mark_science[a]>39||mark_science[a]<60)
    {
    cout<<"\n\nScience :"<<mark_science[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\n\nScience :"<<mark_science[a];
    cout<<"\tGred D";
    }
    if(mark_bi[a]>=80)
    {
    cout<<"\n\nBahasa Inggeris :"<<mark_bi[a];
    cout<<"\tGred A";
    }
    else if(mark_bi[a]>59||mark_bi[a]<80)
    {
    cout<<"\n\nBahasa Inggeris :"<<mark_bi[a];
    cout<<"\tGred B";
    }
    else if(mark_bi[a]>39||mark_bi[a]<59)
    {
    cout<<"\n\nBahasa Inggeris :"<<mark_bi[a];
    cout<<"\tGred C";
    }
    else
    {
    cout<<"\n\nBahasa Inggeris :"<<mark_bi[a];
    cout<<"\tGred D";
    }
    }
    cout<<"\n Average for Bahasa Melayu 1:"<<average_bm1;
    cout<<"\n Average for Bahasa Melayu 2:"<<average_bm2;
    cout<<"\n Average for Mathematics:"<<average_math;
    cout<<"\n Average for Science:"<<average_science;
    cout<<"\n Average for English is:"<<average_bi;
    }
    void main()
    {
    Student obj1;
    obj1.accept();
    obj1.Accept();
    obj1.display();
    }

  4. lagu happy..........love so sweet by arashi

    Romaji Love So Sweet

    Kagayaita no wa kagami demo taiyou de mo nakute kimi dato kizuita toki kara
    Ano namida gumu kumo no zutto ue ni wa hohoemu tsuki Love story
    mata hitotsu

    Kizutsuita yume wa kinou no kanata e
    Sora ni hibike ai no uta

    Omoide zutto zutto wasurenai sora futari ga hanarete ittemo
    Konna suki na hito ni deau kisetsu nido to nai
    Hikatte motto saikou no Lady Kitto sotto omoi todoku
    Shinjiru koto ga subete Love so sweet

    Soko kara itsumo mieru youni
    Kono te wo sora ni muke hirogaru kimi to no omoide
    Ano kataku na de ijippari na
    boku wo kaeta kimi no te Love story aruki dasu

    Magari kunetteta futatsu no tabiji wa
    Koko de hitotsu niji ni nare

    Omoide zutto zutto oikaketa yume futari ga tooku e ittemo
    Donna tsurai yoru mo kujike souna chikai de mo
    Waratte motto saigo no lady kitto sotto negai todoku
    Akenai yoru wa nai yo Love so sweet

    Tsutae kirenu itoshisa wa
    Hana ni natte machi ni futte
    Doko ni ite mo kimi wo “koko" ni kanjiteru

    Omoide zutto zutto wasurenai sora futari ga hanarete ittemo
    Konna suki na hito ni deau kisetsu nido to nai
    Hikatte motto saikou no lady kitto sotto omoi todoku
    Shinjiru koto ga subete
    Akenai yoru wa nai yo
    Shinjiru koto ga subete Love so sweet

    english

    What shined was neither the mirror nor the sun but you. Since then
    Behind those tearful clouds is always a smiling moon. Another love story

    Take the wounded dreams to yesterday
    The sky will echo with the song of love

    The sky will always, always remember the memories, even if we drift apart
    For the girl I love so much, even if we won’t meet the second time
    Shine more, you’re the best lady. My feelings will definitely, gently reach to you
    Believing is everything. Love so sweet

    So that you’ll always be able to see from there
    I’ll spread my arms towards the sky and memories with you will spread
    Your hands that changed
    My stubborn and arrogant self. Love story will start

    Our two winding paths will
    Will be one rainbow here.

    My dream of always, always chasing after our memories. Even if our distance grows
    No matter how tough the night gets, no matter how hopeless the promise is
    Laugh more, you’re the last lady. My prayers will definitely, gently reach to you
    The sun will always rise. Love so sweet

    The love I couldn’t express completely
    Will turn into flowers and fall on the city
    No matter where you go I’ll always feel your presence “here��?

    The sky will always, always remember the memories, even if we drift apart
    For the girl I love so much, even if we won’t meet the second time
    Shine more, you’re the best lady. My feelings will definitely, gently reach to you
    Believing is everything.
    The sun will always rise.
    Believing is everything. Love so sweet


  5. i'm really not sure............just be yourself..........
    ask them if don't understand something...........
    and try to communicate with all the staff.............
    i was practice this thing when i was having my practical..........


    ----->is it a correct grammar????i'm having a practical..........cause i fell weird.........

  6. QUOTE(fiza_cute @ Dec 11 2008, 09:53 AM) <{POST_SNAPBACK}>
    i'm going to practical in Seremban..SUK..gov company..i'm scared..i'm not good in IT.. huh.gif



    that's ok..........i'm having practical now............my it knowledge not good either.........insyaalllah they will teach you............before i'm having practical i don't even know how to format pc or laptop............now i;m kind of pro.............hehehehe...........i'm going to finished tomorrow..........wish me luck having my last day here.............i hope not gonna cry.............


  7. walaupun aku x paham sgt tp aku dgr............ekonomi dunia mmg dh teruk.........psl saham us jatuh...........byk company nk pecat pekerja...........so dependla..........kalau rasa leh dpt keje baru lg bagus berhenti pun xper.................tp nasihat aku dh dpt keje baru, baru bleh blah............correct me if i'm wrong...............

  8. Lawak budi bahasa


    Seorang gadis cantik menaiki LRT yang sangat penuh sesak. Gadis itu berdiri betul betul didepan seorang pemuda. Seketika kemudian pemuda itu bangun, namun belum sempat pemuda itu
    berkata apa apa, gadis cantik itu menolak pemuda itu dengan lembut ke tempat duduknya sambil berkata, "Terima kasih, saya lebih suka berdiri". Pemuda itu tercengang dengan penuh kehairanan.
    Dia sedikit jengkil kerana ditolak oleh gadis itu walaupun secara lembut. Pemuda itu pun berdiri semula tetapi sekali lagi gadis cantik itu menolaknya duduk semula dan berkata dengan
    sedikit kuat hingga didengari oleh lain lain penumpang, "Tak apa, tak payah susah susah, saya lebih suka berdiri." Tanpa putus asa pemuda itu berdiri lagi untuk kali yang ketiga sambil menjerit,
    "Woii cik kak !! Saya nak turun laaaaa!!! Saya dah terlepas perhentian saya tau !!? Apa punya perasan lah dia ni?!!!"

×
×
  • Create New...