book

Report

There are 26 students who gave a self-introduction. As a class, we brainstormed and came up with a long list of further questions we can ask based on this data. Our team chose to tackle on the following:

How many people are in computer science?

return _.size(_.filter(data.comments, function(n){
	return _.includes(n.body,"Computer Science") || _.includes(n.body, "CS");
}))

20

How many people names start with A?

var list = _.filter(_.pluck(data.comments, 'body'), function(text){
	var a = text.split("\r\n")[0]
	var name = _.last(text.split("Name:"))
	return name.charAt(1) == 'A'
})

return _.size(list)

4

How many people are not a computer science major?

return data.comments.length - _.size(_.filter(data.comments, function(n){
	return _.includes(n.body,"Computer Science") || _.includes(n.body, "CS");
}))

6

What is the id number of user zhya215?

var x = _.filter(data.comments, function(n){
	return _.includes(n.user,"zhya215");
})

var y = _.pluck(x, 'user.id')

return y

5596113