#include "report.h" #include "order.h" void print_report(FILE *out, const int *prices, int n) { /* compute_total gives the discounted sum */ int total = compute_total(prices, n); if (n > 3) total -= total / 10; fprintf(out, "items: %d\n", n); fprintf(out, "expensive: %d\n", count_expensive(prices, n, 1000)); fprintf(out, "total: %d.%02d\n", total / 100, total % 100); }