Results 1 to 6 of 6
  1. #1

    Default need help mga guros...


    mga bro and guros apil napud sis basta maayo.. patabang unta ko ninyo naa mi project sa skol then lisod kaayo naa nako nabuhat gamay unya ang uban kay dli gyud kaya. patabang unta ko gamay para matiwas nako ug himo. kinahanglan gyud kaayo namo..

    mao ni ay.. mag buhat kuno mi ug program na mo read ug input sa user nga polynomial. then ang amo buhaton is kinahanlan nga pwede makapili ang user kon gusto ba niya i add or i subtract. mao rana pero lisod man i implement. mao ni ang link sa ako gi buhat na codes palihog ko tabang ninyo.. pang finals nani namo.. by the way ang gamiton kay C diay nga program pwede rasad C++


    tan-awa nlang ni ang codes kay dli ko kabalo asa i share:
    naay mga functions diha nga wla ma tiwas mao na ako ki lisdan.. tabang mga bro

    #include "Polynomial.h"
    #include <stdlib.h>



    /*----------------------------------------------*/
    /* Sets all coefficients to 0 */
    /*--------------------------------------------- */
    void initialize(Polynomial p)
    { int i;

    for(i=0; i<MaxDegree; i++)
    p[i] = 0;
    }

    /*----------------------------------------------*/
    /* Builds a polynomial by randomly generating */
    /* exponents and coefficients. */
    /*--------------------------------------------- */
    void build(Polynomial p)
    {
    int i,n,coef,exp;

    initialize(p);
    n = random(10);
    for (i=0; i < n; i++)
    {
    exp = random(10);
    coef = random(10);
    if (coef % 2 == 0)
    coef = -coef;
    addTerm(coef,exp,p);
    }
    }

    /*----------------------------------------------*/
    /* Adds a term by setting the coefficient */
    /* and the exponent */
    /*--------------------------------------------- */
    void addTerm(int coef,int exp,Polynomial p)
    {
    p[exp] = coef;
    }

    /*----------------------------------------------*/
    /* Displays the polynomial on the screen */
    /*--------------------------------------------- */
    void display(char *name,Polynomial p)
    { int i;

    printf("%s = ",name);
    for (i=MaxDegree-1; i>=0;i--)
    { if (p[i] != 0)
    {
    printf((p[i]>0)?" +":" ");
    printf(((p[i] != 1)?"%d":""),p[i]);
    printf((i!=0)?"X%d":"",i);
    }
    }
    }


    /*---------------------------------------------- */
    /* Adds the two polynomials p1 and p2 and */
    /* stores the resulting polynomial in result. */
    /* This can be done by adding the coefficients */
    /* of the two polynomials. */
    /*---------------------------------------------- */
    void add(Polynomial p1,Polynomial p2,Polynomial result)
    {

    }


    /*------------------------------------------------------ */
    /* Substracts polynomial p2 from p1 and */
    /* stores the resulting polynomial in result. */
    /* This can be done by subtracting the coefficients */
    /* of the second from the first polynomial. */
    /*------------------------------------------------------ */
    void subtract(Polynomial p1,Polynomial p2,Polynomial result)
    {

    }

    /*------------------------------------------------------ */
    /* Gets the derivative of p and stores it in result. */
    /*------------------------------------------------------ */
    void derivative(Polynomial p,Polynomial result)
    {

    }

    /*------------------------------------------------------ */
    /* Evaluates the polynomial at point/value x. */
    /* This means substituting x in the polynomial and */
    /* computing for the value of the whole expression. */
    /*------------------------------------------------------ */
    int evaluate(int x,Polynomial p)
    {


    }

    

  2. #2

    Default Re: need help mga guros...

    lisora ani bai oi!! kinahanglang manig extra effort nga ma solve ni bai!!! hehehehehe

  3. #3

    Default Re: need help mga guros...

    shift nalang nursing
    Are trying to be funny mister?

  4. #4

    Default Re: need help mga guros...

    hehe pwede plang ay... hehe bitaw thanks anyways nakuha nagyud nako.. whew... kapoy pud lagi kaayo...

  5. #5

    Default Re: need help mga guros...

    hehe pang programmer jud diay.

  6. #6

    Default Re: need help mga guros...

    mao gyud hehe. wla nlang ta tulogay ani...

  7.    Advertisement

Similar Threads

 
  1. need help mga guro's
    By jiao47 in forum Computer Hardware
    Replies: 22
    Last Post: 05-17-2008, 02:35 PM
  2. need help mga bro and sis
    By spade in forum Computer Hardware
    Replies: 5
    Last Post: 11-20-2007, 05:36 PM
  3. Need help mga bro how to block "KPROXY.COM"
    By rcm0722 in forum Networking & Internet
    Replies: 4
    Last Post: 08-04-2007, 11:53 AM
  4. Need Help mga bro,..(installing OS problem)
    By bonsui in forum Computer Hardware
    Replies: 16
    Last Post: 05-04-2007, 06:02 PM
  5. need help mga bro...
    By zyrex dale in forum Computer Hardware
    Replies: 5
    Last Post: 11-19-2006, 10:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top