Factoring app

This is a discussion on Factoring app within the C++ Programming forums, part of the General Programming Boards category; I have no code for this, but I've been trying to think about how to start. I tried to do ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    59

    Factoring app

    I have no code for this, but I've been trying to think about how to start. I tried to do some loops, but couldn't grasp the basic task at hand. I'm not asking you to do this for me since I am only doing it for the fun of doing it. I'm just stuck. I don't know how to make "x" a symbol for a variable (in the console input). I only want it to factor REALLY basic things such as x^2-4. I was thinking if I can get the basic principle down, I can add on from there. Back on topic, well I just need to know how to get it started. Is there a header for things like this? Is this a more advanced area (meaning out of my league)? I want to push myself, but don't want to be too overzealous. Well, all help is appreciated.

  2. #2
    Super Moderater.
    Join Date
    Jan 2005
    Posts
    374
    Factoring is obviously plays a big part in the world of mathematics. It's fairly straight forward if you are only considering *easy* problems.

    Code:
    x^2 -4  = (x+2)(x-2)
    It's possible to write a program which mimics the way a human would go about solving this. However, it is quite involved (i.e you have to parse the equation and then perhaps then sort it using a binary tree). Generally, this is regarded this best way to tackle this problem.

    However, if you wish to use iterative methods to solve this take a look at all the root finding algo's, namely, Newton's method, the bisection method yada yada yada....

    Good luck


  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    59
    Thanks for all your help. I'll look into some of those methods. Once again, thanks for your help.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 08:11 AM
  2. best program to start
    By gooddevil in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-28-2004, 06:56 PM
  3. Need help migrating console app to windows app
    By DelphiGuy in forum C++ Programming
    Replies: 1
    Last Post: 03-14-2004, 07:05 PM
  4. pasword app
    By GanglyLamb in forum C Programming
    Replies: 2
    Last Post: 06-07-2003, 11:28 AM
  5. How do I make my Linux app standalone?
    By Joda in forum C++ Programming
    Replies: 2
    Last Post: 11-27-2002, 04:53 AM

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