Home Answers Viewqa Java-Beginners java programming code

 
 


Louis Brown
java programming code
1 Answer(s)      4 years and a month ago
Posted in : Java Beginners

View Answers

May 14, 2009 at 10:35 AM


Hi Friend,

Try the following code:

import java.util.*;
import javax.swing.JOptionPane;

class TelephoneDigit{
public static void main(String args[]){

String input= JOptionPane.showInputDialog(null, "Input character in UpperCase :");
char ch = input.charAt(0) ;
if(ch=='A'||ch=='B'||ch=='C'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 2");
}
if(ch=='D'||ch=='E'||ch=='F'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 3");
}
if(ch=='G'||ch=='H'||ch=='I'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 4");
}
if(ch=='J'||ch=='K'||ch=='L'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 5");
}
if(ch=='M'||ch=='N'||ch=='O'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 6");
}
if(ch=='P'||ch=='R'||ch=='S'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 7");
}
if(ch=='T'||ch=='U'||ch=='V'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 8");
}
if(ch=='W'||ch=='X'||ch=='Y'){
JOptionPane.showMessageDialog(null,"Corresponding digit is = 9");
}
if(ch=='Q'||ch=='Z'){
JOptionPane.showMessageDialog(null,"No digit corresponding to this character.");
}
}
}
Thanks









