Program for convert temprature and length, JAVA Programming

Assignment Help:

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;

 } 

}


Related Discussions:- Program for convert temprature and length

Data structure, consider the file name cars.text each line in the file cont...

consider the file name cars.text each line in the file contains information about a car ( year,company,manufacture,model name,type) 1-read the file 2-add each car which is represen

Basic java, Why is Java platform independent / architecturally neutral / po...

Why is Java platform independent / architecturally neutral / portable?

What is mixing data types, What is Mixing Data Types? As well as mergin...

What is Mixing Data Types? As well as merging various operations, you can mix and match various numeric data types on the similar line. The program below uses both ints and dou

Overloading method, QUESTION 3: Overloaded methods Write the overloaded me...

QUESTION 3: Overloaded methods Write the overloaded method named average () for each of the following problems: a) The first method receives THREE (3) integer values and returns

What is bullseye explain with an example, What is Bullseye explain with an ...

What is Bullseye explain with an example? This is a easy applet that draws a series of filled, concentric circles alternating red and white, instead a bullseye. import java.ap

Program for randomly generated 3- digit number matches, Program for Randoml...

Program for Randomly Generated 3- Digit Number Matches This assignment demonstrates your ability to use basic Java syntax including selection and looping statements. You will

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

What information is needed to create a tcp socket, The Local Systems IP Add...

The Local Systems IP Address and Port Number and the Remote System's IPAddress and Port Number.

Different messaging paradigms jms supports, What are the different messagin...

What are the different messaging paradigms JMS supports? Ans) Publish and Subscribe i.e. pub/suc and Point to Point i.e. p2p.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd