Nuffer+Java+Code

This is the code that converts dollars to euros and rounds the result to the nearest penny.

/** DollarsToEurosConvert.java converts dollars to euros.


 * @author Joel Adams


 * @version fo Alice+Java book.

*/ import java.util.Scanner; //This line imports the Scanner class from the java.util package// // public class DollarsToEurosConverter { //names the class

public static void main(String[] args) { //this defines the main method.//

// System.out.print("How many dollars doyou want to convert?"); //// asks user for value //

// Scanner kbd = new Scanner(System.in); //// Java 1.5 or later (initializes variable named kbd)  //

// double dollars = kbd.nextDouble ; //// initializes variable named dollars //

// System.out.print("What is the euros-per-dollar exchange rate?"); //// asks use for exchange rate  //

// double eurosPerDollar = kbd.nextDouble; //// initializes variable named eurosPerDollar //

// double euros = dollars * eurosPerDollar; ////  makes calculation  //

// System.out.printf("%.2f dollars => %.2f euros", dollars,euros); //returns result rounded to nearest penny + descriptive values } }