Assignment 2

This homework is worth 5 points.

When you finish this assignment you should be able to :

Write a program which will prompt the user for and read in three phrases and print a table of the phrases and the lengths of the phrases. These phrases should be less than 37 characters long, but you don't need to enforce this.

The table should contained a left aligned column of phrases and a right aligned column of lengths. The first column should be indented a tab (\t), and the second column should end 40 spaces past the tab. (See picture below)

After the three phrases have been printed, print two additional lines. Place three dashes under the individual phrase lengths. On a line below that, place the total length of all three phrases.


Make a constant to hold the value of 40, include a comment describing how this makes your code more flexible.

Please look on line for references to the setfill() stream manipulator and use this to fill the spaces between the two columns with '.'.

Please include a comment in your code describing the setfill() manipulator, including:

  1. Is the setfill manipulator persistent?
  2. How would you reset the setfill manipulator to the default value?

Once you have a working program, email the program to danbennett360@gmail.com. Please attach the source code file to your message. Please DO NOT send the executable file.