You are on page 1of 6

.

println(": "+dz);

ob1.a3();

System.out.println("---->Imprimiremos El sistema de Ecuaciones------------<");

System.out.println("");

ob1.sistema(x1,y1, z1,y2,z2, z3);

int[][] mat = new int[3][3];

ob1.llenado(mat, x1, y1, z1, y2, z2, z3);

System.out.println("Determinante de la matriz principal : ");

det=ob1.det(x1, y2, z3);

int [] array = new int[3];

ob1.arr(array);

System.out.println("\nDeterminante de la variable'x' : ");

dx=ob1.hdx(mat, array);

System.out.println("Determinante de la variable'y' : ");

dy=ob1.hdy(mat, array);

System.out.println("Determinante de la variable'z' : ");

dz=ob1.hdz(mat, array);

System.out.println("---<<Hallando resultados finales>>---");

ob1.rf(det, dx, dy, dz);

Compilación
run:

Ingrese coef.variable X

Ingrese coef.variable Y

Ingrese coef.variable Z

Ingrese coef.variable Y

Ingrese coef.variable Z

Ingrese coef.variable Z

---->Imprimiremos El sistema de Ecuaciones------------<

5X + 6Y + 4Z = 1

1Y + 9Z = 6

5Z = 8

Determinante de la matriz principal :

: 25

Determinante de la variable'x' :

: 225

Determinante de la variable'y' :

: -210

Determinante de la variable'z' :

: 40

---<<Hallando resultados finales>>---

Valor de x: 9.0

Valor de y: -8.4

Valor de z: 1.6
BUILD SUCCESSFUL (total time: 11 seconds)

Problema 4
package javaapplication5;

import java.util.Scanner;

public class Problema4 {

Scanner sc = new Scanner(System.in);

public void nombres(String array[]){

System.out.println("Ingrese los nombres de los alumnos: ");

for(int i=0;i<4;i++){

array[i]=sc.nextLine();

public void notas(String arrnot1[]){

System.out.println("Ingrese las notas de los alumnos: ");

for(int i=0;i<4;i++){

arrnot1[i]=sc.nextLine();

public void pasar(String array[] , String arrnot1[] , String matriz[][]){

matriz[0][0]=array[0];

matriz[1][0]=array[1];

matriz[2][0]=array[2];

matriz[3][0]=array[3];
matriz[0][1]=" 10.2 ";//Conversion de Decimal a String

matriz[1][1]="11.4";//Conversion de Decimal a String

matriz[2][1]="12.8";//Conversion de Decimal a String

matriz[3][1]="14.6";//Conversion de Decimal a String

public void mostrar1(String matriz[][]){

for(int i=0;i<4;i++){

for(int j=0;j<2;j++){

System.out.print(" "+matriz[i][j]);

}System.out.println("");

public void ordenar(String matriz[][]){

System.out.print(matriz[3][0]+" : "+matriz[3][1]);

System.out.println("");

System.out.print(matriz[2][0]+" : "+matriz[2][1]);

System.out.println("");

System.out.print(matriz[1][0]+" : "+matriz[1][1]);

System.out.println("");

System.out.print(matriz[0][0]+" : "+matriz[0][1]);

System.out.println("");

package javaapplication5;
public class Principal4 {

public static void main(String[] args) {

Problema4 ob1 = new Problema4();

String [] array = new String[4];

String [] arrnot1 = new String[4];

double [] arrnot2=new double[4];

String [][] matriz = new String[4][4];

ob1.nombres(array);

ob1.pasar(array, arrnot1, matriz);

System.out.println("----->Las notas con nombres son : ");

ob1.mostrar1(matriz);

System.out.println("------>Notas ordenadas son : ");

ob1.ordenar(matriz);

Compilación
run:

Ingrese los nombres de los alumnos:

jairo

luis

abel

juan

----->Las notas con nombres son :

jairo 10.2

luis 11.4
abel 12.8

juan 14.6

------>Notas ordenadas son :

juan : 14.6

abel : 12.8

luis : 11.4

jairo : 10.2

BUILD SUCCESSFUL (total time: 10 seconds)

You might also like