/* Sample C program — samplefiles.com */
#include <stdio.h>

typedef struct {
    int id;
    const char *name;
    double balance;
} Customer;

static int is_vip(const Customer *c) { return c->balance >= 10000.0; }

static double total_balance(const Customer *customers, size_t n) {
    double total = 0;
    for (size_t i = 0; i < n; i++) total += customers[i].balance;
    return total;
}

int main(void) {
    Customer customers[] = {{1, "Ada", 12500.0}, {2, "Grace", 830.5}, {3, "Linus", 10000.0}};
    size_t n = sizeof customers / sizeof customers[0];
    for (size_t i = 0; i < n; i++)
        printf("%-6s %10.2f %s\n", customers[i].name, customers[i].balance, is_vip(&customers[i]) ? "VIP" : "");
    printf("Total: %.2f\n", total_balance(customers, n));
    return 0;
}
