Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Check for proper data input format, and ranges
- void Xclass::errMacGyver(int sku, int qty, double price, int menu, int CASE) {
- auto caZe= &CASE;
- if (cin.fail()) {
- cleanCin();
- return;
- }
- if((*caZe)==0 && cin.good()) {
- if(sku<0 || qty<0 || price<0) *caZe=1; //Negative
- if((sku>0 && sku<10000000) || (price>0 && price<0.5)) *caZe=2; //Too Small
- if(qty>99 || sku>99999999 || price>20000) *caZe=3; //Too Large
- switchBlade(*caZe);
- } else if ((*caZe)!=0 && (*caZe)!=111 ) switchBlade(*caZe); //directly invoke error message
- else if((menu<1 || menu>6) && (*caZe)==111) switchBlade(*caZe); //menu choice
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement