You are on page 1of 2

List of Problems for For-Loops

Problem 1 Count the number of vowels. Given a String input, count the number of vowels. The program must count exactly how many a, e, I, o, and u are in a given word/sentence. Difficulty: Problem 2 Better Version of Rock, Paper, Scissors Create a game of rock, paper, scissors that allows for 5 rounds. The program checks for the player that has the most number of points at the end of 5 rounds. If the players end in a draw, the program must ask if the players want to play again, otherwise the program must end. Create a different version also, where the opponent is the computer itself. Use Math.random to simulate the AI of the program. Difficulty: Problem 3 Password Strength Evaluator Create a program that checks for the strength of a password. A password is strong if it has a length of more than 8 characters, an uppercase letter, a number and a special symbol. A password is moderately strong if one of the conditions is not satisfied. If the passwords length is shorter than 8 characters and does not contain a special symbol, it is a weak password. (Hint: use multiple loops) Difficulty: Problem 4 Flames Create a program that accepts two names of any length (including the surnames). The program will simulate the FLAMES game. The program cancels for letters in the same name (ex. A in Laura). The program must show the cancelled letters. A sample input/output has been provided below. Enter Day: Miley Cyrus Enter Month: Justin Bieber Output: M * l * * C * * * * and J * * t * n * * * * * * Acquaintance!!! Problem 5 Caesar Cipher Caesar Cipher is an encryption technique where a given letter in a given String is replaced by another letter some fixed number of positions down the alphabet. The program simulates the encryption technique by asking for the shift and String to be encrypted. For example a shift of 4, means that A becomes E, B becomes F, C becomes G, etc. Try to create a decryption program also.
Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ Plaintext: the quick brown fox jumps over the lazy dog

Difficulty:

Difficulty:

Problem 6 Wheres min and max? Create a program that finds the max and min. The user can input as many integer values as he/she wants. The program stops asking for input when the user enters stop. Difficulty: Problem 7 Roman or Arabic? Create a program that identifies if the input is Arabic or Roman Numeral. If the input is Arabic, the program must convert it to roman numeral and if its roman numeral, the program must convert it to Arabic. Difficulty: Problem 8 Doppelgangers Create a program that accepts any number of Strings or integers. The program must stop when a duplicate has been entered. It must display Duplicate Found when the user enters a previous input. Difficulty: Problem 9 Nth Prime Create a program that asks the user what prime number to display. For example, the first prime number is 2. Second prime number is 3. Third prime number is 5, so on and so forth. A prime number is a number any number that is greater than 1 and divisible by exactly 2 divisors, 1 and itself. You will definitely need nested loops for this or a special method. Difficulty: Problem 10 Piglatin
Pig Latin is a language game of alterations played in English. To form the Pig Latin form of an English word the onset of the first syllable is transposed to the end of the word and an ay is affixed. You are to create a translator program that transforms English words to Pig Latin following the following rules: In words that begin with consonant sounds, the initial consonant or consonant cluster is moved to the end of the word, and "ay" is added, as in the following examples: beast east-bay || dough ough-day || happy appy-hay || question estion-quay In words that begin with vowel sounds or silent consonants, the syllable ay is simply added to the end of the word. another another-ay || if if-ay

Create a program that simulates this language game. The program converts any length of String to Piglatin form, and will only exit if the user enters EXIT.

Difficulty:

You might also like