Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- namespace ConsoleApp2
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Input and conversion USD -> BGN
- var processorUsd = double.Parse(Console.ReadLine());
- var processorBgn = processorUsd * 1.57;
- var videoUsd = double.Parse(Console.ReadLine());
- var videoBgn = videoUsd * 1.57;
- var ramUsd = double.Parse(Console.ReadLine());
- var ramBgn = ramUsd * 1.57;
- var ramQuantity = int.Parse(Console.ReadLine());
- var ramPrice = ramBgn * ramQuantity;
- // Discount percentage
- var discount = double.Parse(Console.ReadLine());
- // Total prices of parts
- var processorTotal = processorBgn - (processorBgn * discount);
- var videoTotal = videoBgn - (videoBgn * discount);
- var ramTotal = ramPrice;
- // Total output price
- var totalPrice = processorTotal + videoTotal + ramTotal;
- Console.WriteLine($"Money needed - {totalPrice:F2} leva.");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement