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 :

[codesyntax lang=”c” lines=”normal”]

#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();
}

[/codesyntax]

Screen shots :-

C_program_Post_Office

After Execution :-

C_program_Post_Office_Out1

 

C_program_Post_Office_Out2

Leave a Reply