Preview only show first 10 pages with watermark. For full document please download

Técnicas De Programação - Matrizestest

Trabalhos realizados na disciplina

   EMBED


Share

Transcript

import java.util.*;,,,,, ,,,,, public class MatrizesTest,,,,, { ,,,,, ,,,,, public static void main(String[] args),,,,, {,,,,, ,,,,, Scanner input = new Scanner(System.in);,,,,, ,,,,, int a, b, c, d, i, j; // PREENCHENDO AS DIMENSÕES,,,,, " System.out.print(""Digite o núemro de LINHAS: "");",,,,, a = input.nextInt();,,,,, " System.out.print(""Digite o núemro de COLUNAS: "");",,,,, b = input.nextInt();,,,,, ,,,,, " System.out.print(""Digite o núemro de LINHAS: "");",,,,, c = input.nextInt();,,,,, " System.out.print(""Digite o núemro de COLUNAS: "");",,,,, d = input.nextInt();,,,,, ,,,,, double A[][] = new double[a][b];,,,,, double B[][] = new double[c][d];,,,,, ,,,,, " System.out.print(""\nPREENCHIMENTO DA 1º MATRIZ\n\n"");",,,,, ,,,,, for(i = 0; i < a; i++){,,,,, for(j = 0; j < b; j++){,,,,, ,,,,, " System.out.printf(""Digite o valor de A[%d][%d]: , i, j); A[i][j] = input.nextDouble(); } } System.out.print(""\nPREENCHIMENTO DA 2º MATRIZ\n\n""); for(i = 0; i < c; i++) { for(j = 0; j < d; j++) { System.out.printf(""Digite o valor de B[%d][%d]: ", i, j);,,, B[i][j] = input.nextDouble();,,,,, },,,,, },,,,, ,,,,, // Metódo STATIC NÃO PRECISA O USO DE OBJETO PARA A CHAMADA ! ,,,,, Matrizes.somaMatrizes(A, B);,,,, ,,,,, Matrizes.multMatrizes(A, B);,,,, },,,,, },,,,,