CSC 160 - Computer Programming for non-Majors

Assignment #14 - A Few Choices Statements Manipulating Strings

Due Tuesday, December 1, 2015

Write a program that creates 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]