reset password
Author Message
Anonymous
Posts: 166
Posted 22:19 Mar 12, 2014 |

Anyone in the mon/wends that can help tell me what i did wrong in the CalculateBid Method? The test keep returning as failed

 

static int[] calculateBid(int first_move, int second_move, int draw, int first_money, int second_money) {
 
        if (first_move > second_move){
            first_money = first_money - first_move;
        }
        else if (first_move < second_move) { 
            second_money = second_money - first_move;
        }
        else{
            if (draw % 2 ==1) {
                first_money = first_money - first_move;  
            } 
            else {
                second_money =  second_money - first_move;
            }
        }
        return new int[] { first_money, second_money, draw };
    }
lakerfan94
Posts: 143
Posted 22:25 Mar 12, 2014 |

Whenever you deduct money from second_money deduct by second_move, not by first_move.

Anonymous
Posts: 166
Posted 22:28 Mar 12, 2014 |

You should keep count of draw by using draw++; you should use the code from your doMoves method if it works just replace the values isntead of using first_money = first_money-first_move do it this way first_money -=first_move. It is the same thig bit i also had a similar problem and doing this fixed it

AndyTrinhXCIII
Posts: 4
Posted 23:00 Mar 12, 2014 |

Where do we even resubmit our file?

Anonymous
Posts: 166
Posted 23:45 Mar 12, 2014 |

Thanks that fixed my CaculateBid Problems(: