Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "input.h"
- #define a0 -0.62831853071
- #define b0 0.62831853071
- using namespace std;
- void input(double &a, double &b, double &h,double &eps){
- cout<<"Please, insert the following variables: \n";
- cout<<"a: ";
- while(1){
- cin >>a;
- if(!cin.good() || a>a0){
- cout <<"Incorrect data, please input new one"<< endl;
- cin.clear();
- cin.sync();
- }
- }
- cout<<"b: ";
- while(1){
- cin >>b;
- if(!cin.good() || b>b0){
- cout <<"Incorrect data, please input new one"<< endl;
- cin.clear();
- cin.sync();
- }
- }
- cout<<"h: ";
- while(1){
- cin >>h;
- if(!cin.good()){
- cout <<"Incorrect data, please input new one"<< endl;
- cin.clear();
- cin.sync();
- }
- }
- cout<<"epsilon: ";
- while(1){
- cin >>eps;
- if(!cin.good()){
- cout <<"Incorrect data, please input new one"<< endl;
- cin.clear();
- cin.sync();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement