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
Project Description: Modules of software: 1 - Serial RS232 comm port comunication 2 - NanoHTTPD serving some processed pages 3 - System tray application to indicate sta

what are cookies?

Suppose that: A is the set of characters in the string "pellet"; B is the set of characters in the string "teller"; C is the set of characters in the string "pertinent"; a

Prepare an android keyboard Project Description: I want to prepare an android keyboard that have many features.( i will describe later) I want the full app and a trial ver

What is JavaServer Faces event and listener model? Ans) A mechanism for verifying how events emitted by JavaServer Faces UI components are handled. This model is based on the Ja

You are part of a team creating a system to keep track of computer science books that a publisher is producing. Create a UML class diagram for a "computer science book". You must h

Explain the term- Strings A string is generally considered to be a sequence of characters stored in memory and accessible as a unit. Strings in java are signified as objects

Find representative skyline points in to two dimensional data Project Description: Run skyline algorithm run representative skyline algorithm up to skyline algorithm (Affi

In this project you need to write a program called "ECC.java"to implement Elliptic Curve encryption/decryption. Specifically, your program will read parameters, plaintext and ciph