วันอังคารที่ 22 กรกฎาคม พ.ศ. 2557

ผลงานนักเรียน Episode 9


//LAB9 โปรแกรมมินิมาร์ท
//Nattaporn Aimsa-ard   FC01/01   Bangkok Business College
//23-07-57
#include<stdio.h>
#include<conio.h>
main()
{
      char code[5],product[20];
      float price,total,discount,net,money,cash;
      int unit;
      system ("cls");
      printf("    +++++*****   Puyfaii Market  *****+++++  \n");
      printf("     +*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+\n");
      printf("          Enter Code    :");scanf("  %s",code);
      printf("          Enter Product :");scanf("  %s",product);
      printf("          Enter Price   :");scanf("  %f",&price);
      printf("          Enter Unit    :");scanf("  %d",&unit);
      total=price*unit;
      printf("     -------------------------------\n");
      printf("          Total         =%.2f Baht\n",total);
      printf("     -------------------------------\n");
      if (total<=2000)
               discount=0;
      else discount=total*0.05;
      printf("          discount      =%.2f   Baht\n",discount);
      printf("     -------------------------------\n");
      net=total+discount;
      printf("          Net           =%.2f Baht\n",net);
      printf("     -------------------------------\n");
      printf("          Enter Cash    :");scanf("%f",&cash);
      money=cash-net;
      printf("          Enter Money   =%.2f  Baht\n",money);
      printf("     -------------------------------\n");
      printf("              **** Thank You ****\n");
      printf("                 Plese com again\n");
      printf("            BY: Nattaporn Aimsa-ard \n");
      printf("     +*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+*+\n");
      getch();
}


ไม่มีความคิดเห็น: