Jump to content

otai_g

Members
  • Content Count

    239
  • Joined

  • Last visited

Posts posted by otai_g


  1. apa itu programming paradigm?

    style atau cara seseorang programmer membuat program.

    For example, the "[url="http://en.wikipedia.org/wiki/Von_Neumann_model"]von Neumann model[/url]" is a model used in traditional sequential computers. For [url="http://en.wikipedia.org/wiki/Parallel_computing"]parallel computing[/url], there are many possible models typically reflecting different ways processors can be interconnected. The most common are based on shared memory, distributed memory with message passing, or a hybrid of the two.

    copy paste dr wikipedia.

  2. kalo baca btl2 soalan x perlu pki if else pun.just pakai cout sajork.

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

    void dspl() {
    cout<<"| 1. Price of ticket |"<<endl;
    cout<<"| 2. Buy a ticket |"<<endl;
    cout<<"| 3. Ticket discount |"<<endl;
    }

    void conformation() { cout<<"\nPress Y to enter\nPress N to cancel"<<endl; }

    void main () {

    char press;

    dspl();
    cout<<"\nPress number 1 to 3 : ";
    cin>>press;
    conformation();

    }[/CODE]

  3. coding ko awal2 dah salah sbb dah setkan item kpd 5.kalo item ada ada lebih atau kurang dr 10 program akan error.kalo nak guna for bnyk kena renovate blk coding tu.alang2 aku wat baru jerk la.yg ni coding bantai semua guna global variable sbb mls nak pk pnjng ;)

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

    int index;
    double tot=0;
    double* t;

    void inputPrice() {

    cout<<"\nENTER THE NUMBER OF ITEM : ";
    cin>>index;

    t = new double[index];

    for (int a=0; a<index; a++) {
    cout<<"\nPRICE FOR ITEM "<<a+1<<" : RM ";
    cin>>t[a];
    }
    }

    void countPrice() {

    for (int b=0; b<index; b++) { tot = tot + t[b]; }
    cout<<"\nTHE TOTAL PRICE : RM "<<tot<<endl;
    }

    void countDiscount() {

    cout<<"\n20% DISCOUNT : RM "<<(0.2*tot)<<endl;
    cout<<"\nTHE TOTAL PRICE AFTER DISCOUNT : RM "<<tot - (0.2*tot)<<endl;
    }

    void main () {

    inputPrice();
    countPrice();

    if (tot>150) { countDiscount(); }
    else {
    cout<<"\nNO DISCOUNT!"<<endl;
    cout<<"\nTHE TOTAL PRICE THAT HAVE TO PAY : RM "<<tot<<endl;
    }
    }[/CODE]

  4. soalan ko ni x jelas.markah fail brp?aku malas btl kalo buat keje soalan yg x jelas.coding ni aku assume markah fail bawah dr average.

    [CODE]#include <iostream>

    using namespace std;

    void main () {

    int index, sFail=0;
    double tot=0, avg=0;
    double* t;

    cout<<"How many grades will you be entering? ";
    cin>>index;

    t = new double[index];

    for (int a=0; a<index; a++) {
    cout<<"Enter grade #"<<a+1<<" : ";
    cin>>t[a];

    tot = tot + t[a];
    }

    avg = tot / index;

    for (int b=0; b<index; b++) {
    if ( t[b] < avg )
    sFail = sFail+1;
    }

    cout<<"Grade average = "<<avg<<endl;
    cout<<"Number of failures = "<<sFail<<endl;
    }[/CODE]

  5. nah.
    dah boring dah wat assignment2 mcm ni.

    [CODE]#include <iostream>

    using namespace std;

    void calc( double a, double b, char x ) {

    double T;

    switch (x) {
    case '+':
    T = a + b;
    break;
    case '-':
    T = a - b;
    break;
    case '*':
    T = a * b;
    break;
    case '/':
    T = a / b;
    break;
    }

    cout<<"Result of "<<a<<" "<<x<<" "<<b<<" = "<<T<<endl;
    }

    void main () {

    double fNum,sNum;
    char op;

    cout<<"Please enter FIRST number: ";
    cin>>fNum;

    cout<<"Please enter SECOND number: ";
    cin>>sNum;

    cout<<"Please enter OPERATOR [+, -, *, /] : ";
    cin>>op;

    calc( fNum, sNum, op );
    }[/CODE]

  6. asal aku nya output x kuar mcm ko nyer output?

    [url="http://imageshack.us/photo/my-images/842/unledjnj.jpg/"][img]http://img842.imageshack.us/img842/8264/unledjnj.jpg[/img][/url]

  7. pd aku gps kat c5 agak faster.
    kalo on kat rumah pki gps standalone pun still x dpt capture signal.
    aku instal ovimaps 3.04 and garmin 5.00.60 kat c5.
    mmg superb.
    kalo pki original gps software kat c5 ni mmg mcm hampeh.
×
×
  • Create New...