Advertisement
Guest User

Untitled

a guest
Sep 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.33 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 ConsoleApp12
  8. {
  9. class Program
  10. {
  11. public static int FahrToCels(int fahr)
  12. {
  13. int cel = (fahr - 32) * 5 / 9;
  14. return cel;
  15. }
  16. static void Main(string[] args)
  17. {
  18. int a = 0;
  19. do
  20. {
  21. Console.WriteLine("Skriv in Fahrenheit : ");
  22. int fahrenheit = int.Parse(Console.ReadLine());
  23. int celsius = FahrToCels(fahrenheit);
  24. Console.WriteLine($"det är {celsius} grader varmt");
  25. if (celsius < 73)
  26. {
  27. Console.WriteLine("Its to cold! turn up the heat to reach optimal heat");
  28. }
  29. else if (celsius > 77)
  30. {
  31. Console.WriteLine("Its to hot to enjoy, please turn down the heat a bit");
  32. }
  33. else if (celsius == 75)
  34. {
  35. Console.WriteLine("The temperature is now perfect! Please enjoy the sauna.");
  36. }
  37.  
  38. } while (a == 5);
  39.  
  40.  
  41. Console.WriteLine("press any key to continue . . . ");
  42. Console.ReadKey(true);
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement