SlideShare a Scribd company logo
1 of 5
Download to read offline
UNIVERSIDAD CENTRAL DEL ECUADOR
Facultad de Filosofía, Letras y Ciencias de la Educación
Jesus Alexander Haro Amaguaya
Dennis Williams Navarrete Cuaces
Informática, Tercero B
Programación III
Msc. Víctor Zapata
8 de enero de 2018
Arreglos
 Diseño
 Código
Public Class Form1
Dim f, c, val, par, imp, cer, un As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
f = InputBox("Ingrese el numero de filas", "Matriz 1")
c = InputBox("Ingrese el numero de columnas", "Matriz 1")
DataGridView1.RowCount = f
DataGridView1.ColumnCount = c
If ((f <> 0) And (c <> 0)) Then
For i = 0 To c - 1
DataGridView1.Columns(i).Width = 300 / c
Next
For j = 0 To f - 1
DataGridView1.Rows(j).Height = 225 / f
Next
Else
MsgBox("La matriz no puede ser de dimension 0, 0",
MsgBoxStyle.Critical, "Error")
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
For i = 0 To f - 1
For j = 0 To c - 1
val = InputBox("Ingrese el valor de: [" & i + 1 & ", " & j + 1 &
"]", "Ingreso")
DataGridView1.Rows(i).Cells(j).Value = val
Select Case val
Case 0
cer += 1
Case 1
un += 1
End Select
If (val Mod 2 = 0) Then
If val <> 0 Then
par += 1
End If
Else
imp += 1
End If
Next
Next
TextBox1.Text = par
TextBox2.Text = imp
TextBox3.Text = cer
TextBox4.Text = un
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button3.Click
For i = 0 To f - 1
For j = 0 To c - 1
val = 0
DataGridView1.Rows(i).Cells(j).Value = val
Next
Next
TextBox1.Text = ""
TextBox2.Text = ""
TextBox3.Text = ""
TextBox4.Text = ""
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button4.Click
End
End Sub
End Class
 Ejecución
Arreglos
Arreglos

More Related Content

Similar to Arreglos

Documento de altas
Documento de altasDocumento de altas
Documento de altas
alejandroDFK
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
gitagrimston
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
apleather
 
Inventory management
Inventory managementInventory management
Inventory management
Rajeev Sharan
 

Similar to Arreglos (13)

Documento de altas
Documento de altasDocumento de altas
Documento de altas
 
Ann
AnnAnn
Ann
 
Review questions and answers
Review questions and answersReview questions and answers
Review questions and answers
 
Leip103
Leip103Leip103
Leip103
 
Exceptional exceptions
Exceptional exceptionsExceptional exceptions
Exceptional exceptions
 
Method overloading in java
Method overloading in javaMethod overloading in java
Method overloading in java
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
Form1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdfForm1.csusing System; using System.Collections.Generic; using .pdf
Form1.csusing System; using System.Collections.Generic; using .pdf
 
Java file
Java fileJava file
Java file
 
Java file
Java fileJava file
Java file
 
Second chapter-java
Second chapter-javaSecond chapter-java
Second chapter-java
 
Inventory management
Inventory managementInventory management
Inventory management
 
Utility.ppt
Utility.pptUtility.ppt
Utility.ppt
 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 

Recently uploaded (20)

Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

Arreglos

  • 1. UNIVERSIDAD CENTRAL DEL ECUADOR Facultad de Filosofía, Letras y Ciencias de la Educación Jesus Alexander Haro Amaguaya Dennis Williams Navarrete Cuaces Informática, Tercero B Programación III Msc. Víctor Zapata 8 de enero de 2018 Arreglos  Diseño  Código Public Class Form1 Dim f, c, val, par, imp, cer, un As Integer
  • 2. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click f = InputBox("Ingrese el numero de filas", "Matriz 1") c = InputBox("Ingrese el numero de columnas", "Matriz 1") DataGridView1.RowCount = f DataGridView1.ColumnCount = c If ((f <> 0) And (c <> 0)) Then For i = 0 To c - 1 DataGridView1.Columns(i).Width = 300 / c Next For j = 0 To f - 1 DataGridView1.Rows(j).Height = 225 / f Next Else MsgBox("La matriz no puede ser de dimension 0, 0", MsgBoxStyle.Critical, "Error") End If End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click For i = 0 To f - 1 For j = 0 To c - 1 val = InputBox("Ingrese el valor de: [" & i + 1 & ", " & j + 1 & "]", "Ingreso") DataGridView1.Rows(i).Cells(j).Value = val Select Case val Case 0 cer += 1 Case 1 un += 1 End Select If (val Mod 2 = 0) Then If val <> 0 Then par += 1 End If Else imp += 1 End If Next Next TextBox1.Text = par TextBox2.Text = imp TextBox3.Text = cer TextBox4.Text = un End Sub Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click For i = 0 To f - 1 For j = 0 To c - 1 val = 0 DataGridView1.Rows(i).Cells(j).Value = val Next
  • 3. Next TextBox1.Text = "" TextBox2.Text = "" TextBox3.Text = "" TextBox4.Text = "" End Sub Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click End End Sub End Class  Ejecución