-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultiplication.java
More file actions
31 lines (28 loc) · 829 Bytes
/
Multiplication.java
File metadata and controls
31 lines (28 loc) · 829 Bytes
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
/**
* An Integer Multiplication.
*
* @author Mak Fazlic & Roberto Ferrari - Latex project.
* @version v1.0
*/
public class Multiplication extends Node
{
// instance variables
private final Node leftChild;
private final Node rightChild;
/**
* Constructor for objects of class Multiplication.
*
* @param leftChild is a Node which represents the first factor.
* @param rightChild is a Node which represents the second factor.
*/
public Multiplication(final Node leftChild, final Node rightChild) {
super();
this.leftChild = leftChild;
this.rightChild = rightChild;
}
@Override
// Returns Latex of Multiplication
public String toLatex() {
return "{\\left(" + leftChild.toLatex() + "*" + rightChild.toLatex() + "\\right)}";
}
}