Ad
  • Default User Avatar

    No. If you initialise sum with the value 0.0 and the array is empty then your program will just return 0.0. The for used here is a for each, so if there is nothing in the array it won't do anything.

  • Default User Avatar

    input number of 25 bills number of 50 bills
    25 1 0
    50 0 1
    25 1 1
    100 0 0
    25 1 0
    25 2 0
    50 1 1
    100 0 0
    25 1 0
    50 0 1
    25 1 1
    100 0 0
    25 1 0
    25 2 0
    50 1 1
    100 0 0
    answer YES

  • Default User Avatar

    Just print peopleInLine to see the inputed test.

    I had problems with that test as well. Printing the input helped me realise I had misunderstood the requirement.

  • Default User Avatar

    You are right. I missunderstood the requirement.

  • Default User Avatar

    Test number 6 is broken in Java. It expects YES when the answer is NO