Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Task 012, Chapter 2.0
- using System;
- public class CurrencyConverter
- {
- static void Main()
- {
- double amount = double.Parse(Console.ReadLine());
- string currentCurrency = Console.ReadLine().ToLower();
- string wantedCurrecncy = Console.ReadLine().ToLower();
- double total = 0.0;
- if(currentCurrency == "bgn" && wantedCurrecncy == "eur")
- {
- total = amount / 1.95583;
- }
- else if(currentCurrency == "bgn" && wantedCurrecncy == "gbp")
- {
- total = amount / 2.53405;
- }
- else if(currentCurrency == "bgn" && wantedCurrecncy == "usd")
- {
- total = amount / 1.79549;
- }
- else if(currentCurrency == "eur" && wantedCurrecncy == "bgn")
- {
- total = amount * 1.95583;
- }
- else if(currentCurrency == "eur" && wantedCurrecncy == "gbp")
- {
- total = amount * 1.95583 / 2.53405;
- }
- else if(currentCurrency == "eur" && wantedCurrecncy == "usd")
- {
- total = amount * 1.95583 / 1.79549;
- }
- else if(currentCurrency == "gbp" && wantedCurrecncy == "bgn")
- {
- total = amount * 2.53405;
- }
- else if(currentCurrency == "gbp" && wantedCurrecncy == "eur")
- {
- total = amount * 2.53405 / 1.95583;
- }
- else if(currentCurrency == "gbp" && wantedCurrecncy == "usd")
- {
- total = amount * 2.53405 / 1.79549;
- }
- else if(currentCurrency == "usd" && wantedCurrecncy == "bgn")
- {
- total = amount * 1.79549;
- }
- else if(currentCurrency == "usd" && wantedCurrecncy == "eur")
- {
- total = amount * 1.79549 / 1.95583;
- }
- else if(currentCurrency == "usd" && wantedCurrecncy == "gbp")
- {
- total = amount * 1.79549 / 2.53405;
- }
- Console.WriteLine($"{total:F2} {wantedCurrecncy.ToUpper()}");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment