In this program a simple calculation will be made to know the equivalent of a certain amount of US Dollar in Philippine Peso.
The program will ask for the user to input a certain amount and it will give you its equivalent amount in peso.
import java.util.Scanner;
public class USToPeso {
public static void main(String[] args) {
double ustopeso = 43.86;
double us;
System.out.println("Enter amount in USD:");
Scanner reader = new Scanner(System.in);
us = reader.nextDouble();
double amountinpeso = us*ustopeso;
System.out.println("The value in Philippine Peso is: " +amountinpeso);
}
}
Here's the output:
In case the exchange rate changes, you can always change its value by editing the highlighted part which is 43.86.
If you want to do other currency conversions, you can edit the amount as well and the variables to avoid confusion. The variables I used in this class are ustopeso, peso, and amountinusd. Click here for another example of currency conversion.
The program will ask for the user to input a certain amount and it will give you its equivalent amount in peso.
import java.util.Scanner;
public class USToPeso {
public static void main(String[] args) {
double ustopeso = 43.86;
double us;
System.out.println("Enter amount in USD:");
Scanner reader = new Scanner(System.in);
us = reader.nextDouble();
double amountinpeso = us*ustopeso;
System.out.println("The value in Philippine Peso is: " +amountinpeso);
}
}
Here's the output:
In case the exchange rate changes, you can always change its value by editing the highlighted part which is 43.86.
If you want to do other currency conversions, you can edit the amount as well and the variables to avoid confusion. The variables I used in this class are ustopeso, peso, and amountinusd. Click here for another example of currency conversion.
Thanks for your informative post on Java application development. This open source platform assists software developers to create stunning mobile application with ease. Further, they can make use of this platform at free of cost.
ReplyDeleteJ2EE Training in Chennai
.Net Training in Chennai
PHP Training in Chennai
Big Data Training in Chennai
Hi BerryKins,
ReplyDeleteQuite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming blog to enhance my skill set in java, keep blogging.
Regards,
SAP training in chennai|SAP course in chennai|SAP training|SAP courses in chennai
And indeed, I’m just always astounded concerning the remarkable things served by you. Some four facts on this page are undeniably the most effective I’ve had.
ReplyDeleteReporting Tool | reporting training in chennai |
reporting training institute in chennai | reporting course in chennai | best reporting training in chennai
Ionic Training | ionic training in chennai | ionic training institute in chennai |
ionic training course in chennai | best ionic training in chennai
Corporate training is educating employees using various learning programmes through activities. It serves as a catalyst for employee achievement, which signifies your company's or organisation's overall success. According to a LinkedIn survey, 94% of employees said they would remain at a firm if it invested in their learning requirements because training is a crucial aspect of their professional lives. To learn more about corporate training features, join Corporate Training In Chennai at FITA Academy.
ReplyDeleteCorporate Training In Chennai