CSC 271 - Software I: Utilities and Internals

Assignment #16 - A Few Choice Statements Manipulating Strings

Due Friday, December 8, 2017

Write a program that uses a string s using the following statement:

    s =  "  Fourscore and seven years ago  ";

Write statements that will:

  1. Find and display the length of s
  2. Create a string t with the SAME EXACT string without the trailing andr leading blank spaces and display the changed string.
  3. Create and display a string that add "our forefathers brought forth" to string s
  4. Create and display a string containing every character in s AFTER the eighth character.
  5. Return the starting position of the word "seven" and display it.
  6. Display the 18th character of the string s.

[Back to the Assignments List]