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
pebble merchant


Kik Messenger is a plan mobile messenger like Skype. It's available on each major smart phone for Android and Iphone. Here is the entire process: Could be able to add multipl

Illustrate the method to print on the GUI Example Code: Taking Input / Output So far, we learned how to print something on console. Now time has come to learn how to print

Java Programming 1. Write a program in Java to find the highest of any five numbers. How do you compile and execute this Java program? 2. Write a program to explain the Exce

How to write a program that converts US dollars into Canadian dollars.The program let the user enter an amount in US dollars and display it equivalent value in Canadian dollars whe

How instant messaging works? Write the steps involved in this process? The Instant Messaging services available permit us to manage a list of people (contacts) that we interact

Project Description: I want a lot of developers to develop modules The basic purpose of this project is to prepare a standard ERP Software Company will be divided into module

n this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color. Fill the other elements in the board, such

Question 1: (a) Describe two reasons driving the termination of processes. (b) Discuss the five main steps the OS would implement once it has decided to create a new proc