0% found this document useful (0 votes)
60 views

Mp4 String

The document describes a program that asks a user to enter a string and then displays a menu for the user to choose from options to convert, count, or reverse the string. The options include converting the string to uppercase, lowercase, or title case; counting the size, characters, or words; and reversing the string horizontally or vertically. The program must include validation, functions for each menu option, and confirm before quitting.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views

Mp4 String

The document describes a program that asks a user to enter a string and then displays a menu for the user to choose from options to convert, count, or reverse the string. The options include converting the string to uppercase, lowercase, or title case; counting the size, characters, or words; and reversing the string horizontally or vertically. The program must include validation, functions for each menu option, and confirm before quitting.
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 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

You might also like