Hello everybody :)
I've to solve C++ problem and there it is:
You have to write a program in C++ that computes the difference between the maximal and the minimal value of function f(x,y) obtained on an integer point in a given rectangle [a, b] x [c, d]. Your program should prompt the user to input numerical values of a, b, c and d, as floating point numbers, which are expected to be in a range from −100 thru 100. In case the minimal or maximal values do not exists, your program should output appropriate messages.
Actually I have written a part of it:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a,b,c,d,x,y,f;
cout<<"Please add four numbers each of them corresponds to a, b, c and d."<<"\n";
cout<<"A=";
cin>>a;
cout<<"\n"<<"B=";
cin>>b;
cout<<"\n"<<"C=";
cin>>c;
cout<<"\n"<<"D=";
cin>>d;
for ( x=a; x<=b; x=x+0.01)
{
for ( y=c; y<=d; y=y+0.01)
f=sin(y)-cos(x*x);
cout<<"Answer: "<<f<<"\n";
}
system ("pause");
return 0;
}
...So I want to take min and max of f . I've tried some things but my knowledge of C++ is not so big.
Email: <<removed>>
Thank you.