Coin Dates

Coin Dates preview image

1 collaborator

Tags

(This model has yet to be categorized with any tags)
Visible to everyone | Changeable by everyone
Model was written in NetLogo 5.1.0 • Viewed 282 times • Downloaded 35 times • Run 0 times
Download the 'Coin Dates' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


WHAT IS IT?

(a general understanding of what the model is trying to show or explain)

HOW IT WORKS

(what rules the agents use to create the overall behavior of the model)

HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

THINGS TO NOTICE

(suggested things for the user to notice while running the model)

THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

CREDITS AND REFERENCES

(a reference to the model's URL on the web if it has one, as well as any other necessary credits, citations, and links)

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

globals [ change-amount ]

to go 
  clear-all
  make-change-amount
  count-out-change   
end 

; this procedure generates a random "change" amount  

to make-change-amount
  set change-amount random 100
  set change-amount change-amount * 0.01
  print "Change amount is " show change-amount
end 

; this procedure subtracts out the "coins" 

to count-out-change
   while [ change-amount >= .25 ]
   [
     select-date-quarter
   ]
   while [ change-amount >= .10 ]
   [
     select-date-dime
   ]
   while [ change-amount >= .05 ]
   [
     select-date-nickel
   ]
   while [ change-amount >= .009 ] ;  0.009 (not .01) is use to help with rounding errors
   [
     select-date-cent
   ]
   if change-amount > 0
   [
     set change-amount 0
   ]
end 

to select-date-quarter
  ;1916-2013 is the date range we want
  let date 1916
  set date date + random 98
  type date print " quarter"
  set change-amount change-amount - .25 
end 

to select-date-dime
  ;1916-2013 is the date range we want
  let date 1916
  set date date + random 98
  type date print " dime" 
  set change-amount change-amount - .10
end 

to select-date-nickel
  ;1913-2013 is the date range we want
  let date 1913
  set date date + random 101
  type date print " nickel"  
  set change-amount change-amount - .05
end 

to select-date-cent
   ;1909-2013 is the date range we want  
  let date 1909
  set date date + random 105
  type date print " cent" 
  set change-amount change-amount - .01
end 

There is only one version of this model, created almost 11 years ago by Creighton Edington.

Attached files

File Type Description Last updated
Coin Dates.png preview Preview for 'Coin Dates' almost 11 years ago, by Creighton Edington Download

This model does not have any ancestors.

This model does not have any descendants.