Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me code a complete program for this assignment! 2.7 HW5_Strings kent gives you HW3 (Graded out of 100) Write a program that performs

Please help me code a complete program for this assignment!

image text in transcribed
2.7 HW5_Strings kent gives you HW3 (Graded out of 100) Write a program that performs in - PLU code: Product Look Up Code. Unique for each product, stored as a string. Current Inventory Level (pounds of below is an example of file content. In this example, 002 Peaches 1 0.82 11 AD06 Mangos D 1.69 19 File has valid comerit if ail the data is valid ain valid data, the file must have only valid records. A record is valid if The first fern should be a PLU. It is valid if and only if it contains only letters or digits, and is 4 characters long The third her should be a sales type. It is valid if and only if it is only one character, and the character is a 1 or a0 . The fourth item should be a unit price it is valid if and only if it contains only digits and at most one dot. If there is a dot, there are at most two digits after the dot ch line has first to be broken ing tokens stores ny one record. . Additional Requirements - Make sure you meet oid losing points ) Functions more me required to implement your program with the to make your program e otherwise bool iavaliaprie (atring) : Takes as reference parapeter a string to be toker tokenization is based on a delimiter, where a deliniter is the " it' (tab) , " . (space), " \ ' xample: if the string s is "it abed\\tit 345\\t 475 ", the fun shed" as the first the string a to become "\\tit 345\\t "75 " string tokenize (string s); b) Style Make sure you follow the style requirements 2. Implementation Notes You are allowed to use any of the exsis s) Suggested outline of program's logic - Not all details are shown Have an outer loop to repeatedly read the file line by line. Exit the loop at the end of the tite Count the number of tokens extracted as far for the line If the number of tokena for the line

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions