Вы находитесь на странице: 1из 1

Machine Problem #4 Create a program that asks the user to enter a string not more than 1000 characters.

Then the user will choose from the menu. The computer should display the corresponding output based from the option that the user entered. Menu . 1. Convert to a. uppercase b. lowercase c. title case 2. Count the a. size b. characters c. words 3. Reverse a. horizontal b. vertical 4. Quit Enter your choice from the menu above then press <enter>. Enter the string: this is a string test. The output is: THIS IS A STRING TEST. Requirements: 1. Convert the menu displays the submenu: a. uppercase all the characters contained in the string will be converted to UPPERCASE. b. lowercase all the characters contained in the string will be converted to lowercase. c. title case the first character of every word is converted to UPPERCASE and the remaining characters are in lowercase. 2. Count the menu displays the submenu: a. size counts the length of the string including spaces, special characters, etc. b. characters counts the total number of characters excluding blank spaces, and null characters. c. words counts the total number of words contained in the string excluding blank spaces. 3. Reverse the menu displays the submenu: a. horizontal reverses the order of the string per character with a space in between. b. vertical reverses the order of the string per character every line. 4. Quit once selected, the user will be asked Are you sure you want to exit? [y/n]: . If the user enters Y, the program terminates. Otherwise, the main menu is displayed. Include user input validation and display appropriate messages. For each menu and submenu, you must create functions that perform its task (modular programming). Note: Turn in your MP#4 on February 22, 2012 Wednesday @11:59pm. 1