Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Danbranch #90

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public class MathUtilities {
* @return sum of `baseValue` and `difference`
*/
public Integer add(int baseValue, int difference) {
return null;
//adding two value in the para
return baseValue + difference;
}

/**
Expand All @@ -20,7 +21,8 @@ public Integer add(int baseValue, int difference) {
* @return sum of `baseValue` and `difference`
*/
public Long add(long baseValue, long difference) {
return null;

return baseValue + difference;
}

/**
Expand All @@ -29,7 +31,9 @@ public Long add(long baseValue, long difference) {
* @return sum of `baseValue` and `difference`
*/
public Short add(short baseValue, short difference) {
return null;

return (short)(baseValue + difference);

}

/**
Expand All @@ -38,7 +42,8 @@ public Short add(short baseValue, short difference) {
* @return sum of `baseValue` and `difference`
*/
public Byte add(byte baseValue, byte difference) {
return null;

return (byte)(baseValue + difference);
}

/**
Expand All @@ -47,7 +52,8 @@ public Byte add(byte baseValue, byte difference) {
* @return sum of `baseValue` and `difference`
*/
public Float add(float baseValue, float difference) {
return null;

return (float)(baseValue + difference);
}

/**
Expand All @@ -56,7 +62,8 @@ public Float add(float baseValue, float difference) {
* @return sum of `baseValue` and `difference`
*/
public Double add(double baseValue, double difference) {
return null;

return (double)(baseValue + difference);
}

/**
Expand All @@ -65,7 +72,8 @@ public Double add(double baseValue, double difference) {
* @return difference between `baseValue` and `difference`
*/
public Integer subtract(int baseValue, int difference) {
return null;

return baseValue - difference;
}

/**
Expand All @@ -74,7 +82,8 @@ public Integer subtract(int baseValue, int difference) {
* @return difference between `baseValue` and `difference`
*/
public Long subtract(long baseValue, long difference) {
return null;

return baseValue - difference;
}

/**
Expand All @@ -83,7 +92,8 @@ public Long subtract(long baseValue, long difference) {
* @return difference between `baseValue` and `difference`
*/
public Short subtract(short baseValue, short difference) {
return null;

return (short)(baseValue - difference);
}

/**
Expand All @@ -92,7 +102,8 @@ public Short subtract(short baseValue, short difference) {
* @return difference between `baseValue` and `difference`
*/
public Byte subtract(byte baseValue, byte difference) {
return null;

return (byte)(baseValue - difference);
}

/**
Expand All @@ -101,7 +112,8 @@ public Byte subtract(byte baseValue, byte difference) {
* @return difference between `baseValue` and `difference`
*/
public Float subtract(float baseValue, float difference) {
return null;

return (float)(baseValue - difference);
}

/**
Expand All @@ -110,7 +122,8 @@ public Float subtract(float baseValue, float difference) {
* @return difference between `baseValue` and `difference`
*/
public Double subtract(double baseValue, double difference) {
return null;

return (double)(baseValue - difference);
}


Expand All @@ -120,7 +133,8 @@ public Double subtract(double baseValue, double difference) {
* @return division of `dividend` by `divisor
*/
public Integer divide(int dividend, int divisor) {
return null;

return dividend / divisor;
}

/**
Expand All @@ -129,7 +143,8 @@ public Integer divide(int dividend, int divisor) {
* @return division of `dividend` by `divisor
*/
public Long divide(long dividend, long divisor) {
return null;

return dividend / divisor;
}

/**
Expand All @@ -138,7 +153,8 @@ public Long divide(long dividend, long divisor) {
* @return division of `dividend` by `divisor
*/
public Short divide(short dividend, short divisor) {
return null;

return (short)(dividend / divisor);
}

/**
Expand All @@ -147,7 +163,8 @@ public Short divide(short dividend, short divisor) {
* @return division of `dividend` by `divisor
*/
public Byte divide(byte dividend, byte divisor) {
return null;

return (byte)(dividend / divisor);
}

/**
Expand All @@ -156,7 +173,8 @@ public Byte divide(byte dividend, byte divisor) {
* @return division of `dividend` by `divisor
*/
public Float divide(float dividend, float divisor) {
return null;

return (float)(dividend / divisor);
}

/**
Expand All @@ -165,7 +183,8 @@ public Float divide(float dividend, float divisor) {
* @return division of `dividend` by `divisor
*/
public Double divide(double dividend, double divisor) {
return null;

return (double)(dividend / divisor);
}


Expand All @@ -175,7 +194,8 @@ public Double divide(double dividend, double divisor) {
* @return product of `multiplicand` by `multiplier`
*/
public Integer multiply(int multiplicand, int multiplier) {
return null;

return multiplicand * multiplier;
}

/**
Expand All @@ -184,7 +204,8 @@ public Integer multiply(int multiplicand, int multiplier) {
* @return product of `multiplicand` by `multiplier`
*/
public Long multiply(long multiplicand, long multiplier) {
return null;

return multiplicand * multiplier;
}

/**
Expand All @@ -193,15 +214,17 @@ public Long multiply(long multiplicand, long multiplier) {
* @return product of `multiplicand` by `multiplier`
*/
public Short multiply(short multiplicand, short multiplier) {
return null;

return (short)(multiplicand * multiplier);
}
/**
* @param multiplicand value to be multiplied
* @param multiplier value to multiply by
* @return product of `multiplicand` by `multiplier`
*/
public Byte multiply(byte multiplicand, byte multiplier) {
return null;

return (byte)(multiplicand * multiplier);
}

/**
Expand All @@ -210,7 +233,8 @@ public Byte multiply(byte multiplicand, byte multiplier) {
* @return product of `multiplicand` by `multiplier`
*/
public Float multiply(float multiplicand, float multiplier) {
return null;

return (float)(multiplicand * multiplier);
}

/**
Expand All @@ -219,6 +243,7 @@ public Float multiply(float multiplicand, float multiplier) {
* @return product of `multiplicand` by `multiplier`
*/
public Double multiply(double multiplicand, double multiplier) {
return null;

return (double)(multiplicand * multiplier);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@ public class PredicateUtilities {
* @return true if `x` is greater than `y`
*/
public Boolean isGreaterThan(int x, int y) {
return null;
if (x > y)
return true;

else{
return false;
}
}

/**
Expand All @@ -19,7 +24,12 @@ public Boolean isGreaterThan(int x, int y) {
* @return true if `x` is less than `y`
*/
public Boolean isLessThan(int x, int y) {
return null;
if (x < y)
return true;

else{
return false;
}
}

/**
Expand All @@ -28,7 +38,12 @@ public Boolean isLessThan(int x, int y) {
* @return true if `x` is greater than or equal to `y`
*/
public Boolean isGreaterThanOrEqualTo(int x, int y) {
return null;
if(x >= y)
return true;

else{
return false;
}
}

/**
Expand All @@ -37,22 +52,28 @@ public Boolean isGreaterThanOrEqualTo(int x, int y) {
* @return true if `x` is less than or equal to `y`
*/
public Boolean isLessThanOrEqualTo(int x, int y) {
return null;
if(x <= y)
return true;
//return (x<=y); java will just return it true or false
else{
return false;
}
}


/**
* @return true
*/
public Boolean returnTrue() {
return null;
return true;
}

/**
* @return false
*/
public Boolean returnFalse() {
return null;

return false;
}

}
Loading