As there is lock down everywhere, and the time allocated for shopping is restricted, Mr. Umar went for shopping in the specified time, He went to the 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 medicines 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. Capture the bill m, n,p Compute the amount paid at individual place after discount. Display the bill amount paid at each place. Calculate the total amount spent Display the total amount spent by Mr. Umar
Answers
idk what im doing I just need the Madonna answers
Capture the bill m,n,p
Compute the amount paid at the individual place after discount
Display the bill amount paid at each place
Calculate the total amount spent
Display the total amount spent by Mr Umar
Explanation:
#include <stdio.h>
int main()
{
double m, n, p;
double totalAmount;
printf("Please input the total bill at the vegetable super market (Rs):\n");
scanf("%lf", &m);
printf("Please input the total bill at the Buy\'n\'Save shop (Rs):\n");
scanf("%lf", &n);
printf("Please input the total bill at the chemists shop (Rs):\n");
scanf("%lf", &p);
if ( m <= 0 || n <= 0 || p <= 0 ) {
printf("Error: all values must be positive numbers greater than zero");
return 0;
}
m = m - ( (m / 100) * 10);
n = n - ( (n / 100) * 12.5);
p = p - ( (p / 100) * 18);
printf("The bill amount paid at the vegetable super market (after discount):\n%.2lf Rs\n", m);
printf("The bill amount paid at the Buy\'n\'Save shop (after discount):\n%.2lf Rs\n", n);
printf("The bill amount paid at the chemists shop (after discount):\n%.2lf Rs\n\n", p);
totalAmount = m + n + p;
printf("The total amount spent by Mr. Umar:\n%.2lf Rs\n", totalAmount);
return 0;
}