Question
Directions: Rewrite the program from the lesson by using Cstrings instead of the C++ string class. Do NOT not use the string header; use the
Directions: Rewrite the program from the lesson by using Cstrings 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 56 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. Builtin 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
includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started