hello everyone I changed the program like that but it still give me error
please help me.
#include <stdio.h>
int main ()
{
char A; char G; double a,b,c,d ;
double X,u,Y ; double campus,company,telecom,other;
double q,w,r; double h,j,t; char P; char C;
do
{
printf("Please enter the chosen program?\n");
printf("P: professional, G: progressive, C: campus>\n");
scanf("%c",&A);
}
while (!(A == 'P' || A == 'G' || A == 'C'));
printf("Invalid program, chose your program again >");
scanf("%c",&A);
switch (A)
{
case 'P' :
{
printf("Monthly standard fee of the program is 12.00 YTL\n");
printf("Please enter call durations in min for the program P\n");
printf("Within operator in off peak hours >\n");
scanf("%lf",&a);
printf("Within operator in peak hours >\n");
scanf("%lf",&b);
printf("Turkish telecom\n");
scanf("%lf",&c);
printf("other operators >\n");
scanf("%lf",&d);
u=(0.32*a+0.35*b+0.35*c+0.35*d) ;
X=u-12;
if (u == 12.00 || u < 12.00)
printf("The amount due from the customer is %.2f\n",u);
else
printf("The amount due from the customer is %.2f\n",X);
break;
}
case 'C' :
{
printf("Monthly standard fee of the program is 0.50 YTL\n");
printf("Please enter call durations in min for the program C\n");
printf("Within campus\n");
scanf("%lf",&campus);
printf("Within operator company\n");
scanf("%lf",&company);
printf("Turkish telecom\n");
scanf("%lf",&telecom);
printf("Other operators\n");
scanf("%lf",&other);
Y=(0.17*campus+0.26*company+0.26*telecom+0.60*other);
printf("The amount due from the customer is %.2f\n",Y);
break;
}
case 'G' :
{
printf("Monthly standard fee of the program is 0.00 YTL\n");
printf("Please enter call durations in min for the program G\n");
printf("Within operator company\n");
scanf("%lf",&q);
printf("Turkish telecom\n");
scanf("%lf",&w);
printf("other operators\n");
scanf("%lf",&r);
h=(0.39*q+0.39*w+0.60*r);
j=(0.33*q+0.39*w+0.60*r);
t=(0.29*q+0.39*w+0.60*r);
if ( q == 5 || q <5)
printf("The amount due from the customer is %.2f\n",h);
else if ( q>5 || q<=10 )
printf("The amount due from the customer is %.2f\n",j);
else
printf("The amount due from the customer is %.2f\n",t);
break;
}
}
return 0;
}
the error is: P,G,and C are unreferenced local variables