Ask Question

Name:
Title:
Your Question:

Answer Question

Name:
Your Answer:
User Submitted Source Code!


Description:
  mobile
Language: C/C++
Code:
#include <stdio.h>
#include <conio.h>

clrscr();
int main() 
{

    char     payment;
    int      choice=0;
    float    q=0,amount=0;
    
        printf("MOBILE ZONE\n\n");
    
        printf("[1] CHERRY FLARE S PLAY\n");
        printf("[2] CLOUDFONE EXCITE\n");
        printf("[3] MYPHONE S2\n");
        printf("[4] SKK LYNX\n");
        printf("[5] BS MOBILE BILLIE G3\n\n");
    
        printf("Enter your choice:\t");
            scanf("%d",&choice);
        printf("nQuantity:t");
            scanf("%f",&q);
        printf("nMode of payment [a]Cash [b]Credit Card [c]Cheque");
            scanf("n%s",&payment);
            
        switch(choice)
        {
            case '1':
                amount=q*3999;
                break;    
            case '2':
                amount=q*3999;
                break;
            case '3':
                amount=q*3499;
                break;
            case '5':
                amount=q*2999;
                break;
            case '6':
                amount=q*2999;
                break;
            default:amount=0;
        }

        switch(payment)
        {
            case 'a':
                printf("Amount due: %f",amount);
                break;
            case 'b':
                amount=amount+(amount*0.03);
                printf("Amount due: %f",amount);
                break;
            case 'c':
                amount=amount+(amount*0.05);
                printf("Amount due: %f",amount);
                break;
        }    
    
    getch();
    return 0;
}
          
          
Comments: