| | |
I need help urgently on Arrays and functions
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: May 2006
Posts: 1
Reputation:
Solved Threads: 0
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;
•
•
•
•
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;
C++ Syntax (Toggle Plain Text)
#include <stdio.h> int x; int y; int a,b,c; int main() { // put your code here return 0; }
•
•
Join Date: May 2006
Posts: 4
Reputation:
Solved Threads: 1
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).
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).
![]() |
Similar Threads
- Using functions and arrays to create a program for grades (C++)
- Passing arrays of objects to functions (C++)
Other Threads in the C++ Forum
- Previous Thread: How to capture the system idle time in c/c++
- Next Thread: how to capture the system idle time using c/c++
Views: 1523 | Replies: 13
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api array arrays based beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete deploy dll download dynamic dynamiccharacterarray encryption error file format forms fstream function functions game givemetehcodez graph gui homeworkhelp iamthwee ifstream input int java lib library lines linker list loop looping loops map math matrix memory newbie news number output pointer problem program programming project python random read recursion recursive reference return rpg search simple sort spoonfeeding string strings struct temperature template templates text text-file tree url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






