Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 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. namespace CaloriesCounter
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. var productCount = int.Parse(Console.ReadLine());
  13. string product;
  14. var calls = 0;
  15. for (int i = 0; i <productCount; i++)
  16. {
  17. product = Console.ReadLine().ToLower();
  18. switch (product)
  19. {
  20. case "cheese": calls += 500; break;
  21. case "tomato sauce": calls += 150; break;
  22. case "salami": calls += 600; break;
  23. case "pepper": calls += 50; break;
  24. }
  25. }
  26. Console.WriteLine($"Total calories: {calls}");
  27.  
  28.  
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement