Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.36 KB | None | 0 0
  1. Dim s, size As String
  2. s = InputBox("Valor (℃)")
  3. If paciente1.Count = 15 Then
  4. MsgBox("Todas as temperaturas foram inseridas")
  5. Return
  6. End If
  7.  
  8.  
  9.  
  10. If s < 35 Or s > 43 Then
  11. MsgBox("erro")
  12. Return
  13. End If
  14.  
  15. If IsNumeric(s) Then
  16. If paciente1.Count > 0 Then
  17.  
  18. Dim d, anterior As Decimal
  19. anterior = paciente1.Item(paciente1.Count - 1)
  20. d = s
  21.  
  22. If d > anterior Then
  23. MsgBox("A Temperatura aumentou")
  24. If d > 38 Then
  25. MsgBox("Alerta, Temperatura superior a 38℃!")
  26. End If
  27. Size = paciente1.Count()
  28. If Size > 3 Then
  29. If paciente1(Size) > paciente1(Size - 1) And paciente1(Size - 1) > paciente1(Size - 2) Then
  30. MsgBox("que calor")
  31. End If
  32. End If
  33. ElseIf d < anterior Then
  34. MsgBox("A Temperatura diminui")
  35. If d > 38 Then
  36. MsgBox("Alerta, Temperatura superior a 38℃!")
  37. End If
  38. Else
  39. MsgBox("A Temparatura manteve-se")
  40. If d > 38 Then
  41. MsgBox("Alerta, Temperatura superior a 38℃!")
  42. End If
  43. End If
  44.  
  45. End If
  46. paciente1.Add(s)
  47. Else
  48. MsgBox("Não é o número")
  49. End If
  50. End Sub
  51.  
  52. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  53. Dim s As String
  54. Dim d As Decimal
  55. s = ""
  56. For Each d In paciente1
  57. s += d.ToString + ", "
  58. Next
  59. MsgBox(s)
  60. End Sub
  61.  
  62. Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  63. Dim n As Integer
  64. Dim s As String
  65. Dim size As Integer
  66. s = ""
  67. size = paciente1.Count
  68. n = InputBox("Quantos?")
  69. n = size - n
  70. If n < 0 Then
  71. n = 0
  72. End If
  73. While n < size
  74. s += paciente1.Item(n).ToString + ", "
  75. n = n + 1
  76. End While
  77. s = s.Remove(s.Count - 2, 2)
  78. MsgBox(s)
  79. End Sub
  80.  
  81. Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  82.  
  83. Dim max, min, total As Decimal
  84. If paciente1.Count > 0 Then
  85. max = paciente1.Item(0)
  86. min = max
  87. For Each i In paciente1
  88. If max > i Then
  89. max = i
  90. End If
  91. If min < i Then
  92. min = i
  93. End If
  94. total += i
  95.  
  96. Next
  97.  
  98.  
  99. MsgBox("Máximo (℃): " + max.ToString + Chr(13) +
  100. "Mínimo (℃): " + min.ToString + Chr(13) +
  101. "Média (℃): " + (total / paciente1.Count).ToString + Chr(13) +
  102. "Média das Temperaturas correspondentes às 3 últimas horas:" + (sum) / paciente1.Count.ToString
  103. )
  104. End If
  105.  
  106. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement