[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Maths in C++

Posted on 2011-10-05
15
Medium Priority
?
301 Views
Last Modified: 2012-05-12
New to programming and was wondering if anyone could recommend any good sites or books or really what's the best and quickest way to pick up the C++ language. The other question I have is how C++ be used to write a program to find x so that it satisfies an equation such as this one: x/x - x/2 + x/4 = x/12.
0
Comment
Question by:Paulduberry
  • 7
  • 5
  • 3
15 Comments
 
LVL 86

Assisted Solution

by:jkr
jkr earned 1600 total points
ID: 36917649
I'd really suggest 'Numerical Recipes: The Art of Scientific Computing, Third Edition in C++ (2007)' - you can browse it online for a 30 days trial period at http://www.nr.com/oldverswitcher.html - see http://www.nr.com/com/storefront.html
0
 

Author Comment

by:Paulduberry
ID: 36917758
Thanks for that.
0
 
LVL 9

Expert Comment

by:user_n
ID: 36917844
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 86

Expert Comment

by:jkr
ID: 36918135
user_n, so how would you go about solving an equation given your link?
0
 
LVL 9

Expert Comment

by:user_n
ID: 36918195
Sorry I have been thinking about math operations. You shold use the link if you have to write some equation. For x the answer is 3
0
 
LVL 9

Expert Comment

by:user_n
ID: 36918244
You can not use a  progamming language to solve a problem. You should first find a way to solve the equation then a way to represent your way in programing language.


or you can use http://en.wikipedia.org/wiki/Mathematical_software
0
 
LVL 9

Expert Comment

by:user_n
ID: 36918255
0
 
LVL 9

Expert Comment

by:user_n
ID: 36918357
Or you should use a parser to parse the equation, to enter the values and see the result
0
 

Author Comment

by:Paulduberry
ID: 36918370
I figured the answer to be 3. However, what I was looking for was an approach to take using C++ giving it, for example, a range of numbers to select from (1-10). Could it be done using a loop? Remembering, of course, that I am a newbie to this.
0
 

Author Comment

by:Paulduberry
ID: 36918374
What kind of code is involved with a parser?
0
 
LVL 9

Assisted Solution

by:user_n
user_n earned 400 total points
ID: 36918415
http://www.codeproject.com/KB/cs/MathParserLibrary.aspx
You will need parser.

You will have to code that x can not be 0.(you can not divide to 0)

But the easiest way I think will be with something like mathematica.
0
 
LVL 9

Expert Comment

by:user_n
ID: 36918427
0
 
LVL 86

Accepted Solution

by:
jkr earned 1600 total points
ID: 36918494
You might be interested in the following articles:

http://www.codeproject.com/KB/cpp/eqSolv.aspx ("Equation Solver in C")
http://www.codeproject.com/KB/recipes/nummethods.aspx ("Some simple numerical methods in C++")
0
 

Author Comment

by:Paulduberry
ID: 36919477
Some interesting stuff here. I'll check back again in the morning and close. Thanks to the two experts that helped me.
0
 

Author Closing Comment

by:Paulduberry
ID: 36922817
Thanks for the help guys. Didn't really find the wikipedia links particularly helpful for my question but ok for general information.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses

868 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question