Advertisement
Guest User

01. PC Store - Programming Basics Online Exam - 10 and 11 Ma

a guest
Apr 2nd, 2018
1,632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. // Input and conversion USD -> BGN
  14. var processorUsd = double.Parse(Console.ReadLine());
  15. var processorBgn = processorUsd * 1.57;
  16. var videoUsd = double.Parse(Console.ReadLine());
  17. var videoBgn = videoUsd * 1.57;
  18. var ramUsd = double.Parse(Console.ReadLine());
  19. var ramBgn = ramUsd * 1.57;
  20. var ramQuantity = int.Parse(Console.ReadLine());
  21. var ramPrice = ramBgn * ramQuantity;
  22.  
  23. // Discount percentage
  24. var discount = double.Parse(Console.ReadLine());
  25.  
  26. // Total prices of parts
  27. var processorTotal = processorBgn - (processorBgn * discount);
  28. var videoTotal = videoBgn - (videoBgn * discount);
  29. var ramTotal = ramPrice;
  30.  
  31. // Total output price
  32. var totalPrice = processorTotal + videoTotal + ramTotal;
  33. Console.WriteLine($"Money needed - {totalPrice:F2} leva.");
  34. }
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement