Program for convert temprature and length, JAVA Programming

Public class ConversionProgram {

 public void start() { 

  String userChoice = askConversionCategory();

  while (userChoice.equals("1") || userChoice.equals("2") || Page 2 of 12

    userChoice.equals("3") || userChoice.equals("4") || 

    userChoice.equals("5") || userChoice.equals("6")) { 

   processConversionRequest(userChoice);

   userChoice = askConversionCategory();

  }

  System.out.println("Good Bye!");

 }

 private String askConversionCategory() {

  System.out.println();

  String prompt = "Select a conversion category, enter \n" +

       "\t\"1\" to convert Length, \n" +

       "\t\"2\" to convert Temperature, \n" +

       "\t\"3\" to convert Initials, \n" +

       "\t\"4\" to convert Date, \n" +

       "\t\"5\" to convert Time, \n" +

       "\t\"6\" to convert Pig Latin, and\n" +

       "\tany other key to quit: ";

  String category = acquireInput(prompt);

  return category; 

 }

 

 private void processConversionRequest(String userChoice) {

  if (userChoice.equals("1")) {

   convertLength();

  } else if (userChoice.equals("2")) {

   convertTemperature();

  } else if (userChoice.equals("3")) {

   convertInitials();

  } else if (userChoice.equals("4")) {

   convertDate();

  } else if (userChoice.equals("5")) {

   convertTime();

  } else if (userChoice.equals("6")) {

   convertPigLatin();

  }

 }

 private void convertLength(){

 }

 private void convertTemperature(){

 }

 private void convertInitials(){

 }

 private void convertDate(){

 }

 private void convertTime(){

 }

 private void convertPigLatin(){

 }

 private String acquireInput(String prompt){

  System.out.print(prompt);

  String input = Keyboard.readInput().trim();

  return input;

 } 

}

Posted Date: 2/22/2013 4:38:14 AM | Location : United States







Related Discussions:- Program for convert temprature and length, Assignment Help, Ask Question on Program for convert temprature and length, Get Answer, Expert's Help, Program for convert temprature and length Discussions

Write discussion on Program for convert temprature and length
Your posts are moderated
Related Questions
send me the java code for minimum shelf program

Give the example of mixing data type in java? Mixing Data Types Order can form a difference while data types are mixed. For example, 1 / 2 * 3.5 = 0.0 3.5 * 1 / 2 = 1.75 3.5 /


What is the String Concatenation + Operator is employed to concatenate strings - System.out.pritln ("Hello" + "World") will print Hello World on console String concatenat

Explain java flow control ? if else else if while for do while switch case break continue goto is a reserved word.

Why hub is used in networks? Hub is networking equipment and a device that connects various computers to form a network. In a network the NIC translates the message within elec

Write a program to find the area under the curve y = f(x) between x = a and x = b, integrate y = f(x) between the limits of a and b. The area under a curve between two points can b

I am having an combox box and values are retrieved from the database having inputs and labels i want to created the dynamic form accroding to user input on combox box values

An Action Class performs a role of an adapter among the contents of an incoming HTTP request and the corresponding business logic that should be implemented to process this request

Differentiation between an Applet and an Application ?