Answer to Question #288333 in C for sania

Question #288333

As there is lock down everywhere, and the time allocated for shopping is restricted, Mr. Umar goes for shopping in the specified time, He went to vegetable super market, He purchased some vegetables and fruits the total bill was “m” Rs. and he got a discount of 10% there. Next he went to Buy n Save shop and purchased the groceries and the bill amount generated there was “n” Rs and here he got a discount of 12.5%. Later he went to buy medicine and there the bill was “p” Rs. and there also he got a discount of 18%.

His mother asked the bill details and the total amount he spent today. Help to create a C application for the same.

Requirements.

1.    Capture the bill m,n,p

2.    Compute the amount paid at individual place after discount

3.    Display the bill amount paid at each place

4.    Calculate the total amount spent

5.    Display the total amount spent by Mr. Umar



1
Expert's answer
2022-01-18T02:07:03-0500
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>
/*
	As there is lock down everywhere, and the time allocated for shopping is restricted, 
	Mr. Umar goes for shopping in the specified time, He went to vegetable super market, 
	He purchased some vegetables and fruits the total bill was “m” Rs. and he got a discount of 10% there. 
	Next he went to Buy n Save shop and purchased the groceries and the bill amount generated there was “n” Rs and 
	here he got a discount of 12.5%. Later he went to buy medicine and there the bill was “p” Rs. and there also he got a discount of 18%.
	His mother asked the bill details and the total amount he spent today. Help to create a C application for the same.
	Requirements.
	1.    Capture the bill m,n,p
	2.    Compute the amount paid at individual place after discount
	3.    Display the bill amount paid at each place
	4.    Calculate the total amount spent
	5.    Display the total amount spent by Mr. Umar
*/


int main()
{
	float m,n,p;
	float ma,na,pa;
	float md=10,nd=12.5,pd=18;
	
	printf("\n\tEnter the Vegetable Super Market Bill Amount (m) = "); scanf("%f",&m);
	printf("\n\tEnter the Buy 'n' Save Shope     Bill Amount (n) = "); scanf("%f",&n);
	printf("\n\tEnter the Medical Store          Bill Amount (m) = "); scanf("%f",&p);
	
	ma = m - (md*m)/100;
	na = n - (nd*n)/100;
	pa = p - (pd*p)/100;
	
	printf("\n\n\tActual Amount paid at Vegetable Market  @ Discount (=%.2f%c) = %.2f",md,'%',ma);
	printf("\n\n\tActual Amount paid at Buy 'n' Save Shop @ Discount (=%.2f%c) = %.2f",nd,'%',na);
	printf("\n\n\tActual Amount paid at Medical Store     @ Discount (=%.2f%c) = %.2f",pd,'%',pa);
	
	printf("\n\nTotal Amount spent = %.2f",(ma+na+pa));
	return(0);
	
}

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