aneliabogeva

Untitled

Mar 19th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 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 ConsoleApplication183
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int n = int.Parse(Console.ReadLine());
  14. double salary = double.Parse(Console.ReadLine());
  15. //double finalSelary = 0;
  16.  
  17. for (int i = 1; i <= n; i++)
  18. {
  19. string browser = Console.ReadLine();
  20.  
  21. switch (browser)
  22. {
  23. case "Facebook":
  24. salary = salary - 150;
  25. break;
  26.  
  27. case "Instagram":
  28. salary = salary - 100;
  29. break;
  30.  
  31. case "Reddit":
  32. salary = salary - 50;
  33. break;
  34. }
  35.  
  36. if (salary <= 0)
  37. {
  38. Console.WriteLine($"You have lost your salary.");
  39. break;
  40. }
  41. }
  42. if (salary > 0)
  43. {
  44. Console.WriteLine(salary);
  45. }
  46.  
  47. }
  48. }
  49. }
Advertisement
Add Comment
Please, Sign In to add comment