
Concept explainers
Apply (Methods switch statement, input validation, printf).
Write a java program ( user either the Scanner or the Joption class ) which enables the user to convert US dollars to other currencies.
The user is to enter a dollar a mount, then the program is convert the dollars to the following currencies: Canadian dollars, Euros, Pounds Sterling, Dominican Peso.
1 US $ = 1.26 Canadian dollars
1 US $ = 0.89 Euro
1 US $ = 0.74 Pounds Sterling
1 US $ = 56.50 Dominican Peso
Instructions: the user is presented with a menu to select a currency to conver to, then the user enters the dollar amount to be converted which must be greater than zero. once conversion is done, the dollars amount and the new currency are displayed, and the user is asked again for converting another amount of dollars or to exit.
ONE TASK PER METHOD
Submit:
1) Design (Pseudocode)
2) Source code (Java program)
3) output

Step by stepSolved in 3 steps with 2 images

- Write a java program which asks the user to enter name and age and calls the following methods: a. printName(): Takes name as parameter and prints it 20 times using a while loop. b. printAge(): Takes age as parameter and prints all the numbers from 1 up to age. Please strictly follow this format. Note: any extra or missing space / line will lead to test failure. Name: Andy Age: 10 Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy Andy 1,2,3,4,5,6,7,8,9,10 class Main {public static void main(String[] args) {}}arrow_forwardWrite a Java program that lets the user enter a series of integers with an input range from 2 to 199. The user must enter a value of -1, 0, +1, or +3 (a sentinel which must be an integer and not part of the series of numbers) in order to signal the end of the series. After all the numbers have been entered, the program should display the smallest and largest numbers entered, and not include the sentinel. Note that this must be a Java implementation, and not pseudo-code, etc. You must use a Loop and If-Else/Select constructs as well. Also include a flow-chart.arrow_forwardThis is the question: only using the "while loop" Write a java program which asks the user to enter name and age and calls the following methods: printName(): Takes name as parameter and prints it 20 times using a while loop. printAge(): Takes age as parameter and prints all the numbers from 1 upto age. Write a java program that will print first 10 multiples of 3 in a single line.arrow_forward
- 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_forwardAnswer the given question with a proper explanation and step-by-step solution.arrow_forwardJava programming The US dollar = 0.82 Euros and 1.21 Canadian dollars.Write the following methods to convert US dollars to Euros and to Canadiandollars: ** Two methods one to convert US dollars to Canadian dollars and the othermethod to convert the US dollars to Euros.arrow_forward
- Write a Java program named Words that asks the user to enter four words. The program should then analyze each of the four words so that it can report the length of each word as well as the positions of the five vowels within each word. For a sample run where the user enters the words: she smiles third frisbee the console screen must look as follows: Enter 4 words: she smiles third frisbee Word 1 = "she" Length = 3 position of vowels: 'a' = -1, 'e' = 2, '1' = -1, '0' = -1, '0' = -1, = -1, 'u' = -1 Word 2 = "smiles" Length = 6 position of vowels: 'a' = -1, 'e' -1, 'e' = 4, '1' = 2, 'i = 2, '0' = -1, 'u' = -1 Word 3 = "third" Length = 5 position of vowels: 'a' = -1, 'e' = -1, = -1, 'i' = 2, '0' = -1, 'u' = -1 Word 4 = "frisbee" Length = 7 position of vowels: 'a' = -1, -1, 'e' 'e' = 5, 5, '1' '1' = 2, 2, '0' '0' = -1, 'u' = -1 For a sample run where the user enters the words: shoe shoe chime wallabees the console screen must look as follows: Enter 4 words: shoe shoe chime wallabees Length…arrow_forwardWrite a complete Java program that does the following: 1. Ask the user to enter the last number and the second last number of his / her student ID. 2. Stores the entered numbers in adequate variables. 3. Finds and prints the following using "printf": The sum of the two numbers. The boolean value of comparing the equality of the two numbers using the equality operator. The value of the first number is raised to the power of the second number using a method from the class Math. Note: The class name of your Java program must be your first name. Your answer should have the code as text as well as the screenshot of the program output (using your own student ID) as a part of your answer. Otherwise, zero marks will be awarded. A typical run of the program Compile Messages JGRASP Messages Run 1/0 Interactions End Clear Help GRASP x Java Question 2 Enter the last amber of your student ID Enter the second last number of your student ID 2 The sum of 5+2=7 (5 is equal to 2) false 3 to the power of…arrow_forwardJava programming The US dollar = 0.82 Euros and 1.21 Canadian dollars.Write the following methods to convert US dollars to Euros and to Canadiandollars: ** A method to display the US dollars and the equivalence in the convertedcurrencyarrow_forward
- Write a class, NumberToMonth, which does the following: a. Ask the user to enter the month of the year (number1 through 12): "Enter the month of the year - number 1 to 12" b. Get the month using a Scanner c. checks for invalid input (i.e. numbers that are not 1- 12) and terminates the program using System.exit(1)if input is invalid d. Prints the name of the month: "The month is XXXXX" Tips | Use a multi-way if-else statement Submission I Copy and paste your code | Screen shot the console with user input of three example months (one invalid input, two any month) Sample Run Enter the month of the year (number 1 to 12) 77 Invalid Input Enter the month of the year (number 1 to 12) 6 The month is June Enter the month of the year (number 1 to 12) 12 The month is Decemberarrow_forwardAny help with this question would really help!! Write the following exercise using Java code. Add comments in the program to explain what your code is doing. Duke Shirts sells Java t-shirts for $24.95 each, but discounts are possible for quantities as follows: 1 or 2 shirts, no discount and total shipping is $10.003-5 shirts, discount is 10% and total shipping is $8.006-10 shirts, discount is 20% and total shipping is $5.0011 or more shirts, discount is 30% and shipping is free Write a Java program that prompts the user for the number of shirts required. The program should then print the extended price of the shirts, the shipping charges, and the total cost of the order. Use currency format where appropriate.arrow_forwardJava programming The US dollar = 0.82 Euros and 1.21 Canadian dollars.Write the following methods to convert US dollars to Euros and to Canadiandollars: *** A method prompting the user to select an option (to convert to Euros orto Canadian dollars) and returns the option to the main method.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





