Exam 2- 2013

The definition of a function called checkuserstring

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: character occurs in the string. For example, if you pass it "success" and "s", it should return 3, since the character "s" appears 3 times in the word "success". CS 115 Exam 2, Spring 2013 Page 7 of 9 Problem 4: A complete program (25 points) For this problem, you must write a complete program. That includes a docstring, a def main(), any necessary library imports, etc. Read the instructions carefully before you start coding! If you get stuck, try to maximize your partial credit. Your program should contain the following: 1. The definition of a function called check_user_string that: o takes a string as its input parameter o returns True if the string contains at least 3 words and False otherwise 2. The definition of a function called get_user_name that: o does not have any input parameters o repeatedly prompts the user for his/her full name until the user enters a string that contains at least 3 words o calls check_user_string to check each of the user’s entries 3. A main fun...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online