terça-feira, 30 de novembro de 2010

ficha numero 14 exercicio 5

Private Sub Command1_Click()
Dim x As Integer, y As Integer, mat(1 To 3, 1 To 4) As Integer, soma1(1 To 3) As Integer, soma2(1 To 4) As Integer, somatotal As Integer

Randomize

For x = 1 To 3
For y = 1 To 4
mat(x, y) = Val(InputBox("Introduza a venda do " & x & "º vendedor no " & y & "º trimestre"))
Next y
Next x

For x = 1 To 3
For y = 1 To 4
Picture1.Print mat(x, y);
Next y
Picture1.Print Chr(13)
Next x

somatotal = 0

For x = 1 To 3
For y = 1 To 4
soma1(x) = soma1(x) + mat(x, y)
somatotal = somatotal + mat(x, y)
Next y
Next x


For y = 1 To 4
For x = 1 To 3
soma2(y) = soma2(y) + mat(x, y)
Next x
Next y

For x = 1 To 3
Picture2.Print soma1(x)
Next x

For y = x To 4
Picture3.Print soma2(y)
Next y
Picture4.Print somatotal
   
End Sub

Private Sub Command2_Click()
If MsgBox("Quer mesmo sair?", vbOKCancel + vbQuestion, "ATENÇÃO") Then
End
End If
End Sub



Sem comentários:

Enviar um comentário