This is my program, but it is giving me an error stating a Operator '*' cannot be applied to operands of type 'double[]' and 'double'. Can some one tell me how to fix this program.
The Chart-A-While phone company provides service to six codes and charges the following per minute rate for phone calls:
Area Code Per Minute Rate ($)
262 0.07
414 0.10
608 0.05
715 0.16
815 0.24
920 0.14
Write a program that allows a user to enter an area code and the length of times for a call in minutes, then display the total cost of the call.
class Program
{
static void Main()
{
//Declare variables
int[] VaildAreaCode = { 262, 414, 608, 715, 815, 920 };
double [] perminuterate = { 0.07, 0.10, 0.05, 0.16, 0.24, 0.14 };
string inputString;
double Totalcost;
double lengthoftime;
int AreaCode;
Console.Write("Enter Area Code:\n");
inputString = Console.ReadLine();
AreaCode = Convert.ToInt32(inputString);
Console.Write("Enter the length of Time:\n");
inputString = Console.ReadLine();
lengthoftime = Convert.ToInt32(inputString);
Totalcost = perminuterate * lengthoftime;
Console.WriteLine("AreaCode {0} Totalcost for {1}",
AreaCode, Totalcost.ToString("C"));
}
}