Polynomial Class

This is a discussion on Polynomial Class within the C++ Programming forums, part of the General Programming Boards category; I am doing my another computer project..... have a problem.......:'( It's about making a class "Polynomial" Follwing: -Create a class ...

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    2

    Cool Polynomial Class

    I am doing my another computer project.....
    have a problem.......:'(
    It's about making a class "Polynomial"

    Follwing:
    -Create a class Poly to represent POLYNOMIALS of x
    (for example x^3+3x^2+2)

    -Overload operators +,-,*

    -You must not use any cin or cout.......


    Please help me.......:'(

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    You can start by doing a search of the board. To do that click on the little blue button in the upper right hand of the client area of this programs window. Then enter the word polynomial in the search edit box and click go. Set back and be amazed at the results a few seconds before clicking on any of the proffered listings.

    As startes I suggest you consider developing several classes, including a term class and a polynomial class. The term class would hold a coefficient, a base, a power, and (maybe, depending how you design polynomial class) a pointer to class (so you can use the term class as a node in a list if you wish). The polynomialclass would contain a container of terms (here you could use an array, or list, or vector, or stack or whatever), and a series of methods to group like terms, do multiplication of two polynomials, or display a polynomial, etc.

    Now after reading several of the posts found in your search, and my brief sketch, sit down with a pencil and paper, write out your program in English (or whatever your native language is), and then, and only then think about writing out the code.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. class composition constructor question...
    By andrea72 in forum C++ Programming
    Replies: 3
    Last Post: 04-03-2008, 06:11 PM
  2. Creating a database
    By Shamino in forum Game Programming
    Replies: 19
    Last Post: 06-10-2007, 02:09 PM
  3. deriving classes
    By l2u in forum C++ Programming
    Replies: 12
    Last Post: 01-15-2007, 05:01 PM
  4. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM
  5. Abstract class problem
    By VanJay011379 in forum C++ Programming
    Replies: 9
    Last Post: 07-31-2002, 02:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21