can u explain this question.......

## 16 Replies - 1995 Views - Last Post: 29 November 2009 - 05:06 AM

### #1

# to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 07:16 AM

##
**Replies To:** to find the number of chocolate chips in a cookie

### #2

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 07:51 AM

LOL WUT ?!!

### #3

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 08:02 AM

you seem to be confused about the nature of cookies -- presumably you are specifically confused about chocolate chip cookies:

since this is a prgramming forum perhaps you have confused the cookies one eats with the cookies that store morsels of data for websites...

Or perhaps you are interested in an algorithm that estimates the number of chips that could be in a cookie given certain criteria. For example one student posted such a question last year.

I am not aware of any famous chocolate chip programming problems (famous problems often have names like "dinning philosophers" so it may be that there is a "chocolate chip cookie" problem I don't know about).

Basically though if you want to know how many chips are in a cookie, let the cookie cool in a refrigerator and then soak the cookie in milk (if you still want to eat the cookie -- water if not) which will dissolve the cookie leaving only the chips.

since this is a prgramming forum perhaps you have confused the cookies one eats with the cookies that store morsels of data for websites...

Or perhaps you are interested in an algorithm that estimates the number of chips that could be in a cookie given certain criteria. For example one student posted such a question last year.

I am not aware of any famous chocolate chip programming problems (famous problems often have names like "dinning philosophers" so it may be that there is a "chocolate chip cookie" problem I don't know about).

Basically though if you want to know how many chips are in a cookie, let the cookie cool in a refrigerator and then soak the cookie in milk (if you still want to eat the cookie -- water if not) which will dissolve the cookie leaving only the chips.

### #4

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 08:07 AM

@NickDMax: Amazing guide! thank you

### #5

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 08:18 AM

I suppose if one wanted to know how many chips were in a cookie in a non-destructive manner you could use ultrasonics or perhaps even CPR: "cookie penetrating radar"

or even good old mathematics... bake a batch of cookies with no chips and one with chips. Use the batch without to find the average weight of the cookie material, and then weigh the cookie with the chips. The difference should give you an idea of the mass of the chips in the cookie. Then you could use some statistics about chocolate chips to estimate how many chips would be needed to equal that mass...

or even good old mathematics... bake a batch of cookies with no chips and one with chips. Use the batch without to find the average weight of the cookie material, and then weigh the cookie with the chips. The difference should give you an idea of the mass of the chips in the cookie. Then you could use some statistics about chocolate chips to estimate how many chips would be needed to equal that mass...

### #6

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 08:22 AM

Why use such expensive ways ? just throw the cookie to a wall and see if anything drops from the pieces Destructive is the way to go

### #7

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 11:58 AM

Or, just eat them all, and be satisfied with "alot" as an answer?

### #8

## Re: to find the number of chocolate chips in a cookie

Posted 05 November 2009 - 12:21 PM

The answer is: 42.

### #9

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 01:21 PM

vibhasri, on 5 Nov, 2009 - 06:16 AM, said:

can u explain this question.......

The qustion is a difficult one after trying for one full day i gave up and hence seeking the help on forum.

the question goes as follows:

**CHOCOLATE CHIPS**[u]

Making chocolate chips cookies involves putting chocolate chips on a cookie-dough which is rolled into a plane 50 cm sqaure. Circles of diameter are cut from the plane to form a chocolate chip cookie.each chip is visible in the planar dough and you have to find which has the maximum number of chocolate chips inside the cookie(i.e circle of 5

cm).The method chocolate chip contains 3 parameters. First one is x coordinate and second one is y coordinate which is of double array data type.all coordinates are in between 0.0(cm) and 50.0 cm each chip may be considered a small point.each chip is at a different position.Third one is the number of coordinates. there are at most 200 chocolate chips(i.e size of first two array is less than 200).

Write a program to find the maximum number of chocolate chips that is contained in a single cookie of diameter 5 cm. the cookie have to be cut in the dough such that they are arranged symmetrically.(for example, first 4 cookies have to be centered at following coordinates:(2.5,2.5),(7.5,2.5),(2.5,7.5),(7.5,7.5)

The prototype of the function is int chocolatechip(double x[],double y[],int noOfCoordinates)

Function returns integer value of the maximum number of chocolatechip present in a cookie.

Contraints:

All coordinates are between 0.0 and 50.0(cm) else return -1.

The noOfCoordinates should be greater than zero, else return -1.

If there is no chocolatechip contained in any cookie of diameter 5 cm then return 0.

Each chip may be considered a point. each chip is at a different position.

Example:

Input

int noOfcoordinates =5(chocolatechip coordinates)

x[0]=1.0, y[0]=1.0

x[1]=2.3, y[1]=2.1

x[2]=2.8, y[2]=3.0

x[3]=5.5' y[3]=6.1

x[4]=7.0, y[4]=8.9

Output

function returns 3

Explanation: first cookie which is centered at(2.5,2.5) has three chocolate chips, and second cookie centered at (7.5,7.5) has

2 chocolate chips.Therefore 3 chocolate chips is maximum

THIS WAS THE QUESTION..SOMEBODY PLEASE HELP!!

### #10

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 02:12 PM

Heres how you answer:

(if you can't see the code, hit alt+f4 )

(if you can't see the code, hit alt+f4 )

### #11

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 02:21 PM

### #12

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 02:24 PM

How bout instead of flooding these forums with the same damn question over and over - putting some of your code down in this thread instead of asking over and over for the answer without making an effort.

Nobody is going to do this for you, and if you don't show us you are willing to put forth the effort then why should anyone take you seriously?

Nobody is going to do this for you, and if you don't show us you are willing to put forth the effort then why should anyone take you seriously?

### #13

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 02:33 PM

Nykc, on 27 Nov, 2009 - 01:24 PM, said:

How bout instead of flooding these forums with the same damn question over and over - putting some of your code down in this thread instead of asking over and over for the answer without making an effort.

Nobody is going to do this for you, and if you don't show us you are willing to put forth the effort then why should anyone take you seriously?

Nobody is going to do this for you, and if you don't show us you are willing to put forth the effort then why should anyone take you seriously?

how about instead of complaining you are just able to give me some code..and let me tell u dat the question was not solved and the code available is erroraneos...instead of complaining try helping out..and if you u cant or dont want to there is no need to write anything related to post..just sit silently and watch the action..

### #14

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 02:57 PM

There will be no action. And as for threating our members, with 6 posts, what makes you think that anyone will help you with kind of attitude.

So, AGAIN, I will restate the rules

[rules][/rules]

all that will be accomplished with an attitude is a team member saying exactly what I am, and closing the thread. Please post your code that you have written in an effort to solve the problem. If you don't want to do the work yourself, realize no one here will do it for you.

So, AGAIN, I will restate the rules

[rules][/rules]

all that will be accomplished with an attitude is a team member saying exactly what I am, and closing the thread. Please post your code that you have written in an effort to solve the problem. If you don't want to do the work yourself, realize no one here will do it for you.

### #15

## Re: to find the number of chocolate chips in a cookie

Posted 27 November 2009 - 03:07 PM

ah, because I am nice, a place to start

This post has been edited by **Gorian**: 27 November 2009 - 03:07 PM