A C program to prompt user with option on menu at Post Office – IGNOU MCA Assignment 2014 – 15

By | July 23, 2014

BACHELOR OF COMPUTER APPLICATIONS
Course Code : BCSL-021
Course Title : C Language Programming
Assignment Number : BCA(II)/L-021/Assign/14-15
Maximum Marks : 50
Weightage : 25%

 

Write an interactive C program which prompts the user with the following options on the opening menu at any Post Office:

1) Information about the Post Office

2) Details of the Services at that Post Office

3) Rates- list for various services like Registered post, Parcels, Speed

Post, Money Order etc

4) Important Circulars / Notices for the information

5) Timings of the Post Office

6) Quit

Enter your choice:

If “1” is entered, should display the information about the Post Office.

If “2” is entered, it should give the details of all the services available at that Post Office.

If “3” is entered, it should display the list of rates for various services.

If “4” is entered important circulars, notices should be displayed.

If “5” is entered schedules/timings for the various services and also the working hours of the Post Office should be displayed.

If the user enters any letters or numbers other than the choice, redisplay the prompt. All outputs should go to the terminal and all input should come from the keyboard.

#include<stdio.h>
#include<dos.h>
void main()
{
int NUM;
struct date D;
clrscr();
getdate(&D);
START:
printf(“\n______________________________________________________________________”);
printf(“\n\t INDIAN POST “);
printf(“\n\t ministry of communication and information technoloy”);
printf(“\n______________________________________________________________________”);
printf(“\n\n POST OFFICE MALAD BRANCH “);
printf(“\t\t\tToday %d / %d / %d\n”,D.da_day,D.da_mon,D.da_year);
printf(“\n______________________________________________________________________”);
printf(“\n\n\t\tSELECT CHOICE\n”);
printf(“\n 1. Information about the Post Office\n”);
printf(“\n 2. Details of the Services at that Post Office\n”);
printf(“\n 3. Rates- list for various services\n”);
printf(“\n 4. Important Circulars / Notices for the information\n”);
printf(“\n 5. Timings of the Post Office\n”);
printf(“\n 6. Quit\n”);
printf(“______________________________________________________________________”);
printf(“\n\t\tENTER CHOICE HERE :”);
scanf(“%d”,&NUM);
switch(NUM)
{
case 1 : printf(“\n______________________________________________________________________”);
printf(“\n\t Information about the Post Office\n”);
printf(“\n______________________________________________________________________”);
printf(“\n\t For more than 150 years, the Department of Posts”);
printf(“\n\t (DoP) has been the backbone of the country’s”);
printf(“\n\t communication and has played a crucial role in”);
printf(“\n\t the country’s socio-economic development. “);
printf(“\n\t It touches the lives of Indian citizens in many”);
printf(“\n\t ways: delivering mails, accepting deposits under”);
printf(“\n\t Small Savings Schemes, providing life insurance”);
printf(“\n\t cover under Postal Life Insurance (PLI) and Rural”);
printf(“\n\t Postal Life Insurance (RPLI) and providing retail”);
printf(“\n\t services like bill collection, sale of forms, etc.”);
printf(“\n\t The DoP also acts as an agent for Government of India”);
printf(“\n\t in discharging other services for citizens such as”);
printf(“\n\t Mahatma Gandhi National Rural Employment Guarantee”);
printf(“\n\t Scheme (MGNREGS) wage disbursement and old age pension”);
printf(“\n\t payments. With 1,55,015 Post Offices, the DoP has the”);
printf(“\n\t most widely distributed postal network in the world.\n”);
printf(“______________________________________________________________________”);
break;
case 2 : printf(“\n______________________________________________________________________”);
printf(“\n\t Details of the Services at that Post Office\n”);
printf(“\n______________________________________________________________________”);
printf(“\n\t Registered post \n\t Parcels Speed Post \n\t Money Order”);
printf(“\n\t Stamps \n\t Postal RD and Savings \n\t Telephone Bill payment\n”);
printf(“\n______________________________________________________________________”);
break;
case 3 : printf(“\n______________________________________________________________________”);
printf(“\n\t Rates- list for various services\n”);
printf(“\n______________________________________________________________________”);
printf(“\n With the launch of the scheme ‘One India, One Rate’”);
printf(“\n People can send speed post at INR 35″);
printf(“\n (Previous Rate 25, Rates revised on Octomber 1, 2012 With new rate INR 35)”);
printf(“\n\n for all destinations across India, from Kashmir to Kanyakumari.”);
printf(“\n User can send Local Speed Post upto 50 grams at INR 15 + taxes. “);
printf(“\n\n Local Speed Post at INR 15 “);
printf(“\n ‘One India One Rate’ Speed Post at INR 35″);
printf(“\n\n Below are the Speed Post rates (Effective 1st Oct 2012)”);
printf(“\n______________________________________________________________________”);
printf(“\n Weight\t\t\tLocal upto200 201-1000 1001-2000 >2000 KM”);
printf(“\n______________________________________________________________________”);
printf(“\n\t\n Upto 50 Grams \tRs 15 Rs 35 Rs 35 Rs 35 Rs 35″);
printf(“\n\t\n 51 to 200 Grams Rs 25 Rs 35 Rs 40 Rs 60 Rs 70″);
printf(“\n\t\n 201 to 500 Grams Rs 30 Rs 50 Rs 60 Rs 80 Rs 90″);
printf(“\n\t\n Additional 1/2kg \tRs 10 Rs 15 Rs 30 Rs 40 Rs 50\n”);
printf(“\n______________________________________________________________________”);
break;
case 4 : printf(“\n______________________________________________________________________”);
printf(“\n\t Important Circulars / Notices for the information\n”);
printf(“\n______________________________________________________________________”);
printf(“\nAdmit cards for PM Grade I Departmental Examination scheduled to be held on 20.07.02014″);
printf(“\n\nTender for Empanelling fleet operators/Transport Service Providers for Logistics Post Services – CPMG, Tamilnadu Circle, and Chennai:-600002. (Tender ID: 2014_DOP_10361_1)”);
printf(“\n\nRecruitment of PA/SA, Postman & MTS in Karnataka Circle under Sports Quota”);
printf(“\n\nTender for Supply of 64 Small Form Factor Pluggable Transreceiver (SFP) – (Tender ID 2014_DOP_10321_1)”);
printf(“\n\nPrime Minister released commemorative postage stamps on 2014 FIFA World Cup\n”);
printf(“\n______________________________________________________________________”);
break;
case 5 : printf(“\n______________________________________________________________________”);
printf(“\n\t Timings of the Post Office\n”);
printf(“\n______________________________________________________________________”);
printf(“\n\nFor Reference and enquiries, sale of the postage stamps and stationery and grant of certificate of posting take place during the entire working hour of the office.”);
printf(“\n\nFor booking of registered and insured articles, including value payable articles parcels and telegraphic money orders. For about six to seven hours (On Saturdays usually for five hours stopping at 3 pm)”);
printf(“\n\nFor issue of money orders, sale and payments of postal orders, Savings Bank and Post Office Certificate transactions and payment of telephone bills. Etc. For about five hours (One Saturdays for three hours stopping at 1 p.m.) \n”);
printf(“\n______________________________________________________________________”);
break;

case 6 : printf(“READY TO QUIT !!!”);
goto EXIT;

default: goto START;
}
EXIT:
getch();
}

