Respuesta :

Answer:

This could take some time to make, but just to get you going I made the first 3 lines. I don't know how to justify the prices to the right, so you probably have to research that.

Explanation:

#include <stdio.h>

int main()

{

   const double KEYBOARD_PRICE = 35.50;

   const double MOUSE_PRICE = 12.90;

   const double MONITOR_PRICE = 600.00;

   const double PRINTER_PRICE = 168.00;

   const double SPEAKER_PRICE = 120.00;

   const double tax = 0.0825;

   

   int keyboardQty, mouseQty, monitorQty, printerQty, speakerQty;

   

   printf("Enter the number of items sold: ");

   printf("Keyboard > ");

   scanf("%d", &keyboardQty);

   

   printf("Mouse > ");

   scanf("%d", &mouseQty);

   

   printf("Monitor > ");

   scanf("%d", &monitorQty);

   

   printf("Printer > ");

   scanf("%d", &printerQty);

   

   printf("Speaker > ");

   scanf("%d", &speakerQty);

   

   double keyboardTotal = KEYBOARD_PRICE * keyboardQty;

   double mouseTotal = MOUSE_PRICE * mouseQty;

   double monitorTotal = MOUSE_PRICE * monitorQty;

   double printerTotal = PRINTER_PRICE * printerQty;

   double speakerTotal = SPEAKER_PRICE * speakerQty;

   //double subtotal = ...

   

   printf("%-3s\t%-11s\t%-10s\t%-11s\n", "QTY", "DESCRIPTION", "UNIT PRICE", "TOTAL PRICE");

   printf("%-3s\t%-11s\t%-10s\t%-11s\n", "---", "-----------", "----------", "-----------");

   printf("%d", keyboardQty);

   printf("%-3d\t%-11s\t%-10.2f\t%-11.2f\n", keyboardQty, "KEYBOARD", KEYBOARD_PRICE, keyboardTotal);

   

}