OverviewWrite a program that can do a number of different things. AssignmentYour program must present the user with a menu of three options, numbered 1 to 3. Based on the option selected by the user, the program will do one of three things (described below) and then redisplay the menu. The program will end when the user enters an invalid option. Option 1: Cats and DogsAsk the user to enter a phrase. The program will display the number of "cat" and "dog" character sequences found in the phrase that was entered by the user. Samples: Input Output ===== ====== The cat and the dog where friends with dogs. Cats: 1, Dogs: 1 Cat and cat and dog and doggie dog dog. Cats: 2, Dogs: 2 dog dog dOg cat DOG cat cat dog Cats: 3, Dogs: 5 Option 2: Mix StringAsk the user to enter two words. The program will display a String created from the two words entered by the user. The String is created by taking the first letter from the first word followed by the first letter of the second word. This is repeated for additional letters. If the words entered by the user are not the same length, the leftover characters from the longer word are added at the end of the sequence of alternating characters. Input Output ===== ====== Frightfully challenging Fcrhiaglhltefnuglilnyg No hope Nhoope Excessively easy Eexacseyssively Option 3: PalindromeAsk the user to enter a phrase. The program will display one of two messages, based on the phrase entered by the user: "You entered a palindrome." or "You did not enter a palindrome." A palindrome is defined as a phrase that is identical when read from start to finish or finish to start. Input Output ===== ====== Monkeys in the make up room You did not enter a palindrome. Never odd or even You entered a palindrome. Madam, in Eden I'm Adam Depends The third sample depends on whether the program ignores punctuation or not. The program is not required to ignore punctuation; however, you may add the feature if you wish. Requirements
Lab DeliverablesDemonstration (due at the end of week 5 lab)Each student must demostrate a partially complete version of their program to their instructor. The program must:
Submission (due at 11pm the day of week 5 lab)Each student must submit their program with complete functionality. The program must contain comments at the beginning of the file that include: Course name, Quarter, Assignment name, Author's name, and date (see here). Student's must use the electronic submission form to submit their code. Enter your MSOE username for the username, select "Lab 4" for the assignment, select your Lab4.java implementation for the report file name and leave the support file name blank. AcknowledgmentThis laboratory assignment was developed by Dr. Chris Taylor. |