Money Changer: Evenly Split Amount into Wallets

Money Changer: Evenly Split Amount into Wallets
Loading the math board and drawing, please wait…
2025-04-03 22:59
① This example demonstrates a money‑changer machine that evenly splits a given amount into several wallets. ② Core mathematical concepts include integer division, equal‑distribution algorithms, sequence generation, and minimum value search. ③ Construction highlights: the applet employs GeoGebra commands Join, If, Flatten, Translate, Sequence, Polygon, CountIf, Min, Textfield, Shuffle, Element, Append, Point, Length, Zip together with objects such as showButtonValidateGrauAfterTryAgain, startpage, questionCount, listNumBeutel, numBeutel to create an interactive distribution process. ④ Suitable for upper‑primary to lower‑secondary arithmetic lessons, as well as for teaching algorithmic thinking and GeoGebra scripting.

GeoGebra Commands & Parameters

  1. Join({{5}, Shuffle[Sequence[1, maxexnum] \ {5}], Join[Sequence[Shuffle[Sequence[1, maxexnum]], m, 1, floor(110 / maxexnum)]]}) → listExNums
  2. If(startpage, 9, listExNums(Mod[questionCount, 100] + 1)) → exnum
  3. Flatten(Sequence[Sequence[BagPoint + (m * (bagsizex + 0.1, 0)) + (j * (0, bagsizey + 0.1)), m, 0, 2], j, 0, 2]) → listBagPoints
  4. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(9)) → v9
  5. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(8)) → v8
  6. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(7)) → v7
  7. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(6)) → v6
  8. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(5)) → v5
  9. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(4)) → v4
  10. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(3)) → v3
  11. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(2)) → v2
  12. Translate(Polygon[(0, 0), (bagsizex, 0), (bagsizex, bagsizey), (0, bagsizey)], listBagPoints(1)) → v1
  13. Sequence(Element[{inV1, inV2, inV3, inV4, inV5, inV6, inV7, inV8, inV9}, m], m, 1, numBeutel) → listVs
  14. Polygon(V01, (x(V01), y(V02)), V02, (x(V02), y(V01))) → v0, f, g, h, k
  15. CountIf(P ∈ v0, P, RemoveUndefined[{MG1, MG2, MG3, MG4, MG5, MG6, MG7, MG8, MG9, MG10, MG11, MG12, MG13, MG14, MG15, MG16, MG17, MG18, MG19, MG20, MG21, MG22}]) → inv02
  16. CountIf(P ∈ v0, P, RemoveUndefined[{MH1, MH2, MH3, MH4, MH5, MH6, MH7, MH8, MH9, MH10, MH11, MH12, MH13, MH14, MH15, MH16, MH17, MH18, MH19, MH20, MH21, MH22}]) → inv01
  17. CountIf(P ∈ v0, P, RemoveUndefined[{MF1, MF2, MF3, MF4, MF5, MF6, MF7, MF8, MF9, MF10, MF11, MF12, MF13, MF14, MF15, MF16, MF17, MF18, MF19, MF20, MF21, MF22}]) → inv05
  18. CountIf(P ∈ v0, P, RemoveUndefined[{ME1, ME2, ME3, ME4, ME5, ME6, ME7, ME8, ME9, ME10, ME11, ME12, ME13, ME14, ME15, ME16, ME17, ME18, ME19, ME20, ME21, ME22, ME23, ME24, ME25, ME26, ME27}]) → inv010
  19. CountIf(P ∈ v0, P, RemoveUndefined[{MD1, MD2, MD3, MD4, MD5, MD6, MD7, MD8, MD9, MD10, MD11, MD12, MD13, MD14, MD15, MD16, MD17, MD18, MD19, MD20, MD21, MD22, MD23, MD24, MD25, MD26, MD27}]) → inv020
  20. CountIf(P ∈ v0, P, RemoveUndefined[{MC1, MC2, MC3, MC4, MC5, MC6, MC7, MC8, MC9, MC10, MC11, MC12}]) → inv050
  21. CountIf(P ∈ v0, P, RemoveUndefined[{MB1, MB2, MB3, MB4, MB5, MB6, MB7}]) → inv0100
  22. CountIf(P ∈ v0, P, RemoveUndefined[{MA1, MA2, MA3, MA4, MA5, MA6}]) → inv0200
  23. Polygon(PBild1, (x(PBild1), y(PBild2)), PBild2, (x(PBild2), y(PBild1))) → vBild, a_1, i, b_2, j
  24. If(b ≟ 1, Min[{floor(num / 200), max200}], 0) → num200
  25. If(b ≤ 2, Min[{floor((num - (num200 * 200)) / 100), max100}], 0) → num100
  26. If(b ≤ 3, Min[{floor((num - (num200 * 200) - (num100 * 100)) / 50), max50}], 0) → num50
  27. If(b ≤ 4, Min[{floor((num - (num200 * 200) - (num100 * 100) - (num50 * 50)) / 20), max20}], 0) → num20
  28. If(b ≤ 5, Min[{floor((num - (num200 * 200) - (num100 * 100) - (num50 * 50) - (num20 * 20)) / 10), max10}], 0) → num10
  29. If(b ≤ 6, Min[{floor((num - (num200 * 200) - (num100 * 100) - (num50 * 50) - (num20 * 20) - (num10 * 10)) / 5), max5}], 0) → num5
  30. If(b ≤ 7, Min[{floor((num - (num200 * 200) - (num100 * 100) - (num50 * 50) - (num20 * 20) - (num10 * 10) - (num5 * 5)) / 2), max2}], 0) → num2
  31. Min({floor((num - (num200 * 200) - (num100 * 100) - (num50 * 50) - (num20 * 20) - (num10 * 10) - (num5 * 5) - (num2 * 2)) / 1), max1}) → num1
  32. Textfield(input1) → Eingabefeld1
  33. Textfield(input2) → Eingabefeld2
  34. Polygon(PtopLeftCornerFeedback, PtopRightCornerFeedback, PbottomRightCornerFeedback, PbottomLeftCornerFeedback) → rectangleCorrect, rectangleCorrectS3, rectangleCorrectS4, rectangleCorrectS2, rectangleCorrectS1
  35. Shuffle(Sequence[Random[0, 10], i, 1, 100]) → randomNosForX, {1, 1, 3, 1, 3, 1, 9, 6, 4, 6, 10, 2, 3, 2, 1, 10, 8, 8, 10, 7, 7, 1, 7, 9, 0, 2, 10, 6, 5, 3, 3, 5, 8, 3, 2, 5, 4, 7, 0, 1, 3, 0, 6, 1, 0, 3, 2, 9, 5, 6, 2, 0, 0, 10, 3, 9, 0, 7, 1, 3, 5, 0, 6, 7, 0, 10, 9, 10, 9, 5, 2, 9, 4, 0, 4, 3, 7, 2, 3, 7, 8, 9, 2, 3, 2, 1, 1, 10, 7, 6, 2, 5, 3, 4, 5, 1, 3, 6, 7, 0}
  36. Shuffle(Sequence[Random[0, 10], i, 1, 100]) → randomNosForY, {4, 1, 5, 7, 7, 9, 3, 4, 7, 9, 5, 5, 9, 4, 8, 5, 0, 5, 9, 4, 9, 3, 0, 0, 8, 4, 7, 10, 7, 0, 5, 5, 9, 4, 5, 4, 5, 9, 10, 2, 4, 0, 6, 9, 0, 3, 3, 7, 10, 1, 5, 0, 9, 10, 3, 4, 8, 0, 10, 2, 10, 0, 9, 0, 10, 4, 5, 3, 4, 2, 7, 3, 3, 6, 2, 6, 3, 4, 7, 10, 9, 2, 0, 0, 2, 0, 4, 3, 6, 2, 10, 5, 7, 6, 8, 9, 10, 9, 1, 4}
  37. Element(randomNosForY, Mod[questionCount, 100] + 1) → numY
  38. Append(true, Sequence[If[randomNosForX(i) ≟ randomNosForX(i - 1), false, true], i, 2, 100]) → stayX
  39. Point(Line[Maschine1, xAxis]) → Maschine2
  40. Textfield(num) → Eingabefeld0
  41. Flatten(Sequence[Sequence[PC + (m * (absscheinex, 0)) - (j * (0, (0.8 * absscheiney))), j, 0, 8], m, 0, 2]) → listPC
  42. Length(listPC) → lengthPC
  43. Sequence(listPC(m), m, 1, listChange(2)) → listPC200
  44. Sequence(Element[Remove[listPC, listPC200], m], m, 1, listChange(3)) → listPC100
  45. Sequence(Element[Remove[listPC, Join[{listPC200, listPC100}]], m], m, 1, listChange(4)) → listPC50
  46. Sequence(Element[Remove[listPC, Join[{listPC200, listPC100, listPC50}]], m], m, 1, listChange(5)) → listPC20
  47. Sequence(Element[Remove[listPC, Join[{listPC200, listPC100, listPC50, listPC20}]], m], m, 1, listChange(6)) → listPC10
  48. Sequence(Element[Remove[listPC, Join[{listPC200, listPC100, listPC50, listPC20, listPC10}]], m], m, 1, listChange(7)) → listPC5
  49. Sequence(Element[Remove[listPC, Join[{listPC200, listPC100, listPC50, listPC20, listPC10, listPC5}]], m], m, 1, listChange(8)) → listPC2
  50. Sequence(Element[Remove[listPC, Join[{listPC200, listPC100, listPC50, listPC20, listPC10, listPC5, listPC2}]], m], m, 1, listChange(9)) → listPC1
  51. Flatten(Sequence[Sequence[PS + (m * (absscheinex + 0.2, 0)) - (j * (0, (1.4 * picheight200))), j, 0, 1], m, 0, 3]) → listPS
  52. Sequence(listPS(m), m, 1, listStart(1)) → listPS200
  53. Sequence(Element[Remove[listPS, listPS200], m], m, 1, listStart(2)) → listPS100
  54. CountIf(P ∈ vBild, P, RemoveUndefined[{MH1, MH2, MH3, MH4, MH5, MH6, MH7, MH8, MH9, MH10, MH11, MH12, MH13, MH14, MH15, MH16, MH17, MH18, MH19, MH20, MH21, MH22}]) → inBild1
  55. CountIf(P ∈ vBild, P, RemoveUndefined[{MF1, MF2, MF3, MF4, MF5, MF6, MF7, MF8, MF9, MF10, MF11, MF12, MF13, MF14, MF15, MF16, MF17, MF18, MF19, MF20, MF21, MF22}]) → inBild5
  56. CountIf(P ∈ vBild, P, RemoveUndefined[{ME1, ME2, ME3, ME4, ME5, ME6, ME7, ME8, ME9, ME10, ME11, ME12, ME13, ME14, ME15, ME16, ME17, ME18, ME19, ME20, ME21, ME22, ME23, ME24, ME25, ME26, ME27}]) → inBild10
  57. CountIf(P ∈ vBild, P, RemoveUndefined[{MD1, MD2, MD3, MD4, MD5, MD6, MD7, MD8, MD9, MD10, MD11, MD12, MD13, MD14, MD15, MD16, MD17, MD18, MD19, MD20, MD21, MD22, MD23, MD24, MD25, MD26, MD27}]) → inBild20
  58. CountIf(P ∈ vBild, P, RemoveUndefined[{MC1, MC2, MC3, MC4, MC5, MC6, MC7, MC8, MC9, MC10, MC11, MC12}]) → inBild50
  59. CountIf(P ∈ vBild, P, RemoveUndefined[{MB1, MB2, MB3, MB4, MB5, MB6, MB7}]) → inBild100
  60. CountIf(P ∈ vBild, P, RemoveUndefined[{MA1, MA2, MA3, MA4, MA5, MA6}]) → inBild200
  61. CountIf(P ∈ vBild, P, RemoveUndefined[{MG1, MG2, MG3, MG4, MG5, MG6, MG7, MG8, MG9, MG10, MG11, MG12, MG13, MG14, MG15, MG16, MG17, MG18, MG19, MG20, MG21, MG22}]) → inBild2
  62. Polygon(VA1, (x(VA1), y(VA2)), VA2, (x(VA2), y(VA1))) → vAusgabe, va1, l, va2, m
  63. CountIf(Defined[P] ∧ P ∈ vAusgabe, P, {MA1, MA2, MA3, MA4, MA5, MA6, MB1, MB2, MB3, MB4, MB5, MB6, MB7, MC1, MC2, MC3, MC4, MC5, MC6, MC7, MC8, MC9, MC10, MC11, MC12, MD1, MD2, MD3, MD4, MD5, MD6, MD7, MD8, MD9, MD10, MD11, MD12, MD13, MD14, MD15, MD16, MD17, MD18, MD19, MD20, MD21, MD22, MD23, MD24, MD25, MD26, MD27, ME1, ME2, ME3, ME4, ME5, ME6, ME7, ME8, ME9, ME10, ME11, ME12, ME13, ME14, ME15, ME16, ME17, ME18, ME19, ME20, ME21, ME22, ME23, ME24, ME25, ME26, ME27, MF1, MF2, MF3, MF4, MF5, MF6, MF7, MF8, MF9, MF10, MF11, MF12, MF13, MF14, MF15, MF16, MF17, MF18, MF19, MF20, MF21, MF22, MG1, MG2, MG3, MG4, MG5, MG6, MG7, MG8, MG9, MG10, MG11, MG12, MG13, MG14, MG15, MG16, MG17, MG18, MG19, MG20, MG21, MG22, MH1, MH2, MH3, MH4, MH5, MH6, MH7, MH8, MH9, MH10, MH11, MH12, MH13, MH14, MH15, MH16, MH17, MH18, MH19, MH20, MH21, MH22}) → inVAusgabe
  64. CountIf(P ∈ vBild, P, RemoveUndefined[{MB6, MB7}]) → inBild100Start
  65. CountIf(P ∈ vBild, P, RemoveUndefined[{ME26, ME27}]) → inBild10Start
  66. CountIf(P ∈ vBild, P, RemoveUndefined[{MH21, MH22}]) → inBild1Start
  67. CountIf(P ∈ vBild, P, RemoveUndefined[{MA4, MA5, MA6}]) → inBild200Start
  68. CountIf(P ∈ vBild, P, RemoveUndefined[{MD26, MD27}]) → inBild20Start
  69. CountIf(P ∈ vBild, P, RemoveUndefined[{MG21, MG22}]) → inBild2Start
  70. CountIf(P ∈ vBild, P, RemoveUndefined[{MC11, MC12}]) → inBild50Start
  71. CountIf(P ∈ vBild, P, RemoveUndefined[{MF21, MF22}]) → inBild5Start
  72. Zip((numBeutel * m), m, listSol) → listSolNums
  73. Sequence(listBagPoints(1) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints1
  74. Sequence(listBagPoints(2) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints2
  75. Sequence(listBagPoints(3) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints3
  76. Sequence(listBagPoints(4) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints4
  77. Sequence(listBagPoints(5) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints5
  78. Sequence(listBagPoints(6) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints6
  79. Sequence(listBagPoints(7) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints7
  80. Sequence(listBagPoints(8) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints8
  81. Sequence(listBagPoints(9) + ((0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPoints9
  82. Sequence(listBagPoints(3) + (3 + (0.3 * bagsizex), (0.5 * bagsizey) - (m * 0.3)), m, 0, Sum[listSol]) → listSolPointsRest
  83. Flatten(Sequence[Sequence[PRest + (m * ((1.2 * absscheiney), 0)) + (j * (0, absscheiney)), m, 0, 7], j, 0, 20]) → listRestPoints
  84. Length(listRestPoints) → a
  85. Polygon(VVB1, (x(VVB2), y(VVB1)), VVB2, (x(VVB1), y(VVB2))) → vForbidden, vfb1, n, vfb2, p
  86. Sequence(Element[Remove[listPS, Join[{listPS200, listPS100}]], m], m, 1, listStart(3)) → listPS50
  87. Sequence(Element[Remove[listPS, Join[{listPS200, listPS100, listPS50}]], m], m, 1, listStart(4)) → listPS20
  88. Sequence(Element[Remove[listPS, Join[{listPS200, listPS100, listPS50, listPS20}]], m], m, 1, listStart(5)) → listPS10
  89. Sequence(Element[Remove[listPS, Join[{listPS200, listPS100, listPS50, listPS20, listPS10}]], m], m, 1, listStart(6)) → listPS5
  90. Sequence(Element[Remove[listPS, Join[{listPS200, listPS100, listPS50, listPS20, listPS10, listPS5}]], m], m, 1, listStart(7)) → listPS2
  91. Sequence(Element[Remove[listPS, Join[{listPS200, listPS100, listPS50, listPS20, listPS10, listPS5, listPS2}]], m], m, 1, listStart(8)) → listPS1
  92. Sequence(Element[Zip[Text["\textsf\small{" + correctValue + ((" €" * "}")), P + (1.33, 2), true, true, -0, 1], P, listBagPoints], m], m, 1, numBeutel) → listSolText

AI Drawing Prompt Reference

Draw a money changer machine that evenly distributes a given amount into several wallets. Start by drawing the machine's appearance, including 9 wallets, each made up of four points. Then, based on the input amount, calculate the amount to be distributed to each wallet and allocate it accordingly. Finally, use text fields to display the input amount and polygons to represent each wallet.
The prompt above was compiled from the original drawing commands and is for reference only.