Make and run a program that will compute the total cost charges of a telephone call rendered from a particular network using the given table. The user will input call destination code (1 to 5), time code (1=off-peak, 2=peak), and the duration of call.
Off-peak Hours Rate/min
1 Calls to the same network P 8
2 Call to other network P 8
3 Call to a landline P 8
4 National direct dial P 11
5 International direct dial P 20
Peak hours Rate/min
1 Calls to the same network P 3
2 Call to other network P 4
3 Call to a landline P 4
4 National direct dial P 7
5 International direct dial P 20
*the program runs but all conditions follow eq1 even if i told it to print eq2,eq3,eq4,eq5 or eq6... meaning every number i input just multiply the duc by 8.
---------------------------------------...
#include<stdio.h>
#include<conio.h>
main()
{
int dc, tc, duc, eq1, eq2, eq3, eq4, eq5, eq6;
printf("Time Code:");
scanf("%d", &tc);
printf("Destination Code:");
scanf("%d", &dc);
printf("Duration Call:");
scanf("%d", &duc);
eq1=duc*8;
eq2=duc*11;
eq3=duc*3;
eq4=duc*4;
eq5=duc*7;
eq6=duc*20;
{
if((tc=1) && (dc=1))
printf("%d", eq1);
else if((tc=1) && (dc=2))
printf("%d", eq1);
else if((tc=1) && (dc=3))
printf("%d", eq1);
else if((tc=1) && (dc=4))
printf("%d", eq2);
else if((tc=1) && (dc=5))
printf("%d", eq6);
else if((tc=2) && (dc=1))
printf("%d", eq3);
else if((tc=2) && (dc=2))
printf("%d", eq4);
else if((tc=2) && (dc=3))
printf("%d", eq4);
else if((tc=2) && (dc=4))
printf("%d", eq5);
else if((tc=2) && (dc=5))
printf("%d", eq6);
}
getch();
}