Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApp1
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Which currency you want to convert");
- Start:
- string currency = Console.ReadLine().ToLower();
- {
- switch (currency)
- {
- case "usd":
- break;
- case "bgn":
- break;
- case "eur":
- break;
- case "hkd":
- break;
- case "cad":
- break;
- case "gbp":
- break;
- case "rub":
- break;
- default:
- Console.WriteLine("Please Input valid currency");
- goto Start
- ;
- }
- }
- Console.Write($"You are converting {currency} to ");
- string second = Convert.ToString(Console.ReadLine());
- if (second == currency)
- {
- Console.WriteLine("You cant convert the same currencies");
- goto Start
- ;
- }
- double BGNUSD = 0.60;
- double EURUSD = 1.174;
- double HKDUSD = 0.1280;
- double CADUSD = 0.7772;
- double GBPUSD = 1.3322;
- double RUBUSD = 0.017;
- double convert;
- double percentage=0;
- Console.WriteLine("How much do you want ot convert");
- var value = Math.Abs(Int32.Parse(Console.ReadLine()));
- switch (currency)
- {
- case "eur":
- percentage = EURUSD;
- break;
- case "bgn":
- percentage = BGNUSD;
- break;
- case "hkd":
- percentage = HKDUSD;
- break;
- case "cad":
- percentage = CADUSD;
- break;
- case "gbp":
- percentage = GBPUSD;
- break;
- case "rub":
- percentage = RUBUSD;
- break;
- case "usd":
- break;
- default:
- percentage = 2;
- break;
- };
- Console.WriteLine(percentage);
- {
- //Console.WriteLine($"{value} USD is {value * ratioUSDBGN} BGN");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement