Friend finder: Difference between revisions

From Computer Science Wiki
(Created page with "right|frame|This a problem set for you to work through <ref>http://www.flaticon.com/</ref> This is a problem set. Some of these are easy, others are far m...")
 
No edit summary
Line 5: Line 5:
# to build your skill applying computational thinking to a problem
# to build your skill applying computational thinking to a problem
# to assess your knowledge and skills of different programming practices
# to assess your knowledge and skills of different programming practices


== What is this problem set trying to do ==
== What is this problem set trying to do ==
Line 12: Line 11:


== The Problem ==
== The Problem ==
# A one dimensional array exists with the interests. The interests are stored in an array. 
# A two dimension array exists with a userid and the interests associated with that userid. 
# In the code sample below, we can see that user id 1 is interested in 2,5,3, and 4. User id 2 is interested in 6 and 7.
# We make an assumption that if two people are interested in the same thing, they might have a higher chance of becoming friends than if they didn't share interests.
<syntaxhighlight lang="python">


A two dimension array exists with a userid and the interests associated with that userid.
interests = ["basketball","dancing","video games","crafts","music","eating","cooking","hanging out","football"]
people_and_their_interests = [[1,[2,5,3,4]],[2,[6,7]],[3,[8,0,2]],[4,[3,7,8]],[5,[7,4,8]],[6,[3,5,7,8]]]


<syntaxhighlight lang="python">


interests = [[1,"volleyball"],[1,"volleyball"]




friends = [ [1,3,4,5,6


</syntaxhighlight>   
</syntaxhighlight>   

Revision as of 21:08, 2 October 2018

This a problem set for you to work through [1]

This is a problem set. Some of these are easy, others are far more difficult. The purpose of these problems sets are:

  1. to build your skill applying computational thinking to a problem
  2. to assess your knowledge and skills of different programming practices

What is this problem set trying to do[edit]

This problem set is helping you learn pseudocode and think computationally.

The Problem[edit]

  1. A one dimensional array exists with the interests. The interests are stored in an array.
  2. A two dimension array exists with a userid and the interests associated with that userid.
  3. In the code sample below, we can see that user id 1 is interested in 2,5,3, and 4. User id 2 is interested in 6 and 7.
  4. We make an assumption that if two people are interested in the same thing, they might have a higher chance of becoming friends than if they didn't share interests.
interests = ["basketball","dancing","video games","crafts","music","eating","cooking","hanging out","football"]
people_and_their_interests = [[1,[2,5,3,4]],[2,[6,7]],[3,[8,0,2]],[4,[3,7,8]],[5,[7,4,8]],[6,[3,5,7,8]]]


Unit Tests[edit]

  • Input: A collection named "numbers_to_add
  • Expected output: "The answer is: 165"

How you will be assessed[edit]

Your solution will be graded using the following axis:


Scope

  • To what extent does your code implement the features required by our specification?
  • To what extent is there evidence of effort?

Correctness

  • To what extent did your code meet specifications?
  • To what extent did your code meet unit tests?
  • To what extent is your code free of bugs?

Design

  • To what extent is your code written well (i.e. clearly, efficiently, elegantly, and/or logically)?
  • To what extent is your code eliminating repetition?
  • To what extent is your code using functions appropriately?

Style

  • To what extent is your code readable?
  • To what extent is your code commented?
  • To what extent are your variables well named?
  • To what extent do you adhere to style guide?

References[edit]

A possible solution[edit]

Click the expand link to see one possible solution, but NOT before you have tried and failed!

not yet!