Tuesday, June 28, 2016

Input Stream

Activity #2


Problem 1:

Write a program to require the user to input a string. Process the string by counting the total number of vowels and consonants in the string. For additional reference, please visit http://www.tutorialspoint.com/java/java_strings.htm , http://bit.ly/28TBVbB


VALIDATION

Sample Output #1:
Enter a string: Chance favors the prepared minds.

Vowels: 9
Consonants: 19

Sample Output #2:
Enter a string: The quieter you become, the more you are able to hear!

Vowels: 22
Consonants: 20

Sample Output #3:
Enter a string: Swing your rope down low.

Vowels: 7
Consonants: 13

------------------------------------------------------------------------------------------------------
Problem 2:

Write a program to require a string input from the keyboard. Using a loop structure, read the string backwards and display the result.

Sample Output #1:
Enter a string: Government
tnemnrevoG


Sample Output #2:
Enter a string: Aliens
sneilA

Sample Output #3:
Enter a string: Absurd
drusbA





Note: Once you're done, email the source code to adichosa@gmail.com. Use as subject <SECTION>-Act2-<fullname>. Deadline is on or before 12PM for Solus and 3PM for GNOME. TODAY!!!

No comments:

Post a Comment