Answer to Question #261048 in Programming & Computer Science for Bjoy

Question #261048

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 Php5,060.00

1
Expert's answer
2021-11-05T03:14:42-0400
import java.util.Scanner;


public class App {


	public static void main(String[] args) {
		Scanner keyBoard = new Scanner(System.in);
		int dollars = -1;
		while (dollars < 0 || dollars > 1000000) {
			System.out.print("Enter number of dollar(s): ");
			dollars = keyBoard.nextInt();
		}
		
		double pesos = dollars * 50.60;
		System.out.println("The equivalent of $"+ dollars + " into is Php" + pesos);
		keyBoard.close();
	}


}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS