Advertisement
Guest User

Untitled

a guest
Nov 27th, 2014
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 KB | None | 0 0
  1. #include "input.h"
  2. #define a0 -0.62831853071
  3. #define b0 0.62831853071
  4. using namespace std;
  5.  
  6. void input(double &a, double &b, double &h,double &eps){
  7. cout<<"Please, insert the following variables: \n";
  8. cout<<"a: ";
  9. while(1){
  10. cin >>a;
  11. if(!cin.good() || a>a0){
  12. cout <<"Incorrect data, please input new one"<< endl;
  13. cin.clear();
  14. cin.sync();
  15. }
  16. }
  17. cout<<"b: ";
  18. while(1){
  19. cin >>b;
  20. if(!cin.good() || b>b0){
  21. cout <<"Incorrect data, please input new one"<< endl;
  22. cin.clear();
  23. cin.sync();
  24. }
  25. }
  26. cout<<"h: ";
  27. while(1){
  28. cin >>h;
  29. if(!cin.good()){
  30. cout <<"Incorrect data, please input new one"<< endl;
  31. cin.clear();
  32. cin.sync();
  33. }
  34. }
  35. cout<<"epsilon: ";
  36. while(1){
  37. cin >>eps;
  38. if(!cin.good()){
  39. cout <<"Incorrect data, please input new one"<< endl;
  40. cin.clear();
  41. cin.sync();
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement