473,386 Members | 1,743 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

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?
Expand|Select|Wrap|Line Numbers
  1.  
  2. import java.util.*;
  3.  
  4. Public class YardsConversion
  5. {
  6. static double YARDS_TO_METERS =    ;        /* 1 yd. =     meter */
  7.  
  8. static double YARDS_TO_FEET=    ;           /* 1 yd. =        feet */
  9.  
  10. Public static void Main(String [] args)
  11. {
  12.  
Mar 29 '07 #1
1 1284
r035198x
13,262 8TB
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?
Expand|Select|Wrap|Line Numbers
  1.  
  2. import java.util.*;
  3.  
  4. Public class YardsConversion
  5. {
  6. static double YARDS_TO_METERS =    ;        /* 1 yd. =     meter */
  7.  
  8. static double YARDS_TO_FEET=    ;           /* 1 yd. =        feet */
  9.  
  10. Public static void Main(String [] args)
  11. {
  12.  
One thread per question please.
Mar 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Michael | last post by:
Hello I am trying to write a Java-Program which converts a XML-file in a HTML. It should take the Transformation-file from the XML-file itself. Below find a possible XML-file: <?xml...
0
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
1
by: ptaz | last post by:
Hi I'm trying to run a web page but I get the following error. Ca anyone please tell me a solution to this. Thanks Ptaz HTTP Status 500 - type Exception report
11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: Markus Wollny | last post by:
Hello! When I try to run ./configure --with-java, it complains that ant doesn't work. However ant is installed, as is the latest Java SDK 1.4.2 from sun, PATH and JAVA_HOME are set correctly; ...
0
by: mailkhurana | last post by:
Hii , I am trying to use a type 2 driver to connect to DB2 0n AIX 5 I have a small java test to class to establish a conneciton with the db .. I am NOT using WAS or any appserver When I try to...
1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
0
oll3i
by: oll3i | last post by:
package library.common; import java.sql.ResultSet; public interface LibraryInterface { public ResultSet getBookByAuthor(String author); public ResultSet getBookByName(String name);
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.