YardsConversion.java

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xosunkist
    New Member
    • Mar 2007
    • 10

    #1

    YardsConversion.java

    My instructions for this are: Use one class to convert a value entered by the user in yards to meters and feet. The program should print the results of each conversion to the screen without the user having to re-enter the value to be converted. The name of the class should be YardsConversion . The program should have the user enter type double value for yards using the keyboard.
    The class should contain main method to enter the value in yards to be converted. Also contain two other methods to make the calculations to meters and feet and print the results to DOS screen.

    My problem: Is this correct so far? Also, what would need to be done so that I don't have to have the user re-enter the value every single time?
    Code:
    import java.util.*;
    
    Public class YardsConversion
    {
    static double YARDS_TO_METERS =    ;        /* 1 yd. =     meter */
    
    static double YARDS_TO_FEET=    ;           /* 1 yd. =        feet */
    
    Public static void Main(String [] args)
    {
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Originally posted by xosunkist
    My instructions for this are: Use one class to convert a value entered by the user in yards to meters and feet. The program should print the results of each conversion to the screen without the user having to re-enter the value to be converted. The name of the class should be YardsConversion . The program should have the user enter type double value for yards using the keyboard.
    The class should contain main method to enter the value in yards to be converted. Also contain two other methods to make the calculations to meters and feet and print the results to DOS screen.

    My problem: Is this correct so far? Also, what would need to be done so that I don't have to have the user re-enter the value every single time?
    Code:
    import java.util.*;
    
    Public class YardsConversion
    {
    static double YARDS_TO_METERS =    ;        /* 1 yd. =     meter */
    
    static double YARDS_TO_FEET=    ;           /* 1 yd. =        feet */
    
    Public static void Main(String [] args)
    {
    One thread per question please.

    Comment

    Working...