-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainPM.java
More file actions
58 lines (48 loc) · 1.68 KB
/
MainPM.java
File metadata and controls
58 lines (48 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package Paquete;
import Paquete.Q;
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author acer
*/
public class MainPM {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner xleer=new Scanner(System.in);
System.out.println("Ingrese el tamaño n de las matrices (nxn)");
int n=xleer.nextInt();
System.out.println("Ingrese el grado del primer polinomio");
int g=xleer.nextInt();
System.out.println("Ingrese el grado del segundo polinomio");
int k=xleer.nextInt();
Poli P = new Poli(g,n), Q= new Poli(k,n), R= new Poli(g,n);
Mat A=new Mat(n), B=new Mat(n);
P.leePoli(g,n);
Q.leePoli(k,n);
A.leeMat(n);
System.out.println("El primer polinomio es:");
P.escPoli();System.out.println();
System.out.println("El segundo polinomio es:");
Q.escPoli();System.out.println();
System.out.println("La matriz ingresada es:");
A.escMat();System.out.println();
System.out.println("La suma es:");
R=Q.sumaPoli(P);
R.escPoli();
System.out.println("El producto es:");
R=Q.prodPoli(P);
R.escPoli();
System.out.println("El primer polinomio evaluado en A es:");
B=P.evaluaPoli(A);
B.escMat();
System.out.println("Fin del programa.");
}
}