FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 1162   



Following program shows you how to convert rupees to dollars
In this program we get rupees from user, once we get those we need to divide with 64 so that we get in dollars

import java.util.Scanner;

public class MathUnitConversions17 {

    public static void main(String[] args) {

        float rupees;

        Scanner in = new Scanner(System.in);

        System.out.println("Please enter rupees:");

        rupees = in.nextLong();

        float dollars = rupees / 64;

        System.out.println(dollars + " Dollars");
    }
}

Output:

Please enter rupees:
300
4.6875 Dollars



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News