Advertisement
Guest User

Untitled

a guest
May 26th, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6.  
  7. namespace pppp
  8. {
  9. class Program
  10. {
  11. static void Wypelnij(string[] Nazwiska, string[] Imiona, double[] Temperatura)
  12. {
  13. for(int i=0; i< Nazwiska.Length; i++)
  14. {
  15. Console.WriteLine("Podaj Nazwisko i Imię pacjenta:");
  16. string NazwiskoImie = Console.ReadLine();
  17. string[] NazwiskoImieRozdzielone = NazwiskoImie.Split(' ');
  18. Nazwiska[i] = NazwiskoImieRozdzielone[0];
  19. Imiona[i] = NazwiskoImieRozdzielone[1];
  20.  
  21. Console.WriteLine("Podaj Temperaturę:");
  22. Temperatura[i] = double.Parse(Console.ReadLine());
  23. }
  24.  
  25. }
  26.  
  27. static void Wyswietl(string[] Nazwiska, string[] Imiona, double[] Temperatura)
  28. {
  29.  
  30. //int LiczbaZdrowych = 0;
  31. //int LiczbaChorych = 0;
  32.  
  33. for (int i = 0; i < Nazwiska.Length; i++)
  34. {
  35.  
  36. if (Temperatura[i] < 37)
  37.  
  38. Console.WriteLine("\n{0}. {1}\t{2}\n\nTemperatura:\t{3} stopni\n\nPacjent jest zdrowy, temperatura w normie.", i + 1, Imiona[i], Nazwiska[i], Temperatura[i]);
  39.  
  40. // LiczbaZdrowych++;
  41.  
  42.  
  43. else
  44.  
  45.  
  46. Console.WriteLine("\n{0}. {1}\t{2}\n\nTemperatura:\t{3} stopni\n\nPacjent jest chory, temperatura podwyższona.", i + 1, Imiona[i], Nazwiska[i], Temperatura[i]);
  47.  
  48. // LiczbaChorych++;
  49. }
  50.  
  51. //Console.WriteLine("\n");
  52. //Console.WriteLine("Osób z temperaturą: \n\t podwyższoną: {0}\n\t normalną jest: {1}");
  53. }
  54.  
  55.  
  56.  
  57.  
  58. static void Main(string[] args)
  59. {
  60.  
  61. Console.WriteLine("Podaj liczbę pacjentów:");
  62. int LiczbaPacjentow = int.Parse(Console.ReadLine());
  63. string[] Nazwiska = new string[LiczbaPacjentow];
  64. string[] Imiona = new string[LiczbaPacjentow];
  65. double[] Temperatura = new double[LiczbaPacjentow];
  66.  
  67.  
  68. Wypelnij(Nazwiska, Imiona, Temperatura);
  69.  
  70. Console.Clear();
  71.  
  72. Wyswietl(Nazwiska, Imiona, Temperatura);
  73. Console.ReadKey();
  74. }
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement