Flower Boards — Design Patterns

Untangle a flower-board kiosk's order app: modules, singleton, builder, factory, facade and visitor. 16 levels, right in the browser.

What the levels ask

  1. Monday morning at Kios Bunga Menur. Mrs. Menur's nephew left her the order app before he went off to university, and harga.js keeps the price per stem. Today Ms. Wulan asks for bunch prices over WhatsApp, then two more boards are ordered at the counter. Pick what daftarHarga() hands out so the WhatsApp reply cannot change the counter's prices.
  2. The cold shelf's stock screen reads sisaMawar from stok.js. This morning Mrs. Sari's board uses 40 stems, then Mr. Tono unloads 50 from his garden. Fill layar.js and pemasok.js so the screen always shows what is really left.
  3. The counter and WhatsApp both give out receipt numbers, and each makes new BukuNota(). Yesterday two boards went out with the same receipt number. Fill in BukuNota's constructor so everyone who calls new BukuNota() gets the same book, and the evening tally counts every order.
  4. Now the receipt number lives in the nota.js module: an ES module is evaluated once, so there is one terakhir. But the WhatsApp file was copied from a tutorial that adds ?v=2 to its import address. Pick the import addresses in kasir.js and wa.js so no number is given twice and the evening tally counts every order.
  5. Mr. Bayu orders a large board from District Bank for the Baru Market opening: 80 roses, a red ribbon. The Papan constructor asks for nine arguments in order. Pick how the board is made so what stands by the road is exactly Mr. Bayu's order.
  6. WhatsApp orders arrive as form fields, and customers often forget something. A board with no message or no recipient must not be arranged; a board with no ribbon may, because a ribbon is optional. Pick the check in build() so only orders that are not whole are held back, and their senders are asked over WhatsApp.
  7. The district's offices order the same opening board, so Mrs. Menur prepares one cetakan: for Baru Market, the same message, 60 roses. Each order adds its sender, and the district primary school asks for 20 extra gerberas. Pick what dengan(), the method every builder step goes through, does so that no board changes after it is put out and the template stays as it was.
  8. This week brings opening boards and wedding boards. Each family of boards has its own frame, ribbon and heading: weddings white with a pink ribbon, openings red with a gold ribbon. Pick how buatPapan puts the parts together so each board is wholly one family, the one its event calls for.
  9. The district vocational school sees its students graduate, and Mrs. Ratna orders a graduation board: a blue frame, a yellow ribbon, the words Selamat atas Kelulusan. Mrs. Menur's nephew had started writing the graduation factory in pabrik.js. Pick how it is made so the graduation board is wholly one family, without upsetting the wedding and opening boards.
  10. Boards are ordered from three screens: the counter, WhatsApp and the phone. Each board goes through the frame shop, the arranger, the letter cutter, the receipt printer, then the pickup. Pick the order inside kirimPapan and how the three screens use it, so every board arrives whole with its lettering showing, and every order has exactly one receipt.
  11. The neighbourhood head orders for Mr. Darto's daughter's wedding: one board, one bridal bouquet, five strings of jasmine garland. Mrs. Menur needs three things from the same order: its price, the list for the flower market, and the work ticket for the arranging table. Each is a visitor that walks the order once. Fill in terima on Ronce so all three come out right.
  12. Mr. Arka wants the Arkade board lit at night, so his order has a new kind: Lampu, 10 metres, Rp15,000 a metre. Lampu already knows how to be visited. Fill in the lamp case of the Harga visitor so Arkade's price is right, and the neighbourhood head's chrysanthemum board is priced as before.

And more, 16 levels in all.