Concept explainers
You just returned from a trip. The countries you visited were Jamaica, The Dominican Republic, and Cuba.
You arrived back in the United States with some foreign currency from these countries.
Write a Java
The program should convert these combined amounts to the total equivalent number of US Dollars.
The program should then output the result.
Use exchange rates for these currencies as follows:
1 Jamaican Dollar = 0.0069 US $
1 Dominican Peso = 0.017 US $
1 Cuban Peso = 0.042 US $
The prompts should look like this:
Enter number of Jamaican Dollars :
Enter number of Dominican Pesos :
Enter number of Cuban Pesos :
The output should be formatted as follows:
US Dollars = $total amount of US Dollars
Hint:
Be very careful with formatting your output. The number should look like it represents money.
System.out.printf( "US Dollars = $%.2f\n" , totalUnitedStatesDollars );
to generate a solution
a solution
- Write a program in java that completes the following prompt: You are a fundraising distributor who needs to to pre-sell a limited number of doughnut coupon books. Each buyer can buy as many as 4 coupon books. No more than 100 coupon books can be sold. Implement a program called Fundraiser that prompts the user for the desired number of coupon books and then displays the number of remaining coupon books. Repeat until all coupon books have been sold, and then display the total number of buyers.arrow_forwardWrite a Java code that gets student exam scores from the user. Each exam score will be an integer in the range 0 to 100. Input will end when the user enters -1 as the input value. After all scores have been read, display the number of students who took the exam, the minimum score, the maximum score, the average score, and the number of As where an A is a score in the range 90-100. Make sure your average a decimal point. Only count A’s, not other grades. Note that you do not need to do any error checking on the input for this problem. This should be done as a standard sentinel-controlled while loop.arrow_forwardUse java.arrow_forward
- Create a Java program that can be used to calculate the average weekly and monthly grocery bill for a family of four: Prompt the user for the coupon amount as a decimal (example, .10). Ensure the value is set to 10% if the value exceeds 100% or is less than or equal to zero. Prompt the user for 2-4 weeks of grocery bills. Calculate the monthly and weekly average for groceries. Display monthly total and weekly average without the coupon. Display monthly total and weekly average with the coupon.arrow_forwardin java pls A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the pizzas, and then output the total after applying a sales tax of 6%. Output each floating-point value with two digits after the decimal point, which can be achieved as follows:System.out.printf("Subtotal: %.2f\n", yourValue); Ex: If the input is: 3 the output is: Subtotal: $29.97 Total due: $31.77arrow_forwardDesign a Java program to take user information about t dollar bills. You will do calculations and print the result as below. Note that user can enter any number and your output user's input. Example: Enter nunber of one dollar bills: 769 769 dollar bills will be change to Hundred Fifty Twenty Ten Five Onearrow_forward
- Your team was asked to program a self-driving car that reaches its destination with minimum travel time. Write an algorithm for this car to choose from two possible road trips. You will calculate the travel time of each trip based on the car's current speed and the distance to the target destination. Assume that both distances and car speed are given. The programming language I'm using is Java. So, it'll be appreciated if the solution was in Java Thanksarrow_forwardIn Java Integer amountChanged and double depth are read from input. Output the following: amountChanged as a decimal integer value, followed by "%". depth as a floating-point value, followed by "%". amountChanged as an octal integer value, followed by "%". End each output with a newline. Ex: If the input is 27 4.875, then the output is: 27% 4.875000% 33%arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education