JavaScript isn't enabled in your browser, so this file can't be opened. Enable and reload.
Practice 1
String Exercises
Due Date: Sat 25-2-2017 at 9:00pm
Sign in to Google
to save your progress.
Learn more
* Indicates required question
Name:
*
Your answer
ID:
*
Your answer
Section:
*
CS4E
IA_4
CS4A
Write the required Java statements to do the following:
All input data are read from a scanner object.
1. Count the number of vowel letters in a given word and display them to the user. E.g. input : hello; output: 2 e o
*
Your answer
2. Check if a given word contains numerical digits and display the number and its square value. E.g. input: student12; output: 12 144
*
Your answer
3. Check if a given word is Palindrome. E.g. input: lolo ; output: not palindrome; input: maxam; output: palindrome
*
Your answer
For the following piece of code:
String input = "Today is a great day";
int count = 0;
for(int i = 0; i< input.length(); i++)
if(input.charAt(i) == 'a')
count+=1;
System.out.println(count);
1. What is the output:
*
5
4
8
6
2. The last index of 'a' is:
*
20
19
18
17
3. The code does the following:
*
count the occurrence of vowels in input
count the occurrence of consonants in input
count the occurrence of a in input
none of the above
How do you rate this exercise set
I think this set of problems is
*
very hard! I'm thinking of changing my major :(
very easy, I'm way better than that! BRING IT ON :)
:/
Submit
Clear form
Never submit passwords through Google Forms.
Forms
This content is neither created nor endorsed by Google.
Report Abuse
Terms of Service
Privacy Policy
Help and feedback
Contact form owner
Help Forms improve
Report