I need help urgently on Arrays and functions

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 1
Reputation: honeybleak is an unknown quantity at this point 
Solved Threads: 0
honeybleak honeybleak is offline Offline
Newbie Poster

I need help urgently on Arrays and functions

 
0
  #1
May 8th, 2006
HI, I need to create a program which tests whether within a range given by the user, there exists an extreme of quadratic function (y=ax2+bx+c). The parameters (a,b,c) of this function are given by the user. I just started it but I have a problem in completing it. This is how far I can go.
#include <stdio.h>
int x;
int y;
int a,b,c;
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: I need help urgently on Arrays and functions

 
0
  #2
May 8th, 2006
Originally Posted by honeybleak
HI, I need to create a program which tests whether within a range given by the user, there exists an extreme of quadratic function (y=ax2+bx+c). The parameters (a,b,c) of this function are given by the user. I just started it but I have a problem in completing it. This is how far I can go.
#include <stdio.h>
int x;
int y;
int a,b,c;
Can you explain what you mean more clearly?
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,647
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1498
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: I need help urgently on Arrays and functions

 
0
  #3
May 8th, 2006
  1. #include <stdio.h>
  2. int x;
  3. int y;
  4. int a,b,c;
  5.  
  6. int main()
  7. {
  8. // put your code here
  9.  
  10.  
  11. return 0;
  12. }
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 10
Reputation: Cool Nanu is an unknown quantity at this point 
Solved Threads: 0
Cool Nanu's Avatar
Cool Nanu Cool Nanu is offline Offline
Newbie Poster

Re: I need help urgently on Arrays and functions

 
0
  #4
May 8th, 2006
Do u need a complete program for this I justcreated one for calculating the roots of QUADRATIC EQUATIONS.
Replyto this if u need one or anyone else will copyit and use it.
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,055
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: I need help urgently on Arrays and functions

 
4
  #5
May 8th, 2006
No, that's not what's being asked for. honeybleak, do you know how to do the calculation on paper?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,647
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1498
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: I need help urgently on Arrays and functions

 
0
  #6
May 8th, 2006
see this article
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,055
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: I need help urgently on Arrays and functions

 
2
  #7
May 8th, 2006
That link has nothing to do with finding the global extremum, which is located at -b/2a. (If a = 0 then there is no global extremum.)
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 5,273
Reputation: iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold iamthwee is a splendid one to behold 
Solved Threads: 378
Featured Poster
iamthwee's Avatar
iamthwee iamthwee is offline Offline
Posting Expert

Re: I need help urgently on Arrays and functions

 
0
  #8
May 8th, 2006
What does your avatar mean or represent Mr Rashakil? Remember the ancient dragon is no maths wizz kid :-)
Reply With Quote Quick reply to this message  
Join Date: Jun 2005
Posts: 2,055
Reputation: Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice Rashakil Fol is just really nice 
Solved Threads: 139
Team Colleague
Rashakil Fol's Avatar
Rashakil Fol Rashakil Fol is offline Offline
Super Senior Demiposter

Re: I need help urgently on Arrays and functions

 
2
  #9
May 8th, 2006
I don't think it's a question of math, people just misinterpreted the problem (or had read the first misinterpretation of the problem). Why would I tell anybody what my avatar is?
All my posts may be redistributed under the GNU Free Documentation License.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 4
Reputation: soxers12 is an unknown quantity at this point 
Solved Threads: 1
soxers12 soxers12 is offline Offline
Newbie Poster

Re: I need help urgently on Arrays and functions

 
0
  #10
May 8th, 2006
you have to check the bounds. i.e. if someone inputs the range ( -1 , 2 ). you should check the following.

let f(x) = ax^2 + bx + c .
check f(-1), f(2) and f(-b/2a).

since this is a quadratic it can be assumed that a != 0.

if you are looking for mins and max those are the only possible places they can occur ( local extrema f(-1), f(2) ) and a global extrema f(-b/2a).
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 1523 | Replies: 13
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC