SlideShare une entreprise Scribd logo
1  sur  8
Republica bolivariana de Venezuela Universidad Pedagógica experimental “Libertador”Instituto Pedagógico  “Luis Beltrán Prieto Figueroa”          Barquisimeto Estado-Lara     Matriz  Escalar Diagonal Autores: Pedro Prado Nohemy Lugo
Matriz escalar.        Una matriz escalar es una matriz diagonal en la que los elementos de la diagonal principal son iguales. Ejemplo: Elaborar  un programa  donde muestre un mensaje que identifique la matriz escalar.
Ejercicio de una Matriz  Escalar Diagonal unit Unit1; interface uses   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,   Dialogs, StdCtrls, Grids; type   TForm1 = class(TForm)     StringGrid1: TStringGrid;     Butcargar: TButton;     Butsalir: TButton;     Butmostrar: TButton;     procedure ButcargarClick(Sender: TObject);     procedure ButsalirClick(Sender: TObject);     procedure ButmostrarClick(Sender: TObject);
private     { Private declarations }   public     { Public declarations }   end; var   Form1: TForm1;   matriz: array [1..3,1..3] of integer;   i,j:integer;   columna,flia:array[1..3,1..3] of integer; implementation {$R *.dfm} Variables del ejercicio
Botón Cargar procedure TForm1.ButcargarClick(Sender: TObject); begin for i:=1 to 3 do for j:=1 to 3 do  begin  matriz[j,i]:= strtoint(inputbox('ingrese numero','numero',''));  stringgrid1.Cells[j-1,i-1]:=inttostr(matriz[j,i]);   end;   end;
Botón  mostrar  procedure TForm1.ButmostrarClick(Sender: TObject); var cont:integer; cont2:integer; begin stringgrid1.Colcount:=3; stringgrid1.RowCount:=3; i:=0; j:=0; cont:=0; cont2:=0; for i:=1 to 3 do for j:=1 to 3 do begin if ((matriz[i,i])<>0) then begin cont:=cont+1; end;
if (i<>j) and (matriz[i,j]=0) and (matriz[j,i]=0) then begin cont2:=cont2+1; //stringgrid1.cells[j-i,i-j]:= inttostr(matriz[i,j]); end; end; if (cont2=6) and (cont=9) then begin showmessage ('la matriz escalar diagonal'); end; if (cont <9) then begin showmessage('la matriz no es escalar diagonal'); end else if (cont2 <> 6) then begin showmessage ('la matriz no es escalar diagonal'); end; end; end.
Formulario del Programa Botón  Procedure Salir Botón del Procedure Cargar Botón Procedure Mostrar. StringGrid

Contenu connexe

En vedette (10)

Hak anak dalam islam pembentangan
Hak anak dalam islam pembentanganHak anak dalam islam pembentangan
Hak anak dalam islam pembentangan
 
Physical science Game jeopardy
Physical science Game jeopardyPhysical science Game jeopardy
Physical science Game jeopardy
 
กลุ่ม2
กลุ่ม2กลุ่ม2
กลุ่ม2
 
Kaedah pendidikan islam (al quran)
Kaedah pendidikan islam (al quran)Kaedah pendidikan islam (al quran)
Kaedah pendidikan islam (al quran)
 
Rph zakat firah (2)
Rph zakat firah (2)Rph zakat firah (2)
Rph zakat firah (2)
 
Mixture & solutions ppt
Mixture & solutions pptMixture & solutions ppt
Mixture & solutions ppt
 
Presentation1
Presentation1Presentation1
Presentation1
 
تمييز
تمييزتمييز
تمييز
 
Slide taranum
Slide taranumSlide taranum
Slide taranum
 
Perjanjian Hudaibiyah
Perjanjian HudaibiyahPerjanjian Hudaibiyah
Perjanjian Hudaibiyah
 

Dernier

ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLAACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLAJAVIER SOLIS NOYOLA
 
Lecciones 07 Esc. Sabática. Motivados por la esperanza
Lecciones 07 Esc. Sabática. Motivados por la esperanzaLecciones 07 Esc. Sabática. Motivados por la esperanza
Lecciones 07 Esc. Sabática. Motivados por la esperanzaAlejandrino Halire Ccahuana
 
RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...
RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...
RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...helmer del pozo cruz
 
Realitat o fake news? – Què causa el canvi climàtic? - La desertització
Realitat o fake news? – Què causa el canvi climàtic? - La desertitzacióRealitat o fake news? – Què causa el canvi climàtic? - La desertització
Realitat o fake news? – Què causa el canvi climàtic? - La desertitzacióPere Miquel Rosselló Espases
 
Apunte clase teorica propiedades de la Madera.pdf
Apunte clase teorica propiedades de la Madera.pdfApunte clase teorica propiedades de la Madera.pdf
Apunte clase teorica propiedades de la Madera.pdfGonella
 
Síndrome piramidal 2024 según alvarez, farrera y wuani
Síndrome piramidal 2024 según alvarez, farrera y wuaniSíndrome piramidal 2024 según alvarez, farrera y wuani
Síndrome piramidal 2024 según alvarez, farrera y wuanishflorezg
 
Tema 9. Roma. 1º ESO 2014. Ciencias SOciales
Tema 9. Roma. 1º ESO 2014. Ciencias SOcialesTema 9. Roma. 1º ESO 2014. Ciencias SOciales
Tema 9. Roma. 1º ESO 2014. Ciencias SOcialesChema R.
 
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docxcuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docxANDREAGRACEDURANSALA
 
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdfEstrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdfDemetrio Ccesa Rayme
 
POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...
POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...
POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...Agrela Elvixeo
 
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesisnovelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesisPsicClinGlendaBerrez
 
ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...
ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...
ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...MarcoAntonioAmayaSag
 
2. Entornos Virtuales de Aprendizaje.pptx
2. Entornos Virtuales de Aprendizaje.pptx2. Entornos Virtuales de Aprendizaje.pptx
2. Entornos Virtuales de Aprendizaje.pptxJunkotantik
 
ACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLA
ACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLAACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLA
ACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLAJAVIER SOLIS NOYOLA
 
GOBIERNO DE MANUEL ODRIA EL OCHENIO.pptx
GOBIERNO DE MANUEL ODRIA   EL OCHENIO.pptxGOBIERNO DE MANUEL ODRIA   EL OCHENIO.pptx
GOBIERNO DE MANUEL ODRIA EL OCHENIO.pptxJaimeAlvarado78
 
TEMA EGIPTO.pdf. Presentación civilización
TEMA EGIPTO.pdf. Presentación civilizaciónTEMA EGIPTO.pdf. Presentación civilización
TEMA EGIPTO.pdf. Presentación civilizaciónVasallo1
 

Dernier (20)

ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLAACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
ACERTIJO EL NÚMERO PI COLOREA EMBLEMA OLÍMPICO DE PARÍS. Por JAVIER SOLIS NOYOLA
 
Lecciones 07 Esc. Sabática. Motivados por la esperanza
Lecciones 07 Esc. Sabática. Motivados por la esperanzaLecciones 07 Esc. Sabática. Motivados por la esperanza
Lecciones 07 Esc. Sabática. Motivados por la esperanza
 
RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...
RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...
RESOLUCION_VICE_MINISTERIAL-00048-2024-M-EVALUACIÓN EVALAUCION FORMATIVA MINE...
 
Realitat o fake news? – Què causa el canvi climàtic? - La desertització
Realitat o fake news? – Què causa el canvi climàtic? - La desertitzacióRealitat o fake news? – Què causa el canvi climàtic? - La desertització
Realitat o fake news? – Què causa el canvi climàtic? - La desertització
 
Apunte clase teorica propiedades de la Madera.pdf
Apunte clase teorica propiedades de la Madera.pdfApunte clase teorica propiedades de la Madera.pdf
Apunte clase teorica propiedades de la Madera.pdf
 
Síndrome piramidal 2024 según alvarez, farrera y wuani
Síndrome piramidal 2024 según alvarez, farrera y wuaniSíndrome piramidal 2024 según alvarez, farrera y wuani
Síndrome piramidal 2024 según alvarez, farrera y wuani
 
La historia de la vida estudiantil a 102 años de la fundación de las Normales...
La historia de la vida estudiantil a 102 años de la fundación de las Normales...La historia de la vida estudiantil a 102 años de la fundación de las Normales...
La historia de la vida estudiantil a 102 años de la fundación de las Normales...
 
Tema 9. Roma. 1º ESO 2014. Ciencias SOciales
Tema 9. Roma. 1º ESO 2014. Ciencias SOcialesTema 9. Roma. 1º ESO 2014. Ciencias SOciales
Tema 9. Roma. 1º ESO 2014. Ciencias SOciales
 
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docxcuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
cuadernillo_cuentos_de_los_valores_elprofe20 (1).docx
 
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdfEstrategia Nacional de Refuerzo Escolar  SJA  Ccesa007.pdf
Estrategia Nacional de Refuerzo Escolar SJA Ccesa007.pdf
 
POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...
POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...
POEMAS ILUSTRADOS DE LUÍSA VILLALTA. Elaborados polos alumnos de 4º PDC do IE...
 
TÉCNICAS OBSERVACIONALES Y TEXTUALES.pdf
TÉCNICAS OBSERVACIONALES Y TEXTUALES.pdfTÉCNICAS OBSERVACIONALES Y TEXTUALES.pdf
TÉCNICAS OBSERVACIONALES Y TEXTUALES.pdf
 
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesisnovelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
novelas-cortas--3.pdf Analisis introspectivo y retrospectivo, sintesis
 
ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...
ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...
ACTIVIDAD 19 Construyo mi identidad personal y familiar para fortalecer los v...
 
Sesión de clase Motivados por la esperanza.pdf
Sesión de clase Motivados por la esperanza.pdfSesión de clase Motivados por la esperanza.pdf
Sesión de clase Motivados por la esperanza.pdf
 
2. Entornos Virtuales de Aprendizaje.pptx
2. Entornos Virtuales de Aprendizaje.pptx2. Entornos Virtuales de Aprendizaje.pptx
2. Entornos Virtuales de Aprendizaje.pptx
 
ACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLA
ACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLAACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLA
ACERTIJO SOPA DE LETRAS OLÍMPICA. Por JAVIER SOLIS NOYOLA
 
Revista Faro Normalista 6, 18 de mayo 2024
Revista Faro Normalista 6, 18 de mayo 2024Revista Faro Normalista 6, 18 de mayo 2024
Revista Faro Normalista 6, 18 de mayo 2024
 
GOBIERNO DE MANUEL ODRIA EL OCHENIO.pptx
GOBIERNO DE MANUEL ODRIA   EL OCHENIO.pptxGOBIERNO DE MANUEL ODRIA   EL OCHENIO.pptx
GOBIERNO DE MANUEL ODRIA EL OCHENIO.pptx
 
TEMA EGIPTO.pdf. Presentación civilización
TEMA EGIPTO.pdf. Presentación civilizaciónTEMA EGIPTO.pdf. Presentación civilización
TEMA EGIPTO.pdf. Presentación civilización
 

Tarea para el_aula.[1]

  • 1. Republica bolivariana de Venezuela Universidad Pedagógica experimental “Libertador”Instituto Pedagógico “Luis Beltrán Prieto Figueroa” Barquisimeto Estado-Lara Matriz Escalar Diagonal Autores: Pedro Prado Nohemy Lugo
  • 2. Matriz escalar. Una matriz escalar es una matriz diagonal en la que los elementos de la diagonal principal son iguales. Ejemplo: Elaborar un programa donde muestre un mensaje que identifique la matriz escalar.
  • 3. Ejercicio de una Matriz Escalar Diagonal unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Grids; type TForm1 = class(TForm) StringGrid1: TStringGrid; Butcargar: TButton; Butsalir: TButton; Butmostrar: TButton; procedure ButcargarClick(Sender: TObject); procedure ButsalirClick(Sender: TObject); procedure ButmostrarClick(Sender: TObject);
  • 4. private { Private declarations } public { Public declarations } end; var Form1: TForm1; matriz: array [1..3,1..3] of integer; i,j:integer; columna,flia:array[1..3,1..3] of integer; implementation {$R *.dfm} Variables del ejercicio
  • 5. Botón Cargar procedure TForm1.ButcargarClick(Sender: TObject); begin for i:=1 to 3 do for j:=1 to 3 do begin matriz[j,i]:= strtoint(inputbox('ingrese numero','numero','')); stringgrid1.Cells[j-1,i-1]:=inttostr(matriz[j,i]); end; end;
  • 6. Botón mostrar procedure TForm1.ButmostrarClick(Sender: TObject); var cont:integer; cont2:integer; begin stringgrid1.Colcount:=3; stringgrid1.RowCount:=3; i:=0; j:=0; cont:=0; cont2:=0; for i:=1 to 3 do for j:=1 to 3 do begin if ((matriz[i,i])<>0) then begin cont:=cont+1; end;
  • 7. if (i<>j) and (matriz[i,j]=0) and (matriz[j,i]=0) then begin cont2:=cont2+1; //stringgrid1.cells[j-i,i-j]:= inttostr(matriz[i,j]); end; end; if (cont2=6) and (cont=9) then begin showmessage ('la matriz escalar diagonal'); end; if (cont <9) then begin showmessage('la matriz no es escalar diagonal'); end else if (cont2 <> 6) then begin showmessage ('la matriz no es escalar diagonal'); end; end; end.
  • 8. Formulario del Programa Botón Procedure Salir Botón del Procedure Cargar Botón Procedure Mostrar. StringGrid