1. Write a program to convert rupees to dollar. 60 rupees=1 dollar.

1. Write a program to convert rupees to dollar. 60 rupees=1 dollar.
import java.util.Scanner;

class Convert
{
float  rupees;
double change()
{
double ans=rupees/60;
return ans;
}
}

class ConvertDemo
{
public static void main(String args[])
{
Convert c1 =new Convert();
Scanner s=new Scanner(System.in);
System.out.println("Enter Rupees :");
c1.rupees=s.nextFloat();
double ans=c1.change();
System.out.println("Your Rupees in Dollare : " +ans +" $");
}
}





Comments

Popular posts from this blog

Write a java program to calculate gross salary & net salary taking the following data

WAP a program that illustrates interface inheritance. Create two interface p1 and p2 . create Interface p which extends p1 and p2 and then create interface p12 which extends p12. Each interface declare one constants and one method. Create class Q which implements p12 and define all the methods of interface which displays value of constants

WAP that create interface on that you declare one method interest(p,r,n) then create two class simple and compound that implements interest and find simple and compound interest.