Start New Discussion within our Software Development Community

Hi everyone,
I'm new to Java and i have a simple question but i don't understand it, can someone help me pls?

In this exercise, we will use the String class to manipulate string variables.
Write a program that reads in two String variables from the user and store in variables
stringOne and stringTwo respectively. Please note that the input from the user should not be limited to single word strings.
Perform the following operations as listed below, in a given sequence:
• Prompt the user for a specified index and display the character in that position for
each string.
• Prompt the user for two characters, i.e. charA and charB, replace every occurrence of
the charA in stringOne with charB. Conversely, replace every occurrence of charB in
stringTwo with charA. MCD3240 Computer Programming Prac 3 – Introduction to Classes and Objects
Developed by the MCD3240 Multi-campus Unit Management Group, 2009 Page 2 of 2
Faculty of Information Technology, Monash University
• Replace both strings with their lowercase equivalent respectively and display both
strings.
• Concatenate both lowercase strings, store the result in stringTwo and display it
For each of the operations listed above, you will need to print the resulting output to screen.
You only need to use the methods from the String class to complete these operations. You
may assume that the input has been validated

Thanks.

This article has been dead for over six months. Start a new discussion instead.