Question about Submitting HW 5.6

Unlike other homework problems, HW 5.6 does not give us a code stub to show where we are to write our new contribution. Instead, previously developed code is given (active, in a black font) followed by comments and then an active example of a correct execution.

We are asked to create a new procedure and then modify the old code. Are we permitted to do this above and within the given old code, or will the grader require that our answer be developed at the end of the file (overriding the previous definitions)?

Also, are we to remove the active test case that is given? From past experience, it seems likely that having its print statement active could cause the grader to object. Then again, removing the print statement could cause the grader to object.

Official clarification, please?

asked 21 Mar '12, 17:50

Kenneth%20I.%20Laws-1's gravatar image

Kenneth I. L...
21.5k1976178
accept rate: 32%


3 Answers:

The grader doesn't care about any test cases. That was only an issue with homework 1. Appending the new function definitions to the end of the file will probably work but you should just change the existing definitions. Does that answer your questions?

link

answered 21 Mar '12, 17:57

PeterUdacity's gravatar image

PeterUdacity ♦♦
35.9k73219331

2

I think so. We are free to replace/rewrite the originals rather than override them. I will do that, with my new procedure defined above all of the old code.

Since the grader doesn't care about test printouts, I will delete them before submitting, just to be safe. Once burned, twice shy; and old habits die hard. Or "old cows follow old paths," as my wife from Malaysia says.

"Be careful what you put in your head, because you will never get it out."

(21 Mar '12, 18:17) Kenneth I. L... Kenneth%20I.%20Laws-1's gravatar image

My approach - work in my local editor/interpreter, copy my new functions over the ones in the online interpreter (after 'Reset'), run and check, removed the test cases and check, submit. Is that a fairly sensible approach?

There is a pretty non-trivial discussion about the test cases going on here - http://www.udacity-forums.com/cs101/questions/45425/question-about-submittng-homework-56-and-57

(23 Mar '12, 23:58) Aaron Newton Aaron%20Newton's gravatar image

I haven't gotten to this problem yet (and I probably won't). I'm just trying to stay in the conversation so I can maybe pick up crumb or two.

(25 Mar '12, 17:32) Elizabeth A.... Elizabeth%20A.%20Pressler-1's gravatar image

A quick follow up question for Peter (or anyone else for that matter). The instructions give no specifics on the name of the new function we are asked to create. Is it safe to assume from this that the tester will not care what name we use as the function is never directly called?

link

answered 26 Mar '12, 15:44

Alden%20Hoot-2's gravatar image

Alden Hoot-2
2342725

I think so. They will only check that your implementation of the two functions don't contain for/while loops. I think the grader will call your function afterwards and will compare your results so the name of your own function doesn't matter.

(27 Mar '12, 01:48) shebaw shebaw's gravatar image

I agree with @shebaw and was under the same assumption when rewriting the already present functions.

(27 Mar '12, 18:58) Mac Jingles Mac%20Jingles's gravatar image

Can our function / procedure have as many lines as we want?

link

answered 27 Mar '12, 19:17

PhotoPaul's gravatar image

PhotoPaul
222

Yes. The limit is just for the 2 procedures you're editing.

(27 Mar '12, 19:18) fnenu-1 ♦♦ fnenu-1's gravatar image

If this is the case, then why the 6 lines limit?
All you need is one line in each one of them, that simply calls the new procedure, inside which we can test who called it and act respectively. The 6 lines limit when only one is needed sounds a little fishy... Don't you think?

(27 Mar '12, 19:25) PhotoPaul PhotoPaul's gravatar image
Your answer
Question text:

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×15,298
×369
×160
×109
×43

Asked: 21 Mar '12, 17:50

Seen: 851 times

Last updated: 27 Mar '12, 19:25