to find the number of chocolate chips in a cookie

  • (2 Pages)
  • +
  • 1
  • 2

16 Replies - 1915 Views - Last Post: 29 November 2009 - 05:06 AM Rate Topic: -----

#1 vibhasri  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 05-November 09

to find the number of chocolate chips in a cookie

Post icon  Posted 05 November 2009 - 07:16 AM

can u explain this question.......
Is This A Good Question/Topic? 0
  • +

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

#2 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,663
  • Joined: 16-May 09

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

Posted 05 November 2009 - 07:51 AM

LOL WUT ?!! :blink:
Was This Post Helpful? 0
  • +
  • -

#3 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

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:
Posted Image

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.
Was This Post Helpful? 0
  • +
  • -

#4 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,663
  • Joined: 16-May 09

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

Posted 05 November 2009 - 08:07 AM

@NickDMax: :^: Amazing guide! thank you :D
Was This Post Helpful? 0
  • +
  • -

#5 NickDMax  Icon User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

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...
Was This Post Helpful? 0
  • +
  • -

#6 Anarion  Icon User is offline

  • The Persian Coder
  • member icon

Reputation: 387
  • View blog
  • Posts: 1,663
  • Joined: 16-May 09

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
Was This Post Helpful? 0
  • +
  • -

#7 Gorian  Icon User is offline

  • ninja DIC
  • member icon


Reputation: 153
  • View blog
  • Posts: 1,853
  • Joined: 28-June 08

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?
Was This Post Helpful? 0
  • +
  • -

#8 EdwinNameless  Icon User is offline

  • D.I.C Addict
  • member icon

Reputation: 128
  • View blog
  • Posts: 723
  • Joined: 15-October 09

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

Posted 05 November 2009 - 12:21 PM

The answer is: 42.
Was This Post Helpful? 0
  • +
  • -

#9 dev1605  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 27-November 09

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

Posted 27 November 2009 - 01:21 PM

View Postvibhasri, 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!!
Was This Post Helpful? 0
  • +
  • -

#10 hawkysu  Icon User is offline

  • I am a spoon
  • member icon

Reputation: 5
  • View blog
  • Posts: 1,432
  • Joined: 20-February 09

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 )





































Was This Post Helpful? 0
  • +
  • -

#11 dev1605  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 27-November 09

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

Posted 27 November 2009 - 02:21 PM

View Posthawkysu, on 27 Nov, 2009 - 01:12 PM, said:

Heres how you answer:
(if you can't see the code, hit alt+f4 )
what is this. is this sumkinda joke...??
such kind of behaviour wont be tolerated. mind it whoever u are!!



































Was This Post Helpful? 0
  • +
  • -

#12 Nykc  Icon User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 737
  • View blog
  • Posts: 8,648
  • Joined: 14-September 07

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 :code: 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?
Was This Post Helpful? 0
  • +
  • -

#13 dev1605  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 27-November 09

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

Posted 27 November 2009 - 02:33 PM

View PostNykc, 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 :code: 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?


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..
Was This Post Helpful? 0
  • +
  • -

#14 Gorian  Icon User is offline

  • ninja DIC
  • member icon


Reputation: 153
  • View blog
  • Posts: 1,853
  • Joined: 28-June 08

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.
Was This Post Helpful? 0
  • +
  • -

#15 Gorian  Icon User is offline

  • ninja DIC
  • member icon


Reputation: 153
  • View blog
  • Posts: 1,853
  • Joined: 28-June 08

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

Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2