Fundamentals Capstone 4.3

I’ve finished my funds capstone with all successful section tests, but my project submission is unsuccessful due to the returnN function from 4.3 . Under the fail description, the reason is “exhibit a behaviour”. returnN  seems to be giving the correct answers to 4.4 and 4.5. I have changed the function around multiple times but I cannot get past this error. Any help would be appreciated, thanks!

Hi gmb576,

Have a look in the FP.Functions against the template to compare your implementation.

Some questions you might ask yourself;

  • Do I have the same input parameters exactly as provided?
  • Am I returning the expected result type (a table)?
  • Is the result sorted correctly based on the arguments I pass it?

Let us know how you go.

 

Kind regards,

David

Under the Functions.test area, test.top5col shows a table with column col with numbers 5-9 in ascending order. If I modify my returnN function to match this ordering, the submission fails due to "top5EdgeTimes Has Correct Format". If returnN has the items in descending order when keyword is top , I succeed the “top5EdgeTimes Has Correct Format” test but fail with - returnN Fail “exhibit a behaviour” “”. I modeled the returnN function after  the template in FP.Functions, it returns a table, but there seems to be two contradicting tests when `top is the keyword because test.top5EdgeTimes is in descending but test.top5col is ascending.

Hi Grant,

I’ve had a look at the tests. 

You would see this if there was something wrong with the definition of  returnN when you submit the project:

To force this error, I added a semi-colon to last line of my definition e.g.

returnN:{[orderColumn;order;N;t]; // determine order // return N and order t by column …; / there shouldn’t be a semi-colon on the last line here };

I resolved this by removing the semi-colon and re-submitted:

To confirm, do you have a semi-colon on the last line of you function?

Kind regards,

David

Hi David,

Is it possible we have different versions of the capstone project? I don’t have the semicolon issue, the problem is that test.top5EdgeTimes has a descending order, while test.top5col is in ascending order, so returnN can’t satisfy both. I resubmitted after adding a conditional to reverse the order of the table specifically for test.top5col, which appears to be out of sync with the other tests. My project was successfully submitted afterwards. Perhaps reversing the order of test.top5col can prevent the issue for others going forward?

Thanks for this Grant

I’ll pass your comments on to the Evangelism team to have a look.
Cheers,

David

Hi guys, just wondering if this issue has been addressed as I am still getting the same error as Grant

I will take a look at it tomorrow and update on here.

Thanks,

Michaela