37 lines
787 B
C
37 lines
787 B
C
#include <stdio.h>
|
|
#include <stdbool.h>
|
|
|
|
// TODO: implement the item enum
|
|
|
|
int main()
|
|
{
|
|
bool CustomerHasItems = true;
|
|
int TimePassed = 0;
|
|
|
|
#define CUSTOMER_ITEM_COUNT 5 // This declares a constant
|
|
item CustomerItems[CUSTOMER_ITEM_COUNT] = {tissues, pasta, tomato_sauce, bread, butter};
|
|
|
|
// NOTE: time is in seconds
|
|
item Time[ITEM_TYPE_COUNT];
|
|
Time[tissues] = 1;
|
|
Time[pasta] = 2;
|
|
Time[tomato_sauce] = 3;
|
|
Time[bread] = 10;
|
|
Time[butter] = 2;
|
|
Time[batteries] = 2;
|
|
Time[toothbrush] = 1;
|
|
|
|
int ItemsLeft = CUSTOMER_ITEM_COUNT;
|
|
while(CustomerHasItems)
|
|
{
|
|
// TODO: increase time based on the scaned item
|
|
TimePassed++;
|
|
ItemsLeft--;
|
|
printf("Time since start: %d. Scanning a product. %d to go.\n", TimePassed, ItemsLeft);
|
|
|
|
if(!ItemsLeft)
|
|
CustomerHasItems = false;
|
|
}
|
|
|
|
}
|