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
Struts framework is an open-source framework for producing the web applications in Java EE, based on MVC-2 architecture. It uses and extends the Java Servlet API. Struts are robust

Project Description: We need same kind of concept with some changes # Change single colors in a particular design. you need to be able to change the color of only the fox or

A framework is made up of the set of classes which permit us to use a library in a best possible way for a particular requirement.

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element. 1. Using  an  elemen

Java developer with spring framework prerequisite from anywhere Let me know that you have proven experience in java with spring frame work. Send some sample data and provide inf

I need Java coding Need to develop a website. Require Java coder's urgently. Skills required: HTML, Graphic Design, Java, PHP, Website Design

1) Around : org.aopalliance.intercept.MethodInterceptor 2) Before : org.springframework.aop.BeforeAdvice 3)  After : org.springframework.aop.AfterReturningAdvice 4) Throws

Project Description: I need Team speak 3 client for Nokia Symbian platform. Project for Nokia E72, but should work on all Java/Symbian mobiles. Feature list should include

for $9.95 per month, 10 hours of access are provided.Additional hours are $2.00 per hour

how to write aprogramm that calculates gross pay, taxes, and net pay for both hourly and commission employees. It will then display those results to the screen