Question: Create an array to store the total price that should be paid by each customer. Calculate the total profit earned by adding total price from

Create an array to store the total price that should be paid by each customer. Calculate the total profit earned by adding total price from all customers who have ordered and display a message You achieve target today if the total profit for the day is more than RM5000, otherwise display Need more effort.

using programin C and GDB online

the output should be like the picture below

implement using into this code :

( if there are any error in code edit it please )

#include

float calculateprice(float delFee ,int rose ,int guci ,int coco ) ;

int main() { char CusN[200] ; int coco , rose , guci , close ; float bill , delFee , Sum ; int location ; while (close == 1) { printf("Welcome Anis De Essence shop ");

printf("Enter customer name : %s " , CusN ); scanf ("%s" , &CusN) ; printf("Enter quantity for Coco Chanel :%d " , coco ); scanf ("%d" , & coco); printf("Enter quantity for Rose Bbgari : %d " , rose ); scanf ("%d" , & rose); printf("Enter quantity for flower Guci : %d " , guci ); scanf ("%d" , & guci); printf("choose customer location 1- Selangor 2- pahang 3- KL : " , location ); scanf ("%d" , & location); if (location == 1 ) { delFee = 20.00 ; } else if (location == 2 ) { delFee = 25.00 ; } else if (location == 3 ) { delFee = 15.00 ; scanf ("%f" , & delFee); } printf ( "delivery price is : %f " , delFee ) ; Sum = calculateprice(delFee , rose , guci , coco ); printf ("Total price to be paid by %s including delivery = %f " , CusN , Sum ); printf (" please print 1 for menu and 0 to close "); scanf ("%d" , & close ) ; } return 0 ; }

float calculateprice (float delFee , int rose ,int guci , int coco ) { float bill ; bill = ((coco * 150) + (rose * 200) + (guci * 180) + delFee ); return bill ; } Create an array to store the total price that should be paid

You may refer sample output as in Figure 4. A CAWindows\system32\cmd.exe Rectangular Ship Welcome Anis De Essence shop Enter customer name : Aziz Enter quantity for Coco Chanell: 5 Enter quantity for Rose Bbgari : 2 Enter quantity for Flower Guci : 0 Choose customer location

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!