Related Pages:
java programming code
java programming code  strong textHi I need the java code for the folllowing java output can you help me?The user inputs for the program are in inverted commas thank you. Blockquote HARDWARE ITEMS CODE DESCRIPTION UNIT
programming code - Java Beginners
programming code  program code for converting temperature from celsius to fahrenheit or fahrenheit to celsius using if-then-else to decide if celsius or fahrenheit is entered   Hi Friend, Try the following code. I
Programming
Programming  how to save output of java file in .txt format?  ...; bracket to direct the output to a text file. Here is the example: C:>java...(); } } Is this code is beneficial for you. For further issues feel free to ask
Java Programming Code HELP
Java Programming Code HELP  Hi, sir/madam. I am new here and currently developing a program whereby it can read the Java source file...: String, attribute name = variable name) Below are my source code. Hope
java programming code - Java Beginners
java programming code  I want to write a program that converts temperatures from celsius to fahrenheit and vice versa. It also converts kilometers to miles and vice versa using classes
java programming code - Java Beginners
java programming code  Design and write a Java application that takes as input a single letter and displays the corresponding digit on the telephone...;Hi Friend, Try the following code: import java.util.*; import
java programming
java programming  Hi friends, i need a simple login form source code. in that program i have two labels,two text fields and two buttons namely ok and cancel buttons. how to write for that one using netbeans without database
java programming
java programming  How can be uesd in graphiclly view for user inter (x,y) cordinate and show the output shart point to end point. java code...); } } For the above code, you need jfreechart api
java programming
java programming  How can be uesd in graphiclly view for user inter (x,y) cordinate and show the output shart point to end point. java code...); } } For the above code, you need jfreechart api
java programming
java programming  How can be uesd in graphiclly view for user inter (x,y) cordinate and show the output shart point to end point. java code...); } } For the above code, you need jfreechart api
Java programming
Java programming  To make a fraction to a representation base 16 (i.e. hexadecimal) we can multiply it by 16, and the resultant integer part... but now base 16. Your code should work for any length input array, not just one
java programming
java programming  WAP to accept 10 strings from the user and find out the string with maximum length and print the same.   Here is a code that accepts 10 strings from the string and stored into array and then find
java programming
java programming  WAP to find the longest word from a user given string.   The given code finds the longest word from the string. import java.util.*; class LongestWord { Scanner input=new Scanner(System.in
Programming
Java NotesProgramming Here are some tips on making programming student... of the basic elements of Extreme Programming (a much hyped, but good... and you will be rewarded. Eg, to get it to indent your code, match braces
FTP Programming in Java tutorials with example code
FTP Programming in Java In this tutorial series of Java programming we are now continuing with the FTP Programming in Java. With the help of these tutorials... Programming in Java: What is FTP (File Transfer Protocol)? What is Anonymous FTP
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 9.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook..., abs, and ln. See the source code file for full details. The Expr class uses
java programming problem - JDBC
java programming problem  Hi, Request you to provide the source code in Java for the following programming problem : upload .csv file data into oracle database. please send the solution to raichallp@yahoo.in
programming
Java Constructor programming for single and double constructor  write a program which have no argument constructor ,single parameter constructor constructor,double parameter constor,and the now when we create a object
Java File Programming
Java File Programming articles and example code In this section we will teach you about file programming in your Java applications. Java File Programming... program. Java programming language provides many API for easy file management. Java
java programming - Java Beginners
java programming  asking for java code, solving three unknowns in three equations..I need the thx ahed
java programming - Java Beginners
java programming  in Java, using"classes", write a code with the name and ages of three people
Java Programming, Solution to Programming Exercise
. Some languages use predicates in generic programming. Java doesn't... Solution for Programming Exercise 12.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Solution to Programming Exercise
is not 1, that is, that either die1 is not 1 or die2 is not 1. In java code... Solution for Programming Exercise 3.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 6.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... the checkerboard. In that exercise, the code for drawing the board was in the paint
Java Programming: Solution to Programming Exercise
;. Putting this all together into syntactically correct Java code, the algorithm... Solution for Programming Exercise 3.5 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
java programming - Java Beginners
java programming  i'm asking for the java code for adding , viewing... a code..help me plzz  Hi Friend, Please go through the following links: http://www.roseindia.net/java/example/java/swing/add_edit_and_delete
Java Programming: Solution to Programming Exercise
), but str.charAt(i-1) doesn't exist if i is 0. Let's look at Java code... Solution for Programming Exercise 4.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 7.6 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... a Timer. Add a Timer to the original source code, StopWatch.java, to display
java programming - Java Beginners
java programming  asking for the java code for solving mathematical equation with two unknown .thnx ahead..  Hi Friend, Please clarify your question. Which mathematical equations you want to solve? Thanks
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 10.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... files. Note that multiple files can be specified, as in "java LineCounts file1.txt
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 5.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook. Exercise 5.2: A common programming task is computing statistics of a set
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 3.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook.... The source code for that example is CountDivisors.java. You might need some hints
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 3.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... something. With this modification, the code becomes: for ( i = 0; i
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 4.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook...); This is the code that is used in the main() routine of the program to do
Java Programming, Solution to Programming Exercise
Solution for Programming Exercise 12.6 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook..., COS = 1, // Code numbers for each TAN = 2, ABS = 3
Java Programming, Solution to Programming Exercise
Solution for Programming Exercise 12.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... in Java. The mathematical operations on A and B can be computed using methods
Java Programming: Solution to Programming Exercise
easily into Java code: boolean used[]; // used[i] will be true... Solution for Programming Exercise 8.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 3.6 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook...: <applet code="SlidingCheckerboard.class" width=160 height=160>
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 6.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook...(). All the other programming (that is, rolling the dice and interacting
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 6.8 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... in Section 6.6. You can use the source code for that game, HighLowGUI.java
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 6.6 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... Section 6.5. You can start with the existing source code, from the file
Java Programming, Solution to Programming Exercise
Solution for Programming Exercise 12.3 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook. Exercise 12.3: The fact that Java has a HashMap class means that no Java
java programming - Java Beginners
java programming  im asking for the code of adding , viewing ,delete... the following links: http://www.roseindia.net/java/example/java/swing/add_edit_and_delete_employee_inf.shtml http://www.roseindia.net/java/example/java/swing
programming
programming  if we write a code for nearest no divisible by 5 example: given no divisible by 5 nearest no 12... for the waiting of ur answer ur friend`print("code sample
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 9.2 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... be stored in an int variable. Java has a standard class, java.math.BigInteger
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 5.1 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... that guarantee, because the code that I write in the PairOfDice class is the only
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 5.5 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... wins. Two notes on programming: At any point in the subroutine, as soon
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 6.5 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook...: Sorry, but your browser doesn't support Java. Discussion
Java Programming: Solution to Programming Exercise
easily into Java code. One more note: In my implementation of the subroutine... Solution for Programming Exercise 4.6 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook
Java Programming: Solution to Programming Exercise
Solution for Programming Exercise 8.4 THIS PAGE DISCUSSES ONE POSSIBLE SOLUTION to the following exercise from this on-line Java textbook... find the source code for this class in the file MovingBall.java. A MovingBall