IBM
Company
Programming
Arrays
Transform string to lowercase alphabet character by replacing each letter with the subsequent character in english alphabet
Read Solution (Total 14)
-
- class Practice{
private void nextChar() {
Scanner sc = new Scanner(System.in);
System.out.println("Enter the string");
String str = sc.nextLine();
String str2 = "";
for (int i = 0; i < str.length(); i++) {
char chr = str.charAt(i);
int ascii = (int) chr;
int b1 = (ascii + 1);
String s = String.valueOf((char) b1);
str2 = str2 + s;
}
System.out.println("The corresponding individual next letters of the given input string is:" + str2.toLowerCase());
}
public static void main(String args[]) {
Practice p = new Practice();
p.nextChar();
}
} - 7 years agoHelpfull: Yes(5) No(0)
- Pls anyone send me ibm previous papers business,java coding test quens
rthota90@gmail.com - 7 years agoHelpfull: Yes(2) No(0)
- import java.util.Scanner;
public class Mehdi
{
public static void main(String[] args)
{
String strUpper,strLower;
Scanner scan=new Scanner(System.in);
System.out.println("enter the word name in Uppercase:");
strLower=scan.nextLine();
strUpper=strLower.toLowerCase();
System.out.println("equivalent to word name in Lowercase:" +strUpper);
}
} - 7 years agoHelpfull: Yes(1) No(2)
- import java.util.Scanner;
class java
{
public static void main(String[] args)
{
int shiftValue=1;String foo;
Scanner scan=new Scanner(System.in);
System.out.println("enter string");
foo=scan.nextLine();
String bar="";
for(char c: foo.toCharArray())
{
bar+=Character.toString((char)(((c-'a'+shiftValue)%26) +'a'));
}
System.out.println(bar);
}} - 7 years agoHelpfull: Yes(1) No(0)
- I asked to replace each letter with subsequent letter.
- 7 years agoHelpfull: Yes(0) No(0)
- These answers are done by their own or just copy paste..? Becoz I'm having simplest way to do so
- 7 years agoHelpfull: Yes(0) No(0)
- @PRASANTH what is your solution? plz tell
- 7 years agoHelpfull: Yes(0) No(0)
- Can someone provide me round two bussiness communication questions java questions
hemalathasham22@gmail.com - 7 years agoHelpfull: Yes(0) No(0)
- Can someone provide me round two bussiness communication questions java questions.plz send me kshama2623@gmail.com
- 7 years agoHelpfull: Yes(0) No(0)
- Plz send the java coding questions and programs at this id lamba.priyanka09@gmail.com
- 7 years agoHelpfull: Yes(0) No(0)
- import java.util.Scanner;
public class NextCharacterInString {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String str = sc.next();
char[] ch = new char[str.length()];
char ch2[] = new char[ch.length];
for (int i = 0; i < ch.length; i++) {
ch[i] = str.charAt(i);
ch2[i] = (char) (ch[i] + 1);
}
for (int i = 0; i < ch2.length; i++) {
System.out.print(ch2[i]);
}
}
} - 7 years agoHelpfull: Yes(0) No(0)
- 25)4.2,7.2,11.4,6.1,9.1,15.2,3.8,6.8
A:4.2+7.2=11.4
6.1+9.1=15.2
3.8+6.8= 10.6 - 7 years agoHelpfull: Yes(0) No(0)
- String str = "sAnRaJ tOdKaR";
for (int i = 0; i < str.length(); i++) {
if(str.charAt(i)>65 && str.charAt(i)=97 && str.charAt(i) - 7 years agoHelpfull: Yes(0) No(0)
- Please send me ibm previous papers of java nd buiesness communication
- 6 years agoHelpfull: Yes(0) No(0)
IBM Other Question