Popular Posts

Saturday, November 28, 2015

Prepaid Monthly Calling System

/*Here is a program for a post paid customer .where every call cost is 1.25 tk.its a fully postpaid calling system where customer have a monthly limit but he can use how much he want to use. */

#include<stdio.h>

void main()
{
    float rbill=0,blnc,time,tmp_time=0;
    char ch;
    printf("Enter your monthly postpaid limit in taka: ");
    scanf("%f", &blnc);
    loop:
        {
            do
    {
        printf("\n\n");
        printf("Press for a call...");
        getch();
        printf("\nEnter your call time: ");
        scanf("%f", &tmp_time);
        time+=tmp_time;
        rbill+=(tmp_time*1.25);
        printf("Your total call time: %.2f minute.\nYour total bill: %.2f taka.",time,rbill);
    }while(rbill<blnc);
    printf("\n\nSorry You Have Crossed Your Monthly Limit.\nYou have used %.2f extra balance from your limit\n\n", (rbill-blnc));
    printf("If you still want to call press 'c' or 'C' key or Any key to end : ");
    scanf("%s", &ch);
    if(ch=='c'||ch=='C')
    {
        goto loop;
    }
    else
    {
        printf("Program end.");
    }

        }
}

No comments:

Post a Comment