1. Create a program that will convert the input dollar(s) into its equivalent peso. One dollar is approximately equal to 50.60 pesos. Then display The result.
Sample output:
The equivalent of $100 into is Pho 5, 060.00
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
double dollars;
System.out.println("Enter dollars: ");
dollars=in.nextDouble();
double peso=dollars*50.60;
System.out.println("The equivalent of $"+dollars+" is Pho "+peso);
}
}
Comments
Leave a comment