hi.. please give me a java coding for the following question

hi.. please give me a java coding for the following question

Write a program that displays the following table (note that 1 mile is 1.609 kilometers).

Miles Kilometers


                       1.609
                       3.218

���. 10 10.090

View Answers

March 29, 2011 at 5:31 PM

import java.text.*;
class ConvertMilesToKilometer 
{
    public static void main(String[] args) 
    {
        DecimalFormat df=new DecimalFormat("##.###");
        double miles[]={1,2,10};
        for(int i=0;i<miles.length;i++){
        double km = miles[i] * 1.609;
        System.out.println(miles[i]+"\t "+df.format(km));
        }
    }
}









Related Tutorials/Questions & Answers:
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that prompts the user to enter the number of students and each studentâ??s name and score, and finally displays the name of the students
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that reads in investment amount, annual interest rate, and number of years, and displays the future investment value using the following formula
Advertisements
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a program that displays the following table (note that 1 mile is 1.609 kilometers). Miles Kilometers
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Suppose that the tuition for a university is RM10,000 this year and increases 5% every year. Write a program that computes the tuition in ten years and the total cost
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a function called ChangeToNext that take in an uppercase character parameter ch. The function returns the next uppercase character if ch is between 'A' and 'Y
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Write a class that contains the following two methods: /* converts from inches... these methods to display the following table: Inches Centimeters
hi.. please give me a java coding for the following question
hi.. please give me a java coding for the following question  Body Mass Index(BMI) is a measure of health on weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  example java coding that reads in the radius and length of cylinder and computes volume. formula: Area = radius * radius * PI Volume = area * length
hi... pls give me the example of java coding fo following question
hi... pls give me the example of java coding fo following question  Write a java program that reads the following information and prints a payroll statement: Employeeâ??s name (e.g: Sam) Number of hours worked in a week (e.g: 10
hi... pls give me the example of java coding for following question
hi... pls give me the example of java coding for following question   Write a program that computes loan payments. The loan can be a car loan, a student loan, or a home mortgage loan. The program lets the user enter the interest
please give me a java program for the following question
please give me a java program for the following question  Write a java program that displays multiple frames : Step 1: Design a frame with three buttons: ?Fruit?, ?Bird? and ?Animal? Step 2: On clicking ?Fruit? button
Please give me coding for this..
Please give me coding for this..  Write an application that inputs one number consisting of five digits from the user.separates the number ibto its individual digits and prints the digits separated from one another by three
please give me an idea to develop a program for this question?
please give me an idea to develop a program for this question?  How to enter a text or number from keyboard without using InputStreamReader method in java
Hi Every One , please give me some idia to opning audio File . please Help ..
Hi Every One , please give me some idia to opning audio File . please Help ..  hi Dear Friend , please give me a program to opening audio file... me .please Help
please help me to give code - Java Beginners
please help me to give code  Write a function with a signature cheerlead(word) that prints a typical cheer as follows. The word robot: Gimme an R Gimme an O Gimme a B Gimme an O Gimme a T What did you give me? ROBOT
please help me to give code - Java Beginners
please help me to give code  Write a program that prints an n-level... and the number of stairs in the stair case * ** *** ****   Hi friend..., http://www.roseindia.net/java
Please give me the answer.
"int a=08 or 09" its giving compile time error why   "int a=08 or 09" its giving compile time error why ? can any one give me the answer of this please
please help me to give code - Java Beginners
please help me to give code  Write a function, sliding(word, num)that behaves as follows. It should print out each slice of the original word having length num, aligned vertically as shown below. A call to sliding(examples, 4
please help me to give code - Java Beginners
please help me to give code  Write a program that uses loops to generate an n x n times table. The program should get n from the user. As a model... 4 | 4 8 12 16   hi, import java.io.*; public
please help me to give code - Java Beginners
please help me to give code  Write a program that reads a file named... print out John von Neumann   hi friend, import java.io.*; import...(); } } } ------------------------------- read for more information, http://www.roseindia.net/java/beginners/read
Please provide coding for following problem
Please provide coding for following problem  Please provide the coding for the following problem: You will write a java program that will read data from a file. The data in the file will be: John Doe 75 Joe Blow 65 Mary Smith 80
hi,i'am new to Jsp.Can some one please let me know an answer for this question?
hi,i'am new to Jsp.Can some one please let me know an answer for this question?  how do we upload an xml file and validate them against WIPO DTD
hello sir, please give me answer - Java Beginners
hello sir, please give me answer  Write a program in Java that calculates the sum of digits of an input number, prints... ways in java? so , sir please tell me full solution of this program   Here is your complete
Begineer in coding please help me
Begineer in coding please help me  I have Person class{ int pid; String Pname; //and have a Address filed of type Address not String!!! Address... address to a person object.. please help me
Please give me the code for the below problem - Java Interview Questions
Please give me the code for the below problem  PROBLEM : SALES TAXES Basic sales tax is applicable at a rate of 10% on all goods, except books... Vidya  Hi Friend, Try the following code: import java.util.
Plz give me code for this question
Plz give me code for this question  Program to find depth of the file in a directory and list all files those are having more number of parent directories
problem in writing coding. Please help me.
problem in writing coding. Please help me.  Hi sir, my name is Logeswaran. I have problem in writing JSP coding for my university assigments... like? I'm really stuck on this. Please help me. By the way, I'm using Access
hi see and give me reply as soon as possible
hi see and give me reply as soon as possible  Hi Friend, I got path,but it will again ask path error first i was gave index.jsp.It is displayed and it is not going to next level. HTTP Status 404 - /struts/hello type
why and where we use setter and getter methods in java, please give me one example program.....
why and where we use setter and getter methods in java, please give me one example program.....  why and where we use setter and getter methods in java, please give me one example program
Plz give java coding for this
Plz give java coding for this  ... iMin = 1, iMax = 8, iMid; // give max. value in even no. int jMin = 1, jMax = 12, jMid; // give max. value in even no. iMid = iMax / 2; jMid = jMax / 2
please help me in coding this given program
please help me in coding this given program  consider the below series: 1,2,1,3,2,5,3,7,5,11,8,13,13,17,..... this series is a mixture of 2 series... in this series. (i m unable to code this program..please provide solution
please help me in coding this given program
please help me in coding this given program  consider the below series: 1,2,1,3,2,5,3,7,5,11,8,13,13,17,..... this series is a mixture of 2 series... in this series. (i m unable to code this program..please provide solution
how to send email please give me details with code in jsp,servlet
how to send email please give me details with code in jsp,servlet  how to send email please give me details with code in jsp,servlet
please give me an example about shopping cart using spring and hibernate
please give me an example about shopping cart using spring and hibernate  who can give me an ex about shoppingcart using spring and hibernate intergration ? thanks alot
please help me to solve this question about array
please help me to solve this question about array  write a program.... Please enter character"); else { ch = brr.charAt(0...("It is not character. Please enter character"); else { ch
Give me some java Forum like Rose India.net
Give me some java Forum like Rose India.net  Friends... Please suggest some forum like RoseIndia.net where we can ask question like here. Thanks
Give me some java Forum like Rose India.net
Give me some java Forum like Rose India.net  Friends... Please suggest some forum like RoseIndia.net where we can ask question like here. Thanks
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  1) Copy one file content to other? 2) Count the number of words in a file
please any one can help me to write a code for this question?
please any one can help me to write a code for this question?  Q 1) In a class first day 25 students are joined. After two days that total students will increased to 60. We can develop a program by using ArrayList concept
Hi .Again me.. - Java Beginners
Hi .Again me..  Hi Friend...... can u pls send me some code...... REsponse me..  Hi friend, import java.io.*; import java.awt.... according to your requirement. Please implement following code. import java.awt.
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1... violation?. What does it mean? How to avoid it? 5) For each of the following four program fragments: a. Give an analysis of the running time (Big-Oh) b
please help me to answers this question about C++.....huuhuhuhu
please help me to answers this question about C++.....huuhuhuhu  1... violation?. What does it mean? How to avoid it? 5) For each of the following four program fragments: a. Give an analysis of the running time (Big-Oh) b
please help me - Java Beginners
please help me   I have some error in this programe //write acomputer programe using java to generate following series : //output: //1,2,3,0...(a(; System.out.print(","); System.out.print(b); } }   Hi Friend, We
Help me please!!! - Java Beginners
Help me please!!!  im badly needing the complete code for this project in java!!! can you please help me???!!! it is about 1-dimensional array... the answers 8Hours from now!!! Kindly help me!! please!!please!!! NOTE
jsp coding please.
jsp coding please.  hi sir, my name is logeswaran. I have a problem... list. please show me how to do it? thank you. By the way, I'm using access database and coding JSP.   Follow these steps: 1)Go to the start->
I really need help with this assignment question Please help me out Please
I really need help with this assignment question Please help me out Please ... a Java application to provide these services by connecting to a database hosted...?. The LaptopPool table should contain the following fields: StudentID, FirstName
plz give me answer
plz give me answer  Discuss & Give brief description about string class methods   Java string methods
please give me solution how to display next page after 20 records ? - JSP-Servlet
please give me solution how to display next page after 20 records ?  Java Servlet Paging control example  here i have attached one example code. function validate() { for(j=0;j<30;j
plz give me answer
plz give me answer   description about string class methods   Java string methods
plz give me answer
plz give me answer   description about string class methods   Java string methods

Ads