Advertisement
aneliabogeva

Untitled

Mar 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 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 = 0; 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. default:
  36.  
  37. break;
  38. }
  39.  
  40. if (salary <= 0)
  41. {
  42. Console.WriteLine($"You have lost your salary.");
  43. i = n;
  44.  
  45. }
  46. }
  47. Console.WriteLine(salary);
  48. }
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement