Suppose that an automated manufacturing tracker records production QC test results in batches in a results string. For example, Q2p1d1 would indicate that a single batch of two QC tests was performed...

1 answer below »
I am looking for help with for the attached. I am stuck on it and need help since I am new to python. Its due by tomorrow at by 5pm


Suppose that an automated manufacturing tracker records production QC test results in batches in a results string. For example, Q2p1d1 would indicate that a single batch of two QC tests was performed with the results of one pass and one defect. Note that the character Q is used to start a batch of QC test results. The character p is to identify the number of tests that passed the QC test, and the character d indicates the number of defects. More than one batch of QC test results can be reported in a single results string. For example, Q2d1p1Q5p3d2 would indicate two batches of QC test results, one with two test results and one with five test results, with a combined total of four passes and three defects. Precisely, to be a valid QC test results string, · a batch of results must begin with the character Q (case sensitive) · a batch of results must report both pass and defect test results with p and d in either order · no leading zeros are allowed in any numeric value being reported · the total number of QC tests in a batch must equal the number of pass and defect test results. · the total number of QC tests in a batch must be greater than zero (0). - a single result string may include multiple batches of results All of the following are examples of valid result strings: · Q1p0d1Q1d0p1 (two batches of results, two total tests, one pass, one defect) · Q5d2p3 (one batch of results, five total tests, two defects, three passes) All of the following are examples of invalid result strings: · q1p0d1 (batch must be reported with Q) • Q1pd1 (a number for pass is required) · Q1p1d (a number for defect is required) · Q1p0d1 asdfR (extra characters not allowed) · Q5p00003d0002 (leading zeros not allowed) · Q5p0d0 (pass and defect results must equal the total number of tests) · Q0p0d0 (batch cannot be zero) Your task For this project, you will implement the following function, using the exact function name, parameter type, and return type shown in this specification. (The parameter and variable names may be different if you wish. Again the function name must be isValidString). def isString(s): return isNotString s is the QC test results string (see above examples of valid and invalid test result strings.) isNotString is a boolean variable that stores either a True or False value. This function returns true if its parameter s is a well-formed test result string described above, or false otherwise. You should include an adequate level of comments in your code to help the code reviewer understand your code. Save your Python program as QCString.py. Your QCString.py should include the isString() function and other supporting functions that you developed and called from the isString() function. Please remove all output statements (print()) from your functions if you used any output statements like print() to help you to test and debug. IMPORTANT: You can only use Python built-in functions to write this program. You are not allowed to use any imported modules, packages, or libraries such as pandas, NumPy, math, etc. the goal of this assignment is to practice: · Program design · User-defined functions with a return value · Global variables · Boolean variables · Arithmetic operators · Assignment operators · Comparison operators · Logical operators · If-elif-else control statements including nested ifs. · While loops · Data type casting · String index, built-in string len() and isdigit() functions You should be able to complete the assignment with the above-mentioned built-in Python features. Make sure that you test your function with both valid and invalid test result strings. We will be testing your function with 30 test cases (QC test result strings).
Answered 122 days AfterFeb 26, 2022

Answer To: Suppose that an automated manufacturing tracker records production QC test results in batches in a...

Sathishkumar answered on Jun 29 2022
88 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here