Question: Rewrite the program from the lesson by using C?strings instead of the C++ string class. Do NOT not use the string header; use the cstring

Rewrite the program from the lesson by using C?strings instead of the C++ string class. Do NOT not use the string header; use the cstring header instead. Create and use the functions described below to extract the length, location of w, year, customer number and order number from the workorder. Requirements: 1. Main program a. Output instructions to the user to enter the work order in the appropriate format: i. First 5?6 digits represent the customer number followed by the letter w ii. The digits following the letter w represent the year iii. The remaining digits (up to 5) represent the order number b. Input the work order into a char array of size 20 c. Breakdown the work order by calling the functions described below d. Output the components of the work order i. Length ii. Location of the letter w iii. Customer number iv. Year v. Order number 2. Create and use the following functions to break out the components of the work order: a. Built?in function strlen (workOrder) i. Returns the length of the char array b. int findW (char[], int); i. Searches the workOrder to find the location of the letter w ii. Returns the array location of the letter w c. long getCustNum (char[], int); i. Transfers the characters in the work order prior to the letter w into a local customer number character array ii. Converts the local customer number character array to type long iii. Returns the long value of the customer number d. int getYear (char[], int); i. Returns the two digist following the letter w as type int e. long getOrderNum (char[], int, int); i. Transfers the characters in the work order following the letter w into a local char array ii. Converts the local char array to type long iii. Returns the long value f. Program must be documented with the following: Name, Date, Program Name, Description.

//Program from last lesson:

In the example below, the program below inputs the second column in order to extract the customer number, the year, and the order number. For example the first number 91800w940770 is broken into 3 parts: 91800 is the customer number, the w indicates a work order, the next two digits are the year and the remaining digits are the work order number. The customer number could be 5 to 6 digits and the work order could expand to 5 digits.

Rewrite the program from the lesson by using C?strings instead of the

Depending on what library functions you want to use dictate the header you will use. The program above uses the string header. This allows you to use certain functions such as .assign. If you do not include the correct header, then the program will not compile.

C++ string class. Do NOT not use the string header; use the

Your assignment for this topic will be to rewrite the above program using the C-strings. You will find the instructions to the assignment in the appropriate drop box

#include using namespace std; /eed this if working with string clas:s int main() int strLength, wPointer; string custNumber, year, workOrderNumber; string workOrder"91800w940770"; strLength- workorder.length); wPointer workOrder.find 'w',0); custNumber.assign (workOrder, 0, wPointer); year.assign(workOrder, wPointer + 1, 2); //the year is the two digits after the w workOrderNumber.assign(workOrder, wPointer 3, strLength); I/extracting the work order number //remember the first digit in the string is a 0 //extracting the customer number EAAAAA CIS 12021Topic 6\New folderlstrings Debuglstrings.exe cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!