Guest User

Untitled

a guest
Apr 25th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. string eingabe;
  13. double drehzahl, deltan, sollwert, abweichung;
  14.  
  15. //sollwert **********************
  16. Console.Write("\n Drehzahlsollwert in 1/min?\t");
  17. eingabe = Console.ReadLine();
  18. sollwert = Convert.ToDouble(eingabe);
  19.  
  20. //istdrehzahl******************
  21.  
  22. Console.Write("\n Istdrehzahl in 1/min?\t");
  23. eingabe = Console.ReadLine();
  24. drehzahl = Convert.ToDouble(eingabe);
  25.  
  26. //delta n **********************
  27. Console.Write("\n Delta_N in 1/min?\t");
  28. eingabe = Console.ReadLine();
  29. deltan = Convert.ToDouble(eingabe);
  30.  
  31. abweichung = sollwert - drehzahl;
  32. if (abweichung<0)
  33. {
  34. abweichung = abweichung * -1;
  35. }
  36.  
  37. if(abweichung<=deltan)
  38. {
  39. Console.WriteLine("\n Grüner Bereich“");
  40. }
  41.  
  42. if (abweichung>deltan && abweichung <= deltan*2)
  43. {
  44. Console.WriteLine("\n Gelber Bereich“");
  45. }
  46.  
  47. if (abweichung>deltan*2)
  48. {
  49. Console.WriteLine("\n Roter Bereich“");
  50. }
  51. }
  52. }
  53. }
Add Comment
Please, Sign In to add comment