I have this program which can make some singular nouns plural (I know I'm missing a lot, but that's aside the point). When I enter in a word such as "man-of-war" it returns as "mans-of-war" instead of "men-of-war". How do I fix this? My code can already make man to men, just not in the case I mentioned. Also for this program every compound word will have the dash, it is simply for practice.
public class LanguageUtils {
static boolean checkException(String noun){
String[] exceptions = {"fish", "fox", "deer", "moose", "sheep", "cattle","pants","scissors"};
for(int i=0;i<exceptions.length;i++) {
if(exceptions[i].equals(noun))
return true;
}
return false;
}
static boolean EnglishConsonant(char ch) {
switch (Character.toLowerCase(ch)) {
case 'a': case 'e': case 'i': case 'o': case 'u':
return false;
default:
return true;
}
}
static String makePlural (String noun){
String pluralWord = "";
int length = noun.length();
String strippedWord = noun.substring(0, noun.length()-1);
char lastLetter = noun.charAt(noun.length()-1);
if(noun.contains("-")){
String nounsaver = noun.substring(noun.indexOf('-'), noun.length());
pluralWord = noun.substring(0,noun.indexOf('-')) + "s" + nounsaver;
}
else{
switch (lastLetter){
case 's':
case 'x':
case 'z':
if(noun.equals("ox")){
pluralWord = noun + "en";
break;
}
else{
pluralWord = noun + "es";
break;
}
case 'o':
if(EnglishConsonant(noun.charAt(noun.length()-2))){
pluralWord = strippedWord + "oes";
break;
}
case 'e':
char f = noun.charAt(noun.length()-2);
String prec = noun.substring(0, noun.length()-2);
if(f == 'f'){
pluralWord = prec + "ves";
break;
}
if(noun.equals("goose")){
pluralWord = "geese";
break;
}
else{
pluralWord = noun + "s";
break;
}
case 'h':
if ((noun.charAt(noun.length()-2)== 'c') || (noun.charAt(noun.length()-2)== 's')) {
pluralWord = noun + "es";
break;
}
case 'f':
if (EnglishConsonant(noun.charAt(noun.length()-2))) {
pluralWord = strippedWord + "ves";
break;
}
case 'y':
if (EnglishConsonant(noun.charAt(noun.length()-2))) {
pluralWord = strippedWord + "ies";
break;
}
default:
if(noun.equals("foot")){
pluralWord = "feet";
break;
}
if(noun.endsWith("man")){
pluralWord = noun.substring(0, noun.length()-3)+"men";
break;
}
else{
pluralWord = noun + "s";
break;
}
}
}
if (length == 1){
pluralWord = noun + "'s";
}
if(checkException(noun)){
pluralWord = noun;
}
return pluralWord;
}
}
When dealing with a compound word, if you need to pluralize a part, call a function designed to do just that: makePlural.
If you have - then break the words and call the makePlural for those words again.
You can use String#replace:
if (noun.contains("man")) {
pluralWord = noun.replace("man", "men");
break;
}
Related
The program ask for a month and it could be a string or int. In the isDigitsOrSpecial method, it works and it has the same format in my method isString. The difference is that when I want to enter the month in a string way (ex.january), it will ask me twice. So, I don't know what to do. I tried a lot of ways but it doesn't work. Do you have any suggestions?
Here's my full code. You can try to run it, and see the problem where you have to input twice the name of the month in a string way.
I would really appreciate any of your suggestions.
package Electronic_payment_process;
import java.util.InputMismatchException;
import java.util.Scanner;
public class practice {
static String s;
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
float current = 0, recent = 0, difference, multiply;
String month, recents, currents = null;
System.out.println("The month could be a number or a name.");
System.out.println("Example: (01-12) or (JAN – dec)");
// for the validation of due month user’s input
do {
System.out.print("\nEnter a month: ");
month = scan.next();
if (isDigitsOrSpecial(month)) {
System.out.print("proceed");
break;
} else if (isString(month)) {
System.out.print("proceed");
break;
}
} while (true);
// for the validation of current meter reading
do {
System.out.print("\nEnter current reading: ");
try {
current = scan.nextFloat();
System.out.println("proceed");
currents = String.format("%.2f", current);
if (current <= 0) {
System.out.println("Invalid input");
}
} catch (InputMismatchException a) {
System.out.println("Must enter a number");
scan.next();
}
} while (current <= 0);
// for the validation of recent meter reading
do {
System.out.print("Enter recent reading: ");
try {
recent = scan.nextFloat();
if (recent < current) {
System.out.println("proceed");
recents = String.format("%.2f", recent);
break;
} else {
System.out.println("recent must be less than current");
}
} catch (InputMismatchException a) {
System.out.println("Must enter a number");
scan.next();
}
} while (true);
difference = current - recent;
multiply = difference * 50;
System.out.println("====================================================================================");
System.out.println("MONTH " + " RECENT " + "CURRENT " + "TOTAL USAGE " + "Price per unit " + "TOTAL AMOUNT ");
System.out.println((s + (" ") + recents + (" kW") + (" ") + currents + (" kW") + (" ") + difference + (" ") + ("50php") + (" ") + multiply));
}
public static boolean isDigitsOrSpecial(String month) {
Scanner scan = new Scanner(System.in);
if (month != null) {
for (char ch : month.toCharArray()) {
if (Character.isLetter(ch)) {
return false;
}
}
}
int we = Integer.parseInt(month);
s = Integer.toString(we);
if (null == month) {
s = scan.nextLine();
} else switch (we) {
case 01:
s = "January";
break;
case 02:
s = "February";
break;
case 03:
s = "March";
break;
case 04:
s = "April";
break;
case 05:
s = "May";
break;
case 06:
s = "June";
break;
case 07:
s = "July";
break;
case 8:
s = "August";
break;
case 9:
s = "September";
break;
case 10:
s = "October";
break;
case 11:
s = "November";
break;
case 12:
s = "December";
break;
default:
System.out.println("You have entered an invalid number of month");
}
return true;
}
public static boolean isString(String month) {
Scanner scan = new Scanner(System.in);
if (null != month) {
char[] chars = month.toCharArray();
s = scan.nextLine();
for (char c : chars) {
if (!Character.isLetter(c)) {
return false;
}
}
}
if (!(month.length() >= 3)) {
System.out.println("Name of month must be at least 3 letters.Please try again");
return false;
} else if (month.startsWith("jan") || month.startsWith("JAN") || month.startsWith("Jan")) {
s = "January";
}
return true;
}
}
I see we have added additional scanner statements inside isDigit or isString methods. I have removed them and it looks good to me.
public static boolean isDigitsOrSpecial(String month) {
if (month != null) {
for (char ch : month.toCharArray()) {
if (Character.isLetter(ch)) {
return false;
}
}
}
int we = Integer.parseInt(month);
switch (we) {
case 01:
s = "January";
break;
case 02:
s = "February";
break;
case 03:
s = "March";
break;
case 04:
s = "April";
break;
case 05:
s = "May";
break;
case 06:
s = "June";
break;
case 07:
s = "July";
break;
case 8:
s = "August";
break;
case 9:
s = "September";
break;
case 10:
s = "October";
break;
case 11:
s = "November";
break;
case 12:
s = "December";
break;
default:
System.out.println("You have entered an invalid number of month");
return false;
}
return true;
}
public static boolean isString(String month)
{
if (null != month) {
char[] chars = month.toCharArray();
for (char c : chars) {
if (!Character.isLetter(c)) {
return false;
}
}
}
if (!(month.length() >= 3)) {
System.out.println("Name of month must be at least 3 letters.Please try again");
return false;
}
return true;
}
Im trying to replace each letter with a digit using the international standard letter/number mapping. I got my output to run correctly however, how do get the dashes in the phone number to appear automatically in the output? For example, if I enter 1800Flowers it prints out as 18003569377. How do I get it to print out as 1-800-3569377 without using regular expressions?
import java.util.Scanner;
public class PhoneKeypad {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//while loop keeps the program running until the user enters quit
while (true) {
System.out.println("\nEnter a phone number or quit to exit:");
String phoneNumber = input.next();
if (phoneNumber.equalsIgnoreCase("quit")) {
System.out.print("\nProgrammed by me");
return;
}
//checks if the phone number entered is at least 8 digits
if (phoneNumber.length() < 8) {
System.out.println("Invalid Phone Number");
} else {
System.out.println(getNumber(phoneNumber));
}
}
}
//method converts all letters in the phone number to digits
public static String getNumber(String phoneNumber) {
int keypadNum = 0;
for (int i = 0; i < phoneNumber.length(); i++) {
char letter = phoneNumber.charAt(i);
if (Character.isAlphabetic(letter)) {
letter = Character.toUpperCase(letter);
switch (letter) {
case 'A':
case 'B':
case 'C':
keypadNum = 2;
break;
case 'D':
case 'E':
case 'F':
keypadNum = 3;
break;
case 'G':
case 'H':
case 'I':
keypadNum = 4;
break;
case 'J':
case 'K':
case 'L':
keypadNum = 5;
break;
case 'M':
case 'N':
case 'O':
keypadNum = 6;
break;
case 'P':
case 'Q':
case 'R':
case 'S':
keypadNum = 7;
break;
case 'T':
case 'U':
case 'V':
keypadNum = 8;
break;
case 'W':
case 'X':
case 'Y':
case 'Z':
keypadNum = 9;
break;
default:
System.out.println("Invalid phone number");
}
phoneNumber = phoneNumber.substring(0, i) + keypadNum + phoneNumber.substring(i + 1);
}
}
return phoneNumber;
}
}
Expected Output:
You could use a regular expression with String.replaceAll. Remove the leading one, group the first three digits, the second three digits and the final group of digits. Something like
public static String formatNumber(String phoneNumber) {
if (phoneNumber.startsWith("1")) {
phoneNumber = phoneNumber.substring(1);
}
return phoneNumber.replaceAll("(\\d{3})(\\d{3})(\\d+)", "1-$1-$2-$3");
}
or
public static String formatNumber(String phoneNumber) {
return phoneNumber.replaceAll("1(\\d{3})(\\d{3})(\\d+)", "1-$1-$2-$3");
}
And then call it like
System.out.println(formatNumber(getNumber(phoneNumber)));
I ran it with 1800flowers and got (as expected)
1-800-356-9377
or without regular expressions like
public static String formatNumber(String phoneNumber) {
if (phoneNumber.startsWith("1")) {
phoneNumber = phoneNumber.substring(1);
}
return "1-".concat(phoneNumber.substring(0, 3)) //
.concat("-").concat(phoneNumber.substring(3, 6)) //
.concat("-").concat(phoneNumber.substring(6));
}
Before calling formatNumber, you can remove the dashes to normalize it with something like
public static String removeDashes(String phoneNumber) {
StringBuilder sb = new StringBuilder();
for (char ch : phoneNumber.toCharArray()) {
if (ch != '-') {
sb.append(ch);
}
}
return sb.toString();
}
Then
System.out.println(formatNumber(removeDashes(getNumber(phoneNumber))));
I have this homework assignment for this class I'm retaking, the problem I'm running into is that I'm over-thinking the solution. I have to create a program that converts a four digit number to words.
(Example: 1134 becomes "One One Three Four")
I have a basic code, but it's bulky and ugly. I'm also only allowed to use basic if and switch statements, we have to use a switch statement as well.
Am I over thinking this? I can't figure out how to make this code shorter and I only want to use one switch statement without a while loop. Is it even possible or is this as short as it gets.
Here's my code.
import java.util.Scanner;
public class NumberToWords {
public static void main(String[] args) {
//Set up scanner.
Scanner kb = new Scanner(System.in);
//Ask for a 4 digit integer.
System.out.println("Enter a 4 digit number.");
//Store 4 digit number into a variable
int number = kb.nextInt();
//Seperate number into digits.
int digit4 = number%10;
number = number/10;
int digit3 = number%10;
number = number/10;
int digit2 = number%10;
number = number/10;
int digit1 = number%10;
number = number/10;
//Set up a switch statement to read through the number.
switch (digit1)
{
case 1: System.out.print("One ");break;
case 2: System.out.print("Two "); break;
case 3: System.out.print("Three "); break;
case 4: System.out.print("Four "); break;
case 5: System.out.print("Five "); break;
case 6: System.out.print("Six "); break;
case 7: System.out.print("Seven "); break;
case 8: System.out.print("Eight "); break;
case 9: System.out.print("Nine "); break;
case 0: System.out.print("Zero "); break;
default: System.out.print(""); break;
}
switch (digit2)
{
case 1: System.out.print("One ");break;
case 2: System.out.print("Two "); break;
case 3: System.out.print("Three "); break;
case 4: System.out.print("Four "); break;
case 5: System.out.print("Five "); break;
case 6: System.out.print("Six "); break;
case 7: System.out.print("Seven "); break;
case 8: System.out.print("Eight "); break;
case 9: System.out.print("Nine "); break;
case 0: System.out.print("Zero "); break;
default: System.out.print(""); break;
}
switch (digit3)
{
case 1: System.out.print("One ");break;
case 2: System.out.print("Two "); break;
case 3: System.out.print("Three "); break;
case 4: System.out.print("Four "); break;
case 5: System.out.print("Five "); break;
case 6: System.out.print("Six "); break;
case 7: System.out.print("Seven "); break;
case 8: System.out.print("Eight "); break;
case 9: System.out.print("Nine "); break;
case 0: System.out.print("Zero "); break;
default: System.out.print(""); break;
}
switch (digit4)
{
case 1: System.out.print("One ");break;
case 2: System.out.print("Two "); break;
case 3: System.out.print("Three "); break;
case 4: System.out.print("Four "); break;
case 5: System.out.print("Five "); break;
case 6: System.out.print("Six "); break;
case 7: System.out.print("Seven "); break;
case 8: System.out.print("Eight "); break;
case 9: System.out.print("Nine "); break;
case 0: System.out.print("Zero "); break;
default: System.out.print(""); break;
}
}
}
First, write a method to convert a single digit to a word. Something like,
private static String digitToWord(char ch) {
switch(ch) {
case '0': return "Zero";
case '1': return "One";
case '2': return "Two";
case '3': return "Three";
case '4': return "Four";
case '5': return "Five";
case '6': return "Six";
case '7': return "Seven";
case '8': return "Eight";
case '9': return "Nine";
}
return "Unknown (" + ch + ")";
}
Then you can get the String value of your int. And get the four characters from that String. Something like,
int number = kb.nextInt();
String str = String.format("%04d", number);
StringBuilder sb = new StringBuilder();
sb.append(digitToWord(str.charAt(0)).append(' ');
sb.append(digitToWord(str.charAt(1)).append(' ');
sb.append(digitToWord(str.charAt(2)).append(' ');
sb.append(digitToWord(str.charAt(3));
System.out.println(sb.toString());
Or,
String str = String.format("%04d", kb.nextInt());
System.out.printf("%s %s %s %s%n", digitToWord(str.charAt(0)),
digitToWord(str.charAt(1)), digitToWord(str.charAt(2)),
digitToWord(str.charAt(3)));
this might help
public class NumbersInWords {
public static void main(String[] args) {
String number = "153";
int numLength = number.length();
System.out.println(numLength);
String numberToWord = "";
for (int j = 0; j < numLength; j++) {
switch (number.charAt(j)) {
case '1': {
numberToWord = numberToWord + "one";
break;
}
case '2': {
numberToWord = numberToWord + "two";
break;
}
case '3': {
numberToWord = numberToWord + "three";
break;
}
case '4': {
numberToWord = numberToWord + "four";
break;
}
case '5': {
numberToWord = numberToWord + "five";
break;
}
case '6': {
numberToWord = numberToWord + "six";
break;
}
case '7': {
numberToWord = numberToWord + "seven";
break;
}
case '8': {
numberToWord = numberToWord + "eight";
break;
}
case '9': {
numberToWord = numberToWord + "nine";
break;
}
default: {
numberToWord = numberToWord + "zero";
}
}
}
System.out.println(numberToWord);
}
}
Yeah, you can simply do that operation in a for loop, executed 4 times. The division and mod is consistent at 10. Something like
For i = 0; i < 4; i++
Number/10%10
Condition to check number
Save number in array or print
Copy pasting code and names with numbers should be a red flag to use a loop (or something more is worng).
private static final String[] DIGIT_NAMES = new String[] {"Zero ", "One ", "Two ",
"Three ", "Four ", "Five ", "Six ", "Seven ", "Eight ", "Nine "};
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int number = 0;
do {
// ask for a 4 digit integer
System.out.println("Enter a 4 digit number: ");
try {
number = input.nextInt();
} catch (InputMismatchException ignore) {
System.out.println("Recieved non integer input");
input.next(); // clear bad input
}
} while (number < 1000 || number > 9999);
String result = "";
while (number != 0) {
result = DIGIT_NAMES[number % 10] + result;
number = number / 10;
}
System.out.println(result);
input.close();
}
Hello StackOverflow community, I've just begun to work with arrays and I was wondering how I can make the switch statement work with the values below. It's really irritating that it won't work considering the only error is constant expression required:
import java.lang.Character;
public class Ass11a {
public static char[] vowel = new char[4];
public static char[] consonant = new char[20];
public static char[] number = new char[9];
public static char[] punctuation = new char[10];
public static void main(String[] args) {
EasyReader console = new EasyReader();
System.out.print("Enter a character: ");
char input = console.readChar();
Character.toLowerCase(input);
vowel[0] = 'a';
vowel[1] = 'e';
vowel[2] = 'i';
vowel[3] = 'o';
vowel[4] = 'u';
consonant[0] = 'q';
consonant[1] = 'w';
consonant[2] = 'r';
consonant[3] = 't';
consonant[4] = 'y';
consonant[5] = 'p';
consonant[6] = 's';
consonant[7] = 'd';
consonant[8] = 'f';
consonant[9] = 'g';
consonant[10] = 'h';
consonant[11] = 'j';
consonant[12] = 'k';
consonant[13] = 'l';
consonant[14] = 'z';
consonant[15] = 'x';
consonant[16] = 'c';
consonant[17] = 'v';
consonant[18] = 'b';
consonant[19] = 'n';
consonant[20] = 'm';
number[0] = '1';
number[1] = '2';
number[2] = '3';
number[3] = '4';
number[4] = '5';
number[5] = '6';
number[6] = '7';
number[7] = '8';
number[8] = '9';
number[9] = '0';
punctuation[0] = '.';
punctuation[1] = ',';
punctuation[2] = '?';
punctuation[3] = '!';
punctuation[4] = ';';
punctuation[5] = ':';
punctuation[6] = '"';
punctuation[7] = '\'';
punctuation[8] = '(';
punctuation[9] = ')';
punctuation[10] = '-';
switch(input)
{
case vowel[0]:case vowel[1]:case vowel[2]:case vowel[3]:case vowel[4]:
System.out.println("Vowel");
break;
case consonant[0]:case consonant[1]:case consonant[2]:case consonant[3]:
case consonant[4]:case consonant[5]:case consonant[6]:case consonant[7]:
case consonant[8]:case consonant[9]:case consonant[10]:case consonant[11]:
case consonant[12]:case consonant[13]:case consonant[14]:case consonant[15]:
case consonant[16]:case consonant[17]:case consonant[18]:case consonant[19]:
case consonant[20]:
System.out.println("Consonant");
break;
case number[0]:case number[1]:case number[2]:case number[3]:case number[4]:
case number[5]:case number[6]:case number[7]:case number[8]:case number[9]:
System.out.println("Number");
break;
case punctuation[0]:case punctuation[1]:case punctuation[2]:case punctuation[3]:
case punctuation[4]:case punctuation[5]:case punctuation[6]:case punctuation[7]:
case punctuation[8]:case punctuation[9]:case punctuation[10]:
System.out.println("Punctuation");
break;
default:
System.out.println("Other");
break;
}
}
}
You could use an enum like this
public enum Vowels {
A,E,I,O,U;
static boolean isVowel(char c) {
switch (c) {
case 'A': case 'a':
case 'E': case 'e':
case 'I': case 'i':
case 'O': case 'o':
case 'U': case 'u': return true;
}
return false;
}
static Vowels getVowel(char c) {
switch (c) {
case 'A': case 'a': return A;
case 'E': case 'e': return E;
case 'I': case 'i': return I;
case 'O': case 'o': return O;
case 'U': case 'u': return U;
}
return null;
}
}
and use it like
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
while (console.hasNextLine()) {
String input = console.nextLine();
for (Character ch : input.toCharArray()) {
if (Vowels.isVowel(ch)) {
System.out.println(ch + " is vowel");
}
}
}
}
I am trying to change this from an input box into a Scanner class, but i am having trouble doing so.
Its a program that takes words and makes them into a phone number here is the code that does so. Any help would be greatly appreciated and if there is something that i can do in return i would gladly do so.
// declare imports
import java.util.Scanner;
import javax.swing.JOptionPane;
import java.util.*;
public class Telephone {
public static void main(String[] args) {
// ask for the phone number (in letters)
char letter;
String inputMessage = "Please enter the number in Letters " + "or enter '#' to stop the program ";
String inputString = JOptionPane.showInputDialog(inputMessage);
String outputString = "";
String outputMessage = "";
int digit = 0;
int x = 0;
for (int i = 0; i < inputString.length(); i++)
System.out.print(inputString.charAt(x)); {
while (inputString.charAt(x) != '#') {
letter = Character.toUpperCase(inputString.charAt(x));
x++;
// make sure its not a number
if (letter >= 'a' && letter <= 'z') if (letter >= 'A' && letter <= 'Z') {
digit++;
switch (letter) {
case 'A':
case 'B':
case 'C':
outputString += "2";
break;
case 'D':
case 'E':
case 'F':
outputString += "3";
break;
case 'G':
case 'H':
case 'I':
outputString += "4";
break;
case 'J':
case 'K':
case 'L':
outputString += "5";
break;
case 'M':
case 'N':
case 'O':
outputString += "6";
break;
case 'P':
case 'Q':
case 'R':
case 'S':
outputString += "7";
break;
case 'T':
case 'U':
case 'V':
outputString += "8";
break;
case 'W':
case 'X':
case 'Y':
case 'Z':
outputString += "9";
}
if (digit == 7) {
break;
}
if (digit == 3) {
outputString += "-";
}
}
inputMessage = "Enter another set of telephone letters";
}
JOptionPane.showMessageDialog(null, outputString, "Telephone Program", JOptionPane.PLAIN_MESSAGE);
}
Modify the line where you show the JOptionPane as follows,
//String inputString = JOptionPane.showInputDialog(inputMessage);
System.out.println(inputMessage);
Scanner sc = new Scanner(System.in);
String inputString = sc.nextLine();
so you could do the following,
package test;
import java.util.Scanner;
public class Telephone {
public static void main(String[] args) {
// ask for the phone number (in letters)
char letter;
String inputMessage = "Please enter the number in Letters " + "or enter '#' to stop the program ";
// String inputString = JOptionPane.showInputDialog(inputMessage);
System.out.println(inputMessage);
Scanner sc = new Scanner(System.in);
String inputString = sc.nextLine();
String outputString = "";
String outputMessage = "";
int digit = 0;
int x = 0;
for (int i = 0; i < inputString.length(); i++) {
System.out.print(inputString.charAt(x));
}
while (inputString != null && inputString.trim().length() > 0 && inputString.charAt(x) != '#') {
letter = Character.toUpperCase(inputString.charAt(x));
x++;
// make sure its not a number
// if (letter >= 'a' && letter <= 'z') {
if (x >= inputString.length()) {
x = 0;
System.out.println("\n" + outputString);
// JOptionPane.showMessageDialog(null, outputString, "Telephone Program", JOptionPane.PLAIN_MESSAGE);
// inputString = JOptionPane.showInputDialog(inputMessage);
System.out.println(inputMessage);
inputString = sc.nextLine();
} else if (letter >= 'A' && letter <= 'Z') {
digit++;
switch (letter) {
case 'A':
case 'B':
case 'C':
outputString += "2";
break;
case 'D':
case 'E':
case 'F':
outputString += "3";
break;
case 'G':
case 'H':
case 'I':
outputString += "4";
break;
case 'J':
case 'K':
case 'L':
outputString += "5";
break;
case 'M':
case 'N':
case 'O':
outputString += "6";
break;
case 'P':
case 'Q':
case 'R':
case 'S':
outputString += "7";
break;
case 'T':
case 'U':
case 'V':
outputString += "8";
break;
case 'W':
case 'X':
case 'Y':
case 'Z':
outputString += "9";
}
if (digit == 7) {
break;
}
if (digit == 3) {
outputString += "-";
}
}
// }
inputMessage = "Enter another set of telephone letters";
}
System.out.println("\n" + outputString);
// JOptionPane.showMessageDialog(null, outputString, "Telephone Program", JOptionPane.PLAIN_MESSAGE);
}
}