Question

In: Computer Science

You are tasked with developing an application that converts US currency ($) to 3 other major...

You are tasked with developing an application that converts US currency ($) to 3 other major world currencies.

Here are the current rates:

1 US dollar = 0.90 EURO

1 US dollar = 107.7 Japanese YEN

1 US dollar =19.45 Mexican PESO

Your application must prompt the user to enter an amount in US dollars, convert it into EURO, YES, and PESO and then display all using a suitable format.

Coding requirements:

-All your variables MUST  declared inside main() except for the Scanner.

-Code function(s)/method(s)   that handle all input.

-Code function(s)/method(s) that handles all conversions.

-Code a function/method that displays the result of the conversion. Your output must be clear and well labeled.

(show the amount input in dollar, then show the amount of the conversion for each of the three major currencies)

Solutions

Expert Solution

//import the Scanner class to create an object to the read the data from the user.
import java.util.Scanner;

// main class name is converion
public class Conversion {

//creating an object for Scanner class .
//Scanner object has to be static.
//In java a static method can call only static methods.

   static Scanner sc = new Scanner(System.in);
//driver code.  
   public static void main(String args[]) {
      
       //asking the user to enter the amount in dollrs
       System.out.println("Enter the amount in dollars : ");
      
       //taking the input from the user using the sc (Scanner class) object
       double Dollars = sc.nextDouble();
      
       //displaying the user entered amount
       System.out.println("Entered amount in dollars is :"+Dollars+"$");
       System.out.println("Currency after conversion");
      
       //converting the currency into other countries currencies.
       //inorder to convert from one currency to another we multiply with the value with which they are in proportion.
      
       //incase of Euros it is 1 US Dollar = 0.90 Euro
       double Euros = Dollars * 0.90;
       // printing the amount in Euros
       System.out.println("Amount in Euros: "+ Euros);
      
       //1 US Dollar = 107.7 Yen
       double Yen = Dollars * 107.7;
       //printing the amount in Yen
       System.out.println("Amount in Yen : "+ Yen);
      
       // 1 US dollar = 19.45 Peso
       double Peso = Dollars * 19.45;
       //printing the amoun in Peso
       System.out.println("Amount in Peso : "+ Peso);
  
   }  
}

OUTPUT: -


Related Solutions

Your task is to create a Java application that converts a specified amount of one currency...
Your task is to create a Java application that converts a specified amount of one currency into another currency for a user. The application must meet the following requirements: Upon execution, the application shall display a brief welcome message announcing that the user is running the currency converter application. The application shall allow a user to convert amounts between any two of the following currencies: United States Dollars (USD), British Pounds (GBP), Swiss Francs (CHF), and Indian Rupees (INR). The...
Your task is to create a Java application that converts a specified amount of one currency...
Your task is to create a Java application that converts a specified amount of one currency into another currency for a user. The application must meet the following requirements: 1. Upon execution, the application shall display a brief welcome message to the user to let her know she is running the currency converter application. 2. The application shall allow a user to convert amounts between any two of the following currencies: United States Dollars (USD), British Pounds (GBP), Swiss Francs...
you are the marketing manager for the Tesla model 3 and have been tasked with developing...
you are the marketing manager for the Tesla model 3 and have been tasked with developing an effective social media strategy. a) develop a concept for an online brand community for Tesla model 3 enthusiasts. outline the specific features that the brand community will have as well as the value of the specific features to the community members and to Tesla. b) identify specific social networking platforms that you would use in the development of a social media strategy for...
You are the HR manager for a new company and you have been tasked with developing...
You are the HR manager for a new company and you have been tasked with developing a concise employee manual for your new middle managers. This manual must help the managers understand certain HR initiatives so that they can recruit, select, and manager their staff effectively. The manual will consist of explaining and providing guidelines for best practices in the areas below. Explain the importance of a job description and briefly describe the necessary components Describe an effective recruiting process...
As a leader of a health care organization, you are tasked with developing policies and procedures...
As a leader of a health care organization, you are tasked with developing policies and procedures for the Employee Code of Conduct. The current policy is outdated and needs revision. What research would you need to conduct to prepare? Are there leaders on your team who you would consult? Would you consult employees? Develop a plan and describe, in a 1,000- to 1,250-word essay, how you would accomplish this task and achieve the desired outcome.
This is for a Stem Cell Class Suppose you are tasked with developing a cell therapy...
This is for a Stem Cell Class Suppose you are tasked with developing a cell therapy for the treatment of COVID-19. Briefly describe: a) what cells you would use and why? b) how you would make the cells? c) what pre-clinical experiments you would do? d) how you would carry out the clinical trial?
1. You are tasked with developing a research programme for one of the areas mentioned below....
1. You are tasked with developing a research programme for one of the areas mentioned below. Outline (i) the main objective, (ii) the expected outcomes and (iii) at least four specific research projects to be executed. The programmes are (a) Biochar production and utilization, (b) Non-timber Forest Products development
You have been tasked with the developing a 10 response workshop evaluation and analysis. The the...
You have been tasked with the developing a 10 response workshop evaluation and analysis. The the workshop was hosted by your district and there were 50 people who participated in the workshop. Using this handout entitled (workshop evaluation) create a hypothetical analysis of how the 50 respondents answered each question. Use date analysis tools (central tendencies probabilities ect.)
You are tasked to design an application to keep track of sales for your company. Sales...
You are tasked to design an application to keep track of sales for your company. Sales should be tracked for two types of accounts: supplies and services. Complete the following:     Create a UML class diagram for the Account inheritance hierarchy. Your subclasses should be Supplies and Services.     All sales accounts will have an account ID (accountId).     You will need attributes to keep track of the number of hours (numberOfHours) and rate per hour of services provided (ratePerHour)....
Some countries, many being developing countries, peg their currency to the US dollar. What effect does...
Some countries, many being developing countries, peg their currency to the US dollar. What effect does a rapid appreciation or devaluation of the dollar have on those countries?Some countries, many being developing countries, peg their currency to the US dollar. What effect does a rapid appreciation or devaluation of the dollar have on those countries?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT