정보처리 기사 문제집 141 페이지
DefSng A-Z Dim a(10), b(10), c(10), d(10), e(10) As String, pc Private Sub Command1_Click() pc = pc + 1 a(pc) = Text1.Text b(pc) = Text2.Text c(pc) = Text3.Text Text1.Text = "" Text2.Text = "" Text3.Text = "" Text1.SetFocus End Sub Private Sub Command2_Click() For i = 1 To pc d(i) = c(i) / (b(i) - 100) * 0.9 * 100 Select Case d(i) Case Is <= 110: e(i) = "정상" Case 111 To 119: e(i) = "과체중" Case Is >= 120: e(i) = "비만": over = over + 1 End Select Next f = over / pc * 100 Form1.Hide Form2.Show Form2.Print "번호", "신장", "몸무게", "비만율", "판정" For i = 1 To pc Form2.Print a(i), b(i), c(i), Format(d(i), "###.0"), e(i) Next Form2.Print "비만 인원수: "; over, "비만율: "; Format(f, "###.0"); "%" End Sub