15 /* Hauptbildschirm ausgeben */
19 printf("C128-Kassenprogramm\n\n");
20 printf("Eingenommen: 1337 Euro, Verkauft: 42 Flaschen\n\n");
21 for (; i < num_items; ++i)
22 printf("Item %x: %s (%d Cents, %d mal verkauft)\n", i, status[i].item_name, status[i].price, status[i].times_sold);
23 printf("\nBefehle: s) Save Data\n");
26 /* Wird ausgelagert */
31 static uc einheiten = 1;
33 if (status[n].item_name == NULL)
34 printf("ERROR: No such item\n");
36 printf("Wieviel Einheiten \"%s\"?\n", status[n].item_name);
39 printf("das war %x\n", c);
42 else if (c > 47 && c < 60)
43 einheiten += (c - 48);
45 status[n].times_sold += einheiten;
46 money += status[n].price * einheiten;
47 items_sold += einheiten;
54 status[0].item_name = "cola";
55 status[0].price = 230;
56 status[0].times_sold = 0;
57 status[1].item_name = "mate";
58 status[1].price = 150;
59 status[0].times_sold = 0;
60 for (c = 2; c < 15; ++c)
61 status[c].item_name = NULL;
63 /* Bildschirm anzeigen */
65 /* Tastatureingaben abfragen */
67 /* und eventuell weitere Dialoge anzeigen */