Forums Register Login

This was a program given as an assignment

+Pie Number of slices to send: Send
write a java program that should change the case of every second character to the upper case and print them
for instance:input:hello world
output should be:hElLo WoRlD
please give the code
10
+Pie Number of slices to send: Send
So you want us to do your assignment for you? Will we get the credit for it as well? Or were you thinking of paying us?
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:So you want us to do your assignment for you? Will we get the credit for it as well? Or were you thinking of paying us?


excuse me.. it was not assigned for me..i saw this on a book..i tried out of curiosity.. i couldnt get..i just asked help so that i can learn.. [DELETED]
+Pie Number of slices to send: Send
 

kiruthigha rajan wrote:write a java program that should change the case of every second character to the upper case and print them
for instance:input:hello world
output should be:hElLo WoRlD
please give the code




FYI... the example shown doesn't capitalize every second character. For the second word, it capitalize everything but the second letter. Never mind. I see now. It is capitalizing every other letter -- and not the second letter of each word.

Also, IMO, this is something that can be simply done via a regular expression. It can still easily be done via regular expressions, but definitely more awkward.

Henry
No more fooling around. Read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 1146 times.
Similar Threads
stand alone
Why is that SCJP costs around Rs5000 to Rs7000 in India and costs 300$(around Rs25000) in Pakistan ?
Java Chess Game I made by my self
chars using the + operator
KB 791
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:00:46.