CSCI 261 - Programming Concepts

Spring 2019 - Lab 6B - Vector of Words

Quick Links: Canvas | Mines | Piazza | zyBooks

|   Home |  Contact |  Syllabus |  Assignments |  Schedule |  Resources   |

This lab is due by Thursday, April 4, 2019, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab.


Instructions



In this lab, you will have the user first enter a sentence that you will store in a string. Then, you will need to split the sentence in to its individual words. Store these words in a vector of strings.

This process is called String Tokenization.

When the user is done entering their sentence, print in order:
  1. How many words the user entered.
  2. The words the user entered in order, one per line.
  3. The first word they entered.
  4. The last word they entered.
An example interaction follows:

Hey! Witness my first vector mojo!
Enter a sentence:
The quick brown fox jumped over the lazy dog.

So awesome! You entered 9 words. They are:
1: The
2: quick
3: brown
4: fox
5: jumped
6: over
7: the
8: lazy
9: dog.
The first word is: The
The last word is: dog.
Gaze at my awesome.


Functional Requirements



  • When printing the number of words entered by the user, do not use a counter and a loop. Instead, make use of one of our vector functions to determine this value.
  • Use vector functions to determine the first and last word in the list. Do not store them from a loop.


Hints



  • You'll find Lab6A helpful to complete this lab.


Lab Submission



You will submit your solution to this lab with the rest of Set6. Detailed instructions for doing this are posted in Assignment 6.


This lab is due by Thursday, April 4, 2019, 11:59 PM.
As with all labs you may, and are encouraged, to pair program a solution to this lab.

Last Updated: 03/05/19 20:31


Valid HTML 4.01 Strict Valid CSS! Level Triple-A conformance, W3C WAI Web Content Accessibility Guidelines 2.0