- Joined
- Aug 5, 2008
- Messages
- 2
- Reaction score
- 0
import javax.swing.JOptionPane;
import java.io.*;
import java.util.*;
import java.lang.*;
public class lowercasesandupper {
public static void main(String[]args)
{
String message;
int i;
String letter;
char let;
message=JOptionPane.showInputDialog("Enter the string: ");
message.length();
for(i=0;i<=message.length();i++)
{
letter = message.substring(i,i+1);
//message.charAt(i);
if(letter == message.toUpperCase())
{
System.out.println("Convert: "+letter.toLowerCase());
}
else
{
System.out.println("Convert: "+letter.toUpperCase());
}
}
}
}
/* I've been making this program for almost 3 days but I can't find the right algorithm..I want to convert all lowercase letters in a string to uppercase letters,and vice versa. For example, JIM will be converted to jim or anTHOny will be converted to ANthoNY. what's wrong with my program?*/
import java.io.*;
import java.util.*;
import java.lang.*;
public class lowercasesandupper {
public static void main(String[]args)
{
String message;
int i;
String letter;
char let;
message=JOptionPane.showInputDialog("Enter the string: ");
message.length();
for(i=0;i<=message.length();i++)
{
letter = message.substring(i,i+1);
//message.charAt(i);
if(letter == message.toUpperCase())
{
System.out.println("Convert: "+letter.toLowerCase());
}
else
{
System.out.println("Convert: "+letter.toUpperCase());
}
}
}
}
/* I've been making this program for almost 3 days but I can't find the right algorithm..I want to convert all lowercase letters in a string to uppercase letters,and vice versa. For example, JIM will be converted to jim or anTHOny will be converted to ANthoNY. what's wrong with my program?*/