echen57
BAN USER
public int binaryToInt(string binaryString)
{
int convertedInt = 0;
for (int i = binaryString.length; i > 0; i-- )
{
convertedInt += binaryString.charAt(i) == "1" ? 2^(binaryString.length - i) : 0;
}
return convertedInt;
}
public string binaryAddition(string one, string two)
{
string binarySum = "";
var sum = binaryToInt(one) + binaryToInt(two);
while (sum > 0)
{
binarySum += sum % 2;
sum = sum / 2;
}
return binarySum;
}
public static double calculatePayout(Member member)
{
double payout = member.getMonthlySales() * .1;
double recruitSales = 0;
Collection<Member> allRecruits = new Collection<Member>();
while( !allRecruits.isEmpty() )
{
Member recruit = allRecruits.First();
recruitSales += recruit.getMonthlySales();
allRecruits.remove(recruit);
allRecruits.AddRange(recruit.getRecruitedMembers());
}
return payout + (recruitSales * .04);
}
Would this be a worthy solution?
public class Bishop {
public Bishop (int x, int y){
this.x = x;
this.y = y;
}
public boolean Move (int targetX, int targetY){
int tmp1 = abs(this.x - this.y);
int tmp 2 = abs(targetX - targetY);
if (tmp1 % 2 != tmp2 % 2)
return false;
int moveX = CheckMovement(this.x, targetX);
if (moveX == -1)
return false;
this.x = moveX;
int moveY = CheckMovement(this.y, targetY);
if (moveY == -1)
return false;
this.y = moveY;
return true;
}
private int CheckMovement(int origin, int target){
if (origin == target)
return -1;
else if (origin > target)
return origin + 1;
else if (origin < target)
return origin - 1;
}
}
Repryanahurd, Korean Air Change Flight at 247quickbookshelp
Je suis Ryana avec 2 ans d'expérience dans la gestion d'un flux de travail à haut volume en ...
Repselindareese, Animator at Agilent Technologies
I am Selinda a Music teacher and composer with 6+ years of experience with an in depth knowledge of music ...
Repronalddavis284, Accountant at ADP
As you may be able to infer from my professional background, I have a strong interest in mathematics and the ...
Repethelsizer, SDET at ADP
I am Ethel , creative news writer with 5+ years of experience. Have great storytelling skills , wrote and delivered high quality ...
Rephamishleeh, Blockchain Developer at ASAPInfosystemsPvtLtd
Property custodian with a reputed organization and help in keeping accurate check over the supplies and inventory of materials and ...
- echen57 February 09, 2014