Jump to content

otai_g

Members
  • Content Count

    239
  • Joined

  • Last visited

Posts posted by otai_g


  1. [quote name='masokis' date='16 October 2010 - 02:47 AM' timestamp='1287168447' post='1050401']
    alahai.. otai_g, patut bagi hint dulu.. minta tuan thread ni mencari sendiri. kita kat sini, bagi hint.
    supaya lain kali, dia faham dan boleh buat semula.... supaya tak jadi mcm ApoNie cakapkan ( http://my0d.my/forum/thread-367-page-1.html ).
    [/quote]

    ala bro, tt ni post dah 2 tahun berlalu.
    agak2nya bdk ni dah abis study dah pun :blush:

  2. soalan 1.

    [code]
    #include <iostream>
    using namespace std;

    class pelajar {
    private:
    double markah[10];
    double purata;
    public:
    int input();
    void output();
    };

    void main()
    {
    pelajar ahmad;
    ahmad.output();
    }

    int pelajar::input()
    {
    double jmarkah=0;

    for (int a=0;a<10;a++)
    {
    cout<<"Markah pelajar "<<a+1<<" : ";
    cin>>markah[a];
    jmarkah=jmarkah+markah[a];
    }
    purata=jmarkah/10;
    return jmarkah;
    }

    void pelajar::output()
    {
    cout<<"\nJumlah markah : "<<pelajar::input()<<endl;
    cout<<"Purata : "<<purata<<endl;
    }
    [/code]

    soalan 2

    [code]
    #include <iostream>
    using namespace std;


    void bulan(int samdol)
    {
    if (samdol == 1) cout<<"\nBulan Januari"<<endl;
    else if (samdol == 2) cout<<"\nBulan Februari"<<endl;
    else if (samdol == 3) cout<<"\nBulan Mac"<<endl;
    else if (samdol == 4) cout<<"\nBulan April"<<endl;
    else if (samdol == 5) cout<<"\nBulan Mei"<<endl;
    else cout<<"\nTiada dalam database"<<endl;
    }

    void main()
    {
    int nbulan;

    cout<<"Masuk no 1-5 : ";
    cin>>nbulan;

    bulan(nbulan);
    }

    [/code]

  3. this answer 4 another questions.
    but have some main tipu sikit.
    try find by urself ;)

    [code]
    #include <iostream>
    #include <string>
    using namespace std;

    double sumItemPrice(double p, int q) { return (p*q); }
    float aveStationaryPrice(double a, int B) { return (a/B); }
    float highestMagazinePrice(double z, int Zz);

    void main()
    {
    int num_item, squantity=0, kambenk;
    double* price;
    double* quantity;
    double* tprice;
    char category;
    //char* name[128];
    double tsprice=0, sprice=0, mprice=0;
    string* name;

    cout<<"The Bijak Bistari Shop"<<endl;
    cout<<"Number of item : ";
    cin>>num_item;

    price= new double[num_item];
    quantity= new double[num_item];
    tprice= new double[num_item];
    name= new string[num_item];

    for(int i=0; i<num_item; i++)
    {
    cout<<"\nItem: ";
    cin>>name[i];
    cin.ignore(128,'\n');

    cout<<"Category: ";
    cin>>category;

    cout<<"Price (RM): ";
    cin>>price[i];

    cout<<"Quantity: ";
    cin>>quantity[i];

    cout<<"Total Price (RM): "<<sumItemPrice(price[i], quantity[i]);
    cout<<endl;

    if (category=='S' || category=='s')
    {
    sprice = sprice+sumItemPrice(price[i], quantity[i]);
    tsprice = tsprice + price[i];
    squantity++;
    }

    else if (category=='M' || category=='m')
    {
    kambenk = highestMagazinePrice(price[i], i);
    mprice = mprice+sumItemPrice(price[i], quantity[i]);
    }
    }

    cout<<"\nThe total number of stationary : "<<squantity<<endl;
    cout<<"The total number of magazine : "<<(num_item-squantity)<<endl;
    cout<<"\nThe average price of stationary : RM "<<aveStationaryPrice(tsprice, squantity)<<endl;
    cout<<"\nThe highest price for magazine:"<<endl;
    cout<<"Item : "<<name[kambenk]<<endl;
    cout<<"Category : M"<<endl;
    cout<<"Price : "<<price[kambenk]<<endl;

    cout<<"\nThe total price of stationary : RM "<<sprice<<endl;
    cout<<"The total price of magazine : RM "<<mprice<<endl;
    cout<<"The total price of all item : RM "<<(sprice+mprice)<<endl;

    }


    float highestMagazinePrice (double z, int zZ)
    {
    double hprice=0;
    int index;

    if (z > hprice)
    {
    hprice = z;
    index = zZ;
    }

    return index;
    }
    [/code]

  4. er tt x de apa2 error pun kad program ko.
    ni aku ada auta sikit part yg bawah tu.
    100% working.

    [code]
    #include<iostream.h>

    int nKod;
    int nKuantiti;
    float fJumlah;
    float fDiskaun;

    void main()
    {
    cout<<"Masukkan kod minuman:";
    cin>>nKod;
    cout<<"Masukkan kuantiti:";
    cin>>nKuantiti;

    if(nKod == 1)
    {
    cout<<"Jenis minuman: Milo Harga: RM 1.50"<<endl;
    fJumlah = 1.5 * nKuantiti;
    }

    else if(nKod == 2)
    {
    cout<<"Jenis minuman: Kopi Harga: RM 1.00"<<endl;
    fJumlah = 1.00 * nKuantiti;
    }

    else if(nKod == 3)
    {
    cout<<"Jenis minuman: Coca-Cola Harga: RM 1.20"<<endl;
    fJumlah = 1.2 * nKuantiti;
    }

    else if(nKod == 4)
    {
    cout<<"Jenis minuman: Jus Oren Harga: RM 1.80"<<endl;
    fJumlah = 1.8*nKuantiti;
    }

    else

    cout<<"----Out of range----";


    if(fJumlah > 100)
    {
    fDiskaun = fJumlah * 0.15;
    fJumlah = fJumlah - fDiskaun;
    cout<<"Harganya bagi kuantiti sebanyak "<<nKuantiti<<" ialah RM "<<fJumlah<<endl;
    }

    else
    cout<<"Harganya bagi kuantiti sebanyak "<<nKuantiti<<" ialah RM "<<fJumlah<<endl;
    }
    [/code]

  5. amboi sesedap mak yeh je mamat ni srh org siapkan assignment dia sblm ptg ni.
    nak cepat boleh tp biasa la mesti ada pengerasnya.
    nah amik jawapan soalan no 2 ni dulu.
    rajin2 aku wat yg no 1 nya laks.

    [code]
    #include<iostream>
    using namespace std;

    int outPatientCharge(char x);
    int wardedPatientCharge(char y, int z);

    void main()
    {
    char patient, code0, code1[4];
    int days;

    cout<<"Type of patients :"<<endl;
    cout<<"OutPatient (O)"<<endl;
    cout<<"WardedPatient (W)"<< endl;
    cout<<"Enter type of patient : ";
    cin>>patient;

    if (patient == 'O' || patient == 'o')
    {
    cout<<"\nOutPatient types :"<<endl;
    cout<<"Serious (S)"<<endl;
    cout<<"Mild (M)"<<endl;
    cout<<"Normal (N)"<<endl;
    cout<<"Enter OutPatient type code : ";
    cin>>code0;
    cout<<"\nCharges : RM "<<outPatientCharge(code0)<<endl;
    }

    else if (patient == 'W' || patient == 'w')
    {
    cout<<"\nWardedPatient types :"<< endl;
    cout<<"Surgery (W001)"<<endl;
    cout<<"Orthopedic (W002)"<<endl;
    cout<<"Medical (W003)"<<endl;
    cout<<"Enter OutPatient type code : ";
    cin>>code1;
    cout<<"Number of days : ";
    cin>> days;
    cout<<"\nCharges : RM "<<wardedPatientCharge(code1[3], days)<<endl;
    }

    else cout<<"\nInvalid type of patient"<<endl;
    }

    int outPatientCharge(char x)
    {
    int charge;
    if (x == 'S' || x == 's') charge = 200;
    else if (x == 'M' || x == 'm') charge = 100;
    else if (x == 'N' || x == 'n') charge = 30;
    return charge;
    }

    int wardedPatientCharge(char y, int z)
    {
    int charge;

    /*cout<<"Jumlah hari ialah "<<z<<endl;
    cout<<"data y ialah "<<y;*/

    if (y == '1') charge = 300*z;
    else if (y == '2') charge = 250*z;
    else if (y == '3') charge = 200*z;
    return charge;
    }
    [/code]

  6. [quote name='PeeNutt' date='27 September 2010 - 10:54 PM' timestamp='1285599260' post='1048838']
    aku kerja as 3D Artist..

    [/quote]

    betul jgk.
    actually mmg susah nak cr org yg btl2 leh buat programming c++.
    setakat buat program bodo2 mcm aku penah buat boleh la.

  7. PeeNutt ko keje apa kat codemaster?

    aku minat dgn keje c++ programmer tu.
    tp probnya pengalaman keje aku skang n b4 langsung x de kaitan dgn keje yg aku minat tu.
    2nd aku x minat main game dgn 3d.
    apa yg aku minat just coding jerk.
    coding c++ aku plk x de la pro sgt.
    aku x tau pun apa bnd WiiWare, xboxlive arcade tu semua.
    agak2 ada harapan ke kalo aku apply?

    bila closing date nih?

  8. [code]
    #include <iostream>
    using namespace std;

    void main()
    {
    int num;

    for (;;) {
    cout<<"input integer : ";
    cin>>num;

    if (num==-1)
    break;
    else if (num==7||num==63)
    continue;
    else
    cout<<"Your integer is "<<num<<endl;
    }
    }
    [/code]

  9. [quote name='hotfloppy' date='23 July 2010 - 04:20 PM' timestamp='1279873257' post='1042878']
    utk bukak link2 kat atas tu, just tukar [b]www[/b] kepada [b]forum[/b]..
    same gak ngan mana2 link dari post yg lama2..
    asalkan dia [b]forum.putera.com/tanya[/b], bleh guna cara ni..
    ;)
    [/quote]

    dah tukar dah www kpd forum.
    tp stay x jalan gak.
    agaknya database forum lama dah di delete?

  10. [quote name='lipasking' date='13 September 2010 - 10:33 PM' timestamp='1284388386' post='1047736']
    salam
    job ini terbuka kepada sesiapa yang nak cari duit lebih.
    masa bekerja boleh dirunding as long task complete.
    bahasa pengaturcaraan bergantung kepada kepakaran masing2
    tapi saya lebih sukakan bahasa vb,c# dan sql. java pun ok
    iklan? tak pernah.

    jika saudara berminat dialu-alukan,
    [/quote]

    bukan apa saudara sy pernah terbaca dlm paper iklan keje kosong part time programmer.
    bila sy kontek no tu org yg angkat tu kata tgh meeting dan srh call ptg.
    bila call ptg hs x diangkat.
    hntr sms pun x de reply.
    call hari2 yg lain pun sama x de org angkat.
    so sy was2 dgn iklan2 sbg programmer part time ni.
    most majikan just menangguk di air keroh jerk.
    jenis buat untung atas angin.
    pekerja dicari tp job x de.
    yg sedihnya kebanyakan yg terlibat org kita jerk.

  11. another one tamil naidu punya coding :blush:

    [code]
    #include <iostream>
    using namespace std;

    class kereta {
    private:
    char type, package;;
    int tcarc, tcars;
    double tsalec, tsales;
    public:
    void input();
    void output();
    };

    void kereta::input()
    {
    char loop;
    double nprice;

    tcarc=0;
    tcars=0;
    tsalec=0;
    tsales=0;

    for (;;) {

    cout<<"Choose type (c) COMPACT or (s) SEDAN : ";
    cin>>type;

    if (type == 'c')
    {
    tcarc = tcarc++;
    cout<<"Choose package (a) Standard, (B) Limited edition : ";
    cin>>package;

    if (package == 'a') {
    nprice = 24000 + (24000*1.5);
    tsalec = tsalec + nprice;
    cout<<"Type : compact Package : Standard Price : "<<nprice<<endl; }

    else if (package == 'b') {
    nprice = 28000 + (28000*1.5);
    tsalec = tsalec + nprice;
    cout<<"Type : compact Package : Limited Price : "<<nprice<<endl; }

    else {
    cout<<"Error input!";
    tcarc = tcarc--; }

    }

    else if (type == 's')
    {
    tcars = tcars++;
    cout<<"Choose package (a) Standard, (B) Sporty, (c) Limited edition : ";
    cin>>package;

    if (package == 'a') {
    nprice = 35000 + (35000*2);
    tsales = tsales + nprice;
    cout<<"Type : sedan Package : Standard Price : "<<nprice<<endl; }

    else if (package == 'b') {
    nprice = 37000 + (37000*2);
    tsales = tsales + nprice;
    cout<<"Type : sedan Package : Sporty Price : "<<nprice<<endl; }

    else if (package == 'c') {
    nprice = 41000 + (41000*2);
    tsales = tsales + nprice;
    cout<<"Type : sedan Package : Limited Price : "<<nprice<<endl; }

    else {
    cout<<"Error input!";
    tcars = tcars--; }
    }

    cout<<endl<<"Do you want to stop? (y/n) : ";
    cin>>loop;

    if (loop == 'y')
    break;
    } //tutup for
    }

    void kereta::output() {

    cout<<endl<<"Jumlah pembeli kereta compact : "<<tcarc<<endl;
    cout<<"Jumlah jualan kereta compact : RM "<<tsalec<<endl;
    cout<<"Jumlah pembeli kereta sedan : "<<tcars<<endl;
    cout<<"Jumlah jualan kereta sedan : RM "<<tsales<<endl;
    cout<<"Jumlah jualan semua kereta : RM "<<tsalec + tsales<<endl;
    }

    void main()
    {
    kereta samdol;
    samdol.input();
    samdol.output();
    }

    [/code]

  12. [quote name='lipasking' date='13 September 2010 - 06:03 PM' timestamp='1284372212' post='1047719']
    office program , webportal dan database program.
    saya perlukan sessi temubual secara FTF supaya dapat menerangkan secara lebih terperinci kehendak sistem yg hendak dibangunkan samada secara individu atau by group.setiap programmer yg berminat akan mendapat insentif dan layak utk menjadi rakan kongsi program.
    [/quote]

    saudara ni job utk full time atau part time?
    pernah iklankan job ni dlm paper x?
    apa lanuage yg diperlukan? java,vb or etc?

    sy berminat nak join.

  13. ni mn satu coding nak discuss nih?
    yg psl tasik kenyir ke atau hotel reservation tu?

    yg coding psl hotel reservation tu mcm x complete jerk.
    aku dah tau sbb apa bila input address line 2 dia berulang.
    ms declare tel_no kat class hotel tu x leh jdkan dia sbg int sebaliknya jdkan dia char no_tel[15]

  14. lenkali kalo nak cepat emel kan aku soalannya k.
    100% working.tp mcm paria sikit la codingnya :blush:

    [code]
    #include <iostream>
    using namespace std;

    void main()
    {
    char type, package, loop;
    double nprice, tsalec = 0, tsales = 0;
    int tcarc = 0, tcars = 0;

    do {
    cout<<"Choose type (c) COMPACT or (s) SEDAN : ";
    cin>>type;

    if (type == 'c')
    {
    tcarc = tcarc++;
    cout<<"Choose package (a) Standard, (B) Limited edition : ";
    cin>>package;

    if (package == 'a') {
    nprice = 24000 + (24000*1.5);
    tsalec = tsalec + nprice;
    cout<<"Type : compact Package : Standard Price : "<<nprice<<endl; }

    else if (package == 'b') {
    nprice = 28000 + (28000*1.5);
    tsalec = tsalec + nprice;
    cout<<"Type : compact Package : Limited Price : "<<nprice<<endl; }

    else {
    cout<<"Error input!";
    tcarc = tcarc--; }

    }

    else if (type == 's')
    {
    tcars = tcars++;
    cout<<"Choose package (a) Standard, (B) Sporty, (c) Limited edition : ";
    cin>>package;

    if (package == 'a') {
    nprice = 35000 + (35000*2);
    tsales = tsales + nprice;
    cout<<"Type : sedan Package : Standard Price : "<<nprice<<endl; }

    else if (package == 'b') {
    nprice = 37000 + (37000*2);
    tsales = tsales + nprice;
    cout<<"Type : sedan Package : Sporty Price : "<<nprice<<endl; }

    else if (package == 'c') {
    nprice = 41000 + (41000*2);
    tsales = tsales + nprice;
    cout<<"Type : sedan Package : Limited Price : "<<nprice<<endl; }

    else {
    cout<<"Error input!";
    tcars = tcars--; }
    }

    cout<<endl<<"Do you want to stop? (y/n) : ";
    cin>>loop;
    } //tutup do

    while (loop == 'n');

    cout<<endl<<"Jumlah pembeli kereta compact : "<<tcarc<<endl;
    cout<<"Jumlah jualan kereta compact : RM "<<tsalec<<endl;
    cout<<"Jumlah pembeli kereta sedan : "<<tcars<<endl;
    cout<<"Jumlah jualan kereta sedan : RM "<<tsales<<endl;
    cout<<"Jumlah jualan semua kereta : RM "<<tsalec + tsales<<endl;

    } //close main
    [/code]

  15. [quote name='felixthecat' date='02 September 2010 - 09:52 AM' timestamp='1283392358' post='1046870']
    yup.dalam kotak complete.

    mounting(suction cup,holder),usb chargaer,car charger,manual,gps unit,kotak dan tak lupa juga,,...waranty card.



    sedikit info utk user:
    kat pasaran sekarang ni ada lambakan gps yang mendakwa menggunakan satellite receiver SiRF Atlas V.
    Untuk makluman, satellite receiver terbaru adalah SiRF Atlas IV. Kalau penjual mendakwa gps tu dilengkapi dengan SiRF Atlas V, saya berani kata ianya palsu. Kalau dia tunjuk screenshot sekalipun, semua tu boleh dibuat. China mmg kreatif.

    terima kasih
    [/quote]

    papago ni pun made in china jgk kan?
    even garmin pun dibuat kat china jgk.


    sy tercari2 gps yg made in usa atau japan.
    tp mmg x penah jumpa kat pasaran msia.

  16. aku x brp paham apa yg ko nak sbnrnya.

    yg aku paham ada satu fail input.txt yg contain dlm fail tu ialah "26/01/10 09:20:20 MAL BIN BIN275 TSTCB U8L5 O/CR ..N UCOS Operated".

    pastu berdasarkan kod yg latest ko post tu fail output.txt yg keluar ialah "BIN275 TSTCB U8L5 O/CR".

    tp bila aku compile yg keluar hanya "CB U8L5 O/CR ..N UCOS Op".

    kat sini aku dah start pening.mn satu yg betul sbnrnya.

    yg sbnrya ko nak keluarkan "O/CR" sahaja atau "BIN275 TSTCB U8L5 O/CR".

    tlng jelaskan aku yerk...
×
×
  • Create New...