Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include #include #include #include #include #include using namespace std; bool isFileValid(string); bool isValidPLU(string); bool isValidName(string); bool isValidType(string); bool isValidPrice(string); bool isValidInventory(string); string tokenize(string &); int

#include #include #include #include #include #include using namespace std; bool isFileValid(string); bool isValidPLU(string); bool isValidName(string); bool isValidType(string); bool isValidPrice(string); bool isValidInventory(string); string tokenize(string &); int getWordsCount(string); int main() { cout = 'a' && ch = 'A' && ch = '0' && ch = 'a' && ch = 'A' && ch = '0' && ch 1) return false; else { st = true; string str2 = str.substr(i, str.length()); if (str2.length() > 3) return false; } } else { return false; } } return st; } bool isValidInventory(string str) { bool st = false; for (size_t i = 0; i = '0' && ch

Input.txt

in.txt:

A001 Apples 1 0.90 21 A002 Peaches 1 0.82 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in0.txt

A001 Apples 1 0.90 21 A00% Peaches 1 0.82 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in1.txt

A001 Apples 1 0.90 21 A002 [eaches 2 0.82 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in2.txt

A001 Apples 1 0.90 21 A002 Peaches 11 0.82 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in3.txt

A001 Apples 1 -0.90 21 A002 Peaches 1 0.823 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in4.txt

A001 Apples 1 0.90 21 A002 Peaches 1 0.82 11. A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in5.txt

A001 Apples 1 0.90 21 A002 Peaches 1 0.82 11 &^ A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in6.txt

A001 Apples 1 0.90 A002 Peaches 1 0.82 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

in7.txt

A001 Apples 1 0.907 21 A002 Peaches 1 0.825 11 A009 Strawberries_Case 0 12.50 8 4261 Rice_1_LB_Bag 0 0.49 107

***This is my code. it runs perfectly without any errors or warning but for some reason when I put my code into zylabs I get an error because my output is not similar to the output provided in the pictures. I get an error that says "Program generated too much output. Output restricted to 50000 characters. Check program for any unterminated loops generating output." The error is provided in the last picture. please make my code look like the 6 pictures provided before the error. The program has to be in C++.image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

y 23. HW zyBooks My library > CE 1337/CS 1337/TE 1337 Computer Science I home> 2.3: Hw3 e7yBooks catalog Help/FAQ safan ali Enter input file:ino.t.xt Checkinq ino.txt Token #1 is A001, PLU is valid roken #2 Apples, product name i valid Token #3 is 1, Sales type is valid roken #4 is 0.90, Price is valid Token #5 i 21, Inventory i valid Token #1 is A00%, PLU is invalid ttttttt in0.txt has invalid content ttttttth Output-2 Enter input file:inl.txt Checking inl.txt Token #1 i3 A001, PLU i valid Token #2 is Apples, Product name i valid Token #3 is 1, Sales ype is valid Token t4 is 0.90, Price is valid Token t5 is 21, Inventory is valid Token #1 A002, PLU s valid Token #2 [eaches, product name i invalid lype here to search y 23. HW > O ! https://e.rnybouks.co."/ybokNTDALLAS 1337CS1337TE13071 zyBooks My library > CE 1337/CS 1337/TE 1337 Computer Science I home 2.3: Hw3 E zyBooks catalog Help/FAQ safan ali Enter input file:in2.txt Checking in2.txt Token #1 i3 A001, PLU i valid Token #2 is Apples, Product name i valid Token #3 is 1, Sales lype is valid Token t4 is 0.90, Price is valid Token t5 is 21, Inventory is valid Token #1 A002, PLT s valid Token 2 peaches, product name i valid Token #3 ia 11, salea type is invalid in2.txt has invalid contentHH Output-4 Enter input tile:in3.txt Checking in3.txt Token #1 A001, PLT s valid Token 2 is Apples, Product name is valid Token 3 is 1, sales type is valid Token f4 -0.90, price is invalid ##### ins . txt has invalid content ##### nutr O lype here to search y 23. HW zyBooks My library > CE 1337/CS 1337/TE 1337 Computer Science I home> 2.3: Hw3 e7yBooks catalog Help/FAQ safan ali Token t5 is 21, Inventory is valid Token tl 8A002, PLU is valid Token #2 8 peaches, prodiet name i8 valid Token 3 is1, Sales type is valid Token f4 is 0.82, Price is valid Token 5 ia 11, Inventory ia valid Token t6 ia&Too many items in record Output-7 Enter input file:in6.txt Checking in6.txt Token #1 i3 A001, PLU i valid Token #2 is Apples, Product name i valid Token #3 is 1, Sales ype is valid Token t4 is 0.90, Price is valid Inventory is invalid, record has missing items tattt in6.txt has invalid content dtatttt Output-8 Enter input file:in7.txt Checking int.txt lype here to search y 23. HW zyBooks My library > CE 1337/CS 1337/TE 1337 Computer Science I home> 2.3: Hw3 e7yBooks catalog Help/FAQ safan ali roken #4 i 0.90, Price i valid Inventory is invalid, record has missing items Output-8 Enter input file:in7.txt Checking in7.txt Token #1 is A001, PLU is valid roken #2 Apples, product name i valid Token #3 is 1, Sales type is valid Token #4 i3 0.907, Price i invalid ttittttt in7.txt has invalid content ttttitt Output-9 ACTIVITY 2.3.1: Hw3 Submission Instructions Additional files provided by your instructor. 0/95 main.cppin3.txt inl.txt ,in4.txtin2. txtin5.txtin.txt Download in.txt in.txt | , and in0 ' txt lype here to search zyBooks My library>CE 1337/CS 1337/TE 1337 Computer Science I home >2.3 Hw3 E zyBooks catalogHelp/FAQ safan ali 1: Output test1 0/9 Program generated too much output. output retricted to 50000 characters . Check program for any unterminated loopa generating output Input in.txt Enter the file nare:There are 1 records in the Eilee Irventory read trom tile 0.9, inventory: 21. PLU: A001, Apple PLU: A002, Peaches PLU: A009, St.rawberries Casc, type: 0, unit price: 12.5, inventory: 8 PLU: 4261, Rice-1-LB-Bag type: 0, unit price: 0.49, inventory: 10; type: 1 it price: 0.82, inventory: 11 2 - Print arrent inventorye - Quite irvalid choice, reenter: Invalid chvice, reenter: Irvalid choice, reenter: Irvalid choice, reenter: Invalid choice, reenter: Invalid choice, reenter: nvalid choice, reenters Iivalid choice, reenter: Invalid choice, reenter: valid choice, reenter: rvalid choico, reentor: O lype here to search

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 22nd European Conference Adbis 2018 Budapest Hungary September 2 5 2018 Proceedings Lncs 11019

Authors: Andras Benczur ,Bernhard Thalheim ,Tomas Horvath

1st Edition

3319983970, 978-3319983974

More Books

Students also viewed these Databases questions

Question

Conduct a needs assessment. page 269

Answered: 1 week ago