Selasa, 21 Ogos 2018

RISIKO MEMBELI RUMAH DI TEPI EMPANGAN DI MALAYSIA

[A] NANTI RASA SEJUK.
[B] NANTI RASA SEPERTI DIPUJA.
[C] NANTI DAPAT PENGHARGAAN DARI MENTERI BESAR.
[D] NANTI DAPAT SIJIL DARI ENCIK ABU SECATEEN.

   /*
  1.  * C Program to Display the ATM Transaction
  2.  */
  3. #include <stdio.h>
  4.  
  5. unsigned long amount=1000, deposit, withdraw;
  6. int choice, pin, k;
  7. char transaction ='y';
  8.  
  9. void main()
  10. {
  11.         while (pin != 1520)
  12.         {
  13.                 printf("ENTER YOUR SECRET PIN NUMBER:");
  14.                 scanf("%d", &pin);
  15.                 if (pin != 1520)
  16.                 printf("PLEASE ENTER VALID PASSWORD\n");
  17.         }
  18.         do
  19.         {
  20.                 printf("********Welcome to ATM Service**************\n");
  21.                 printf("1. Check Balance\n");
  22.                 printf("2. Withdraw Cash\n");
  23.                 printf("3. Deposit Cash\n");
  24.                 printf("4. Quit\n");
  25.                 printf("******************?**************************?*\n\n");
  26.                 printf("Enter your choice: ");
  27.                 scanf("%d", &choice);
  28.                 switch (choice)
  29.                 {
  30.                 case 1:
  31.                         printf("\n YOUR BALANCE IN Rs : %lu ", amount);
  32.                         break;
  33.                 case 2:
  34.                         printf("\n ENTER THE AMOUNT TO WITHDRAW: ");
  35.                         scanf("%lu", &withdraw);
  36.                         if (withdraw % 100 != 0)
  37.                         {
  38.                                 printf("\n PLEASE ENTER THE AMOUNT IN MULTIPLES OF 100");
  39.                         }
  40.                         else if (withdraw >(amount - 500))
  41.                         {
  42.                                 printf("\n INSUFFICENT BALANCE");
  43.                         }
  44.                         else
  45.                         {
  46.                                 amount = amount - withdraw;
  47.                                 printf("\n\n PLEASE COLLECT CASH");
  48.                                 printf("\n YOUR CURRENT BALANCE IS%lu", amount);
  49.                         }
  50.                         break;
  51.                 case 3:
  52.                         printf("\n ENTER THE AMOUNT TO DEPOSIT");
  53.                         scanf("%lu", &deposit);
  54.                         amount = amount + deposit;
  55.                         printf("YOUR BALANCE IS %lu", amount);
  56.                         break;
  57.                 case 4:
  58.                         printf("\n THANK U USING ATM");
  59.                         break;
  60.                 default:
  61.                         printf("\n INVALID CHOICE");
  62.                 }
  63.                 printf("\n\n\n DO U WISH TO HAVE ANOTHER TRANSCATION?(y/n): \n");
  64.                 fflush(stdin);
  65.                 scanf("%c", &transaction);
  66.                 if (transaction == 'n'|| transaction == 'N')
  67.                     k = 1;
  68.         } while (!k);
  69.         printf("\n\n THANKS FOR USING OUT ATM SERVICE");
  70. }


Tiada ulasan:

Catat Ulasan