The same numbers keep showing up in c++ program. No idea why -


i wrote intention of finding vertex of 3 user entered point though repeats same numbers regardless of entered. not noticing wrong. thinking set formulas wrong. language c++ if changes anything.

#include<iostream> using namespace std; //declare variables. int main() {     float a,b,c;     float vertex1;     float vertex2;     //allow user inputs. 

overall basic program.

    cout << "enter values a,b,c receive vertex of parabola";     cin>> a>>b>>c;     //create vertex calculations. 

my calculations here though not sure formatted correctly.

    vertex1=-(b/(2*a));     vertex2=-b*b*2/(4 *a)+c;     cout <<"x of v is" <<vertex1<<endl;     cout<<"y of v is"<<vertex2<<endl;      return 0; } 

like have said before things seem correct though nothing coming out. overall confusing. hoping fix simple.

change -b*b*2/(4 *a)+c (b*b)/(4*a) - ((b*b)/(2*a)) + c

how got it

take fact x cord -b/2a. take f(-b/2a) ax^2 + bx + c
a(-b/2a)^2 + b(-b/2a) + c
a(b^2/4a^2) - (b^2/2a) + c
b^2/4a - b^2/2a + c


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -