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

Please check out the given instruction that I received to do the assessment. I can provide you that link to go on and submit the answers. To assess your coding skills, we would

Java has some bugs in its applets. Java team stated that they have zero tolerance over security features and subsequent editions of Java are managing Bug free environment. Some of

how would I become expert in collection framework

This work assesses the following Outcomes: • Build robust, secure distributed systems using advanced programming techniques Use RMI to build a distributed application accessing

Does Java pass arguments by value or reference? Ans) Pass by value. 1. When passing primitives, it going a copy of the variable to the method. Any change made in the method d

Describe Inner Classes in java? An inner class is a class whose body is described inside another class, referred to as the top-level class. For instance: public class Queue {

I want somebody to help me to create a program in java that helps me to read data from usb logs in windows Project Description: I want a java program that helps me to detect

A NEW Dynamic Website I have the subsequent requirement which needs to be designed in 30 days (Max). 1) Construct a website which is a dynamic, means allow me to change conte

In this lab, you will practice using ArrayLists in two ways.  The first is in the problem domain class Question.java (see the UML diagram shown below) which contains data for trivi