Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dim s, size As String
- s = InputBox("Valor (℃)")
- If paciente1.Count = 15 Then
- MsgBox("Todas as temperaturas foram inseridas")
- Return
- End If
- If s < 35 Or s > 43 Then
- MsgBox("erro")
- Return
- End If
- If IsNumeric(s) Then
- If paciente1.Count > 0 Then
- Dim d, anterior As Decimal
- anterior = paciente1.Item(paciente1.Count - 1)
- d = s
- If d > anterior Then
- MsgBox("A Temperatura aumentou")
- If d > 38 Then
- MsgBox("Alerta, Temperatura superior a 38℃!")
- End If
- Size = paciente1.Count()
- If Size > 3 Then
- If paciente1(Size) > paciente1(Size - 1) And paciente1(Size - 1) > paciente1(Size - 2) Then
- MsgBox("que calor")
- End If
- End If
- ElseIf d < anterior Then
- MsgBox("A Temperatura diminui")
- If d > 38 Then
- MsgBox("Alerta, Temperatura superior a 38℃!")
- End If
- Else
- MsgBox("A Temparatura manteve-se")
- If d > 38 Then
- MsgBox("Alerta, Temperatura superior a 38℃!")
- End If
- End If
- End If
- paciente1.Add(s)
- Else
- MsgBox("Não é o número")
- End If
- End Sub
- Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
- Dim s As String
- Dim d As Decimal
- s = ""
- For Each d In paciente1
- s += d.ToString + ", "
- Next
- MsgBox(s)
- End Sub
- Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
- Dim n As Integer
- Dim s As String
- Dim size As Integer
- s = ""
- size = paciente1.Count
- n = InputBox("Quantos?")
- n = size - n
- If n < 0 Then
- n = 0
- End If
- While n < size
- s += paciente1.Item(n).ToString + ", "
- n = n + 1
- End While
- s = s.Remove(s.Count - 2, 2)
- MsgBox(s)
- End Sub
- Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
- Dim max, min, total As Decimal
- If paciente1.Count > 0 Then
- max = paciente1.Item(0)
- min = max
- For Each i In paciente1
- If max > i Then
- max = i
- End If
- If min < i Then
- min = i
- End If
- total += i
- Next
- MsgBox("Máximo (℃): " + max.ToString + Chr(13) +
- "Mínimo (℃): " + min.ToString + Chr(13) +
- "Média (℃): " + (total / paciente1.Count).ToString + Chr(13) +
- "Média das Temperaturas correspondentes às 3 últimas horas:" + (sum) / paciente1.Count.ToString
- )
- End If
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement