-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsimple.java
More file actions
47 lines (39 loc) · 1.06 KB
/
simple.java
File metadata and controls
47 lines (39 loc) · 1.06 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
/*
* 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.
*/
package textoSecreto;
/**
*
* @author danielsalnikov
*/
public class simple extends Bonos{
public simple(String n, double d, double i, int a, String t) {
super(n, d, i, a, t);
}
@Override
public double Rendimiento() {
return (this.valPrinc*this.interes*this.duracion)+this.valPrinc;
}
@Override
public double utilidad() {
return Rendimiento()-this.valPrinc;
}
@Override
public String toString() {
return "Bond: "+nombre+"\n"
+"Principal: $"+this.valPrinc+"\n"
+"Interest rate (decimal): "+this.interes+"\n"
+"Duration: "+this.duracion+" years\n"
+"Type: "+this.tipo+"\n\n";
}
@Override
public String getNombre() {
return nombre;
}
@Override
public void setNombre(String nombre){
this.nombre=nombre;
}
}