Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ programming In this assignment you will write a C++ function called parse that reads one line of user input from the keyboard and creates

C++ programming

In this assignment you will write a C++ function called parse that reads one line of user input from the keyboard and creates an array of the strings found in the input. Your function should be passed the array and a reference variable that is to be assigned the length of the array. Prompt the user and read the input from within the function.

For example: If the user inputs cp this that, the resulting array would have length 3 and contain the strings cp, this, and that.

Create a main function that has a loop that will continuously call the function until the user enters the string quit. After the parse function has returned control to main, print the contents of the array and its length.

Your program should:

Give detailed directions to the user.

Contain carefully worded pre and post conditions for the parse function.

Be readable with appropriate documentation and formatting.

Use an array of cstrings.

Read the users input one character at a time using cin.get().

You will need to build the strings one character at time using white space to separate the strings. (Remember that cstrings end in \0.)

DO NOT USE getline() !!!

Skip any extra whitespace within the users input or at the end of the input

copy this that and copy this that would produce the same result.

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

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions

Question

a. How are members selected to join the team?

Answered: 1 week ago

Question

b. What are its goals and objectives?

Answered: 1 week ago