Jump to content

java experts


pawan kalyan

Recommended Posts

Write a program for an ATM to lend money to the user in the denominations of 100,500 and 2000 up to the limit of 20000. 
 
Please provide  java program   
Link to comment
Share on other sites

  • Replies 33
  • Created
  • Last Reply

Top Posters In This Topic

  • ICANWIN

    10

  • Prabhas_Fan

    9

  • BaabuBangaram

    4

  • fake_Bezawada

    3

Popular Days

Top Posters In This Topic

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

 

 

basic code dheeniki ni requirement ki add chesuko

Link to comment
Share on other sites

7 minutes ago, ICANWIN said:

Java program free ga rasiste money nuvvu withdraw chesukuntava dude? @3$%

1000 rupees note istadu antele bhayya raasivvu

Link to comment
Share on other sites

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

 

 

basic code dheeniki ni requirement ki add chesuko

Idi Java kadu kada...idi C/C++

Link to comment
Share on other sites

2 minutes ago, BaabuBangaram said:

syntax ee kadha vayya difference..

Java is platform independent. Ayina programming language ki syntax aey kada mukhyam. #~`

Link to comment
Share on other sites

1 minute ago, Kernel said:

As it is ga google kar.. you will find pre written code @3$%

Serious post ayite ade chesevadu instead of posting here. silent_I1

Link to comment
Share on other sites

42 minutes ago, ICANWIN said:

Java is platform independent. Ayina programming language ki syntax aey kada mukhyam. #~`

Syntax kuda change chesukolekapothe inka Endhuku vayya Btech chadivi

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...