Answer to Question #159192 in C for hamna

Question #159192

Make a general store receipt of the customer who has bought several items. The Output should contain regular price of an item, the department code, and calculated the discount price. The receipt should be proper formatted using Escape sequence 



1
Expert's answer
2021-01-28T09:52:44-0500
#include <stdio.h>
#include <math.h>
int main() {
    char itm[25];
    int dpart_cd;
    float rg_prc, discnt_prc;
    printf("Enter the name of item: "); scanf("%s", itm);
    printf("Enter the regular price of item: "); scanf("%f", &rg_prc);
    printf("Enter the discount price of item: "); scanf("%f", &discnt_prc);
    printf("Enter the department code: "); scanf("%d", &dpart_cd);
    printf("|=*=*=*=*=*=* receipt =*=*=*=*=*=*|");
    printf("\nItem: %s", itm);
    printf("\nDepartment Code: %d", dpart_cd);
    printf("\nRegular price: %f$", rg_prc);
    printf("\nDiscount price: %f$", discnt_prc);
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS