Course Home | Class Schedule | Moodle CMS | Git Submission | Perusall | Tutoring

Saint Louis University

Computer Science 1300/5001
Introduction to Object-Oriented Programming

Michael Goldwasser

Fall 2019

Computer Science Department

Homework Assignment 06

Strings and Lists

Overview

Topic: Strings and Lists
Related Reading: Revised Chapter 6
Due: tbd

Please make sure you adhere to the policies on academic integrity.


Problems to be Submitted (20 points)

  1. (10 points)

    Write a program that accepts a sentence from the user on a single line, and which outputs the number of words in the sentence. A sample execution appears as follows:
    Enter a sentence: The quick brown fox jumps over the lazy dog
    You entered 9 words.

  2. (10 points)

    Write a program that prompts the user for a name that is assumed to be of form FirstName MiddleName LastName and which echos the name except with the middle name replaced by the middle initial and a period.

    The precise format should match the following sample session.

    What is your name? Elmer James Fudd
    Elmer J. Fudd


Michael Goldwasser
CSCI 1300/5001, Fall 2019
Last modified: Sunday, 16 September 2018
Course Home | Class Schedule | Moodle CMS | Git Submission | Perusall | Tutoring