Program Code :

  1. #include<stdio.h>
  2. #include<dos.h>
  3. void main()
  4. {
  5. int NUM;
  6. struct date D;
  7. clrscr();
  8. getdate(&D);
  9. START:
  10. printf("\n______________________________________________________________________");
  11. printf("\n\t INDIAN POST ");
  12. printf("\n\t ministry of communication and information technoloy");
  13. printf("\n______________________________________________________________________");
  14. printf("\n\n POST OFFICE MALAD BRANCH ");
  15. printf("\t\t\tToday %d / %d / %d\n",D.da_day,D.da_mon,D.da_year);
  16. printf("\n______________________________________________________________________");
  17. printf("\n\n\t\tSELECT CHOICE\n");
  18. printf("\n 1. Information about the Post Office\n");
  19. printf("\n 2. Details of the Services at that Post Office\n");
  20. printf("\n 3. Rates- list for various services\n");
  21. printf("\n 4. Important Circulars / Notices for the information\n");
  22. printf("\n 5. Timings of the Post Office\n");
  23. printf("\n 6. Quit\n");
  24. printf("______________________________________________________________________");
  25. printf("\n\t\tENTER CHOICE HERE :");
  26. scanf("%d",&NUM);
  27. switch(NUM)
  28. {
  29. case 1 : printf("\n______________________________________________________________________");
  30. printf("\n\t Information about the Post Office\n");
  31. printf("\n______________________________________________________________________");
  32. printf("\n\t For more than 150 years, the Department of Posts");
  33. printf("\n\t (DoP) has been the backbone of the country's");
  34. printf("\n\t communication and has played a crucial role in");
  35. printf("\n\t the country’s socio-economic development. ");
  36. printf("\n\t It touches the lives of Indian citizens in many");
  37. printf("\n\t ways: delivering mails, accepting deposits under");
  38. printf("\n\t Small Savings Schemes, providing life insurance");
  39. printf("\n\t cover under Postal Life Insurance (PLI) and Rural");
  40. printf("\n\t Postal Life Insurance (RPLI) and providing retail");
  41. printf("\n\t services like bill collection, sale of forms, etc.");
  42. printf("\n\t The DoP also acts as an agent for Government of India");
  43. printf("\n\t in discharging other services for citizens such as");
  44. printf("\n\t Mahatma Gandhi National Rural Employment Guarantee");
  45. printf("\n\t Scheme (MGNREGS) wage disbursement and old age pension");
  46. printf("\n\t payments. With 1,55,015 Post Offices, the DoP has the");
  47. printf("\n\t most widely distributed postal network in the world.\n");
  48. printf("______________________________________________________________________");
  49. break;
  50. case 2 : printf("\n______________________________________________________________________");
  51. printf("\n\t Details of the Services at that Post Office\n");
  52. printf("\n______________________________________________________________________");
  53. printf("\n\t Registered post \n\t Parcels Speed Post \n\t Money Order");
  54. printf("\n\t Stamps \n\t Postal RD and Savings \n\t Telephone Bill payment\n");
  55. printf("\n______________________________________________________________________");
  56. break;
  57. case 3 : printf("\n______________________________________________________________________");
  58. printf("\n\t Rates- list for various services\n");
  59. printf("\n______________________________________________________________________");
  60. printf("\n With the launch of the scheme 'One India, One Rate'");
  61. printf("\n People can send speed post at INR 35");
  62. printf("\n (Previous Rate 25, Rates revised on Octomber 1, 2012 With new rate INR 35)");
  63. printf("\n\n for all destinations across India, from Kashmir to Kanyakumari.");
  64. printf("\n User can send Local Speed Post upto 50 grams at INR 15 + taxes. ");
  65. printf("\n\n Local Speed Post at INR 15 ");
  66. printf("\n 'One India One Rate' Speed Post at INR 35");
  67. printf("\n\n Below are the Speed Post rates (Effective 1st Oct 2012)");
  68. printf("\n______________________________________________________________________");
  69. printf("\n Weight\t\t\tLocal upto200 201-1000 1001-2000 >2000 KM");
  70. printf("\n______________________________________________________________________");
  71. printf("\n\t\n Upto 50 Grams \tRs 15 Rs 35 Rs 35 Rs 35 Rs 35");
  72. printf("\n\t\n 51 to 200 Grams Rs 25 Rs 35 Rs 40 Rs 60 Rs 70");
  73. printf("\n\t\n 201 to 500 Grams Rs 30 Rs 50 Rs 60 Rs 80 Rs 90");
  74. printf("\n\t\n Additional 1/2kg \tRs 10 Rs 15 Rs 30 Rs 40 Rs 50\n");
  75. printf("\n______________________________________________________________________");
  76. break;
  77. case 4 : printf("\n______________________________________________________________________");
  78. printf("\n\t Important Circulars / Notices for the information\n");
  79. printf("\n______________________________________________________________________");
  80. printf("\nAdmit cards for PM Grade I Departmental Examination scheduled to be held on 20.07.02014");
  81. printf("\n\nTender for Empanelling fleet operators/Transport Service Providers for Logistics Post Services - CPMG, Tamilnadu Circle, and Chennai:-600002. (Tender ID: 2014_DOP_10361_1)");
  82. printf("\n\nRecruitment of PA/SA, Postman & MTS in Karnataka Circle under Sports Quota");
  83. printf("\n\nTender for Supply of 64 Small Form Factor Pluggable Transreceiver (SFP) - (Tender ID 2014_DOP_10321_1)");
  84. printf("\n\nPrime Minister released commemorative postage stamps on 2014 FIFA World Cup\n");
  85. printf("\n______________________________________________________________________");
  86. break;
  87. case 5 : printf("\n______________________________________________________________________");
  88. printf("\n\t Timings of the Post Office\n");
  89. printf("\n______________________________________________________________________");
  90. printf("\n\nFor Reference and enquiries, sale of the postage stamps and stationery and grant of certificate of posting take place during the entire working hour of the office.");
  91. printf("\n\nFor booking of registered and insured articles, including value payable articles parcels and telegraphic money orders. For about six to seven hours (On Saturdays usually for five hours stopping at 3 pm)");
  92. printf("\n\nFor issue of money orders, sale and payments of postal orders, Savings Bank and Post Office Certificate transactions and payment of telephone bills. Etc. For about five hours (One Saturdays for three hours stopping at 1 p.m.) \n");
  93. printf("\n______________________________________________________________________");
  94. break;
  95. case 6 : printf("READY TO QUIT !!!");
  96. goto EXIT;
  97. default: goto START;
  98. }
  99. EXIT:
  100. getch();
  101. }

Screen shots :-

C_program_Post_Office

After Execution :-

C_program_Post_Office_Out1

 

C_program_Post_Office_Out2

Leave a Reply