1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cash register program

Discussion in 'C' started by reddishmiles, Aug 28, 2010.

  1. reddishmiles

    reddishmiles New Member

    Joined:
    Aug 28, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi pls gelp me with my assignment.. i supposed to create a cash register program that will calculate customer's payment and change..
    here's what i have so far..

    Code:
    int main(void)
    {
    
    printf("Welcome to Reddish Bar&Cafe");
    printf("\n\n\Choose from the items below:");
    
    printf("\n\n\n\Margarita= 25 bucks");
    printf("\n\Beer= 10 bucks");
    printf("\n\Martini= 35 bucks");
    printf("\n\Rhum= 20 bucks");
    printf("\n\Tequilla= 25 bucks");
    printf("\n\Shots= 10 bucks");
    
    {
    int a, answer, yes;
        
        printf("\n\n\ enter first item;");
        scanf("%d",&a);
    
        printf("do you want to add another another item?");
        answer=0;
        do{
            printf(" yes or no? ");
            scanf("%d",&answer);
            } 
            while(answer==yes);
            printf("\n\n\please enter another item");
    }
    printf("\n\n\n\Thank you and come back again!!");
    
    
    return 0;
    }
    i cannot push thru.. i dont know to calculate as well. please help
    thanks!!
     

Share This Page