Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 10 additions & 13 deletions SimpleCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
*
* @author Neel Shah (github.com/nks5295)
* @author Phil Lopreiato (github.com/phil-lopreiato)
* @version 1.0
* @author Brandon Bernier (github.com/bbernier10)
* @version 1.0.1
*
*/
public class SimpleCalculator {
Expand Down Expand Up @@ -48,16 +49,16 @@ public static void main(String[] args) {

switch (operand) {
case "+":
// TODO: Add the numbers
add(num1,num2);
break;
case "-":
// TODO: Subtract the numbers
subtract(num1,num2);
break;
case "*":
// TODO: Multiply the numbers
multiply(num1,nume2);
break;
case "/":
// TODO: Divide the numbers
divide(num1,num2);
break;
default:
System.out.println("Not a valid operand, try again.");
Expand Down Expand Up @@ -85,8 +86,7 @@ public static void main(String[] args) {
* @return An integer that is the sum of the arguments
*/
private int add(int num1, int num2) {
// TODO: Complete this method
return 0;
return num1 + num2;
}

/**
Expand All @@ -96,8 +96,7 @@ private int add(int num1, int num2) {
* @return An integer that is the difference of the arguments
*/
private int subtract(int num1, int num2) {
// TODO: Complete this method
return 0;
return num1 - num2;
}

/**
Expand All @@ -107,8 +106,7 @@ private int subtract(int num1, int num2) {
* @return an integer that is the product of the arguments
*/
private int multiply(int num1, int num2) {
// TODO: Complete this method
return 0;
return num1*num2;
}

/**
Expand All @@ -122,8 +120,7 @@ private int multiply(int num1, int num2) {
* @return An integer that is the quotient of the arguments
*/
private int divide(int num1, int num2) {
// TODO: Complete this method
return 0;
return num1/num2;
}

}