Java: I’m buyin’ a Ferrari! If you’ve ever travelled to another country, you know that working with different currencies takes a while to get used to. As of the date of making this assignment, there are 9,240.00 Guinean Francs to $1 USD. For this program, design implement (source code) a program that prompts the user for the amount of U.S. currency they have, and converts it into Ginean Francs. Document your code and properly label the input prompts and the outputs as shown below.
Sample run 1: Enter an amount in USD: $50 You have 462000.0 Guinean Francs
Sample run 2: Enter an amount in USD: $313 You have 2892120.0 Guinean Francs
//USDToGuineanFrancs.java import java.util.Scanner; public class USDToGuineanFrancs { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); double usd, result; System.out.print("Enter an amount in USD: $"); usd = scanner.nextDouble(); result = usd*9240; System.out.printf("You have %.1f Guinean Francs\n",result); } }
Get Answers For Free
Most questions answered within 1 hours.