I have a program that calculates the average sales from 3 regions. My problem is that the input is more than half the program, is there a way to reduce the all the input commands?
static void Main()
{
while (true)
{
try
System.Console.Write("Enter sales for region1: store 1: "); // asks user to enter Store1, region1 sales.
double a = Convert.ToDouble(Console.ReadLine());// creates double variable a
System.Console.Write("Enter sales for region1: store 2: "); // asks user to enter Store2, region1 sales.
double b = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region1: store 3: "); // asks user to enter Store3, region1 sales.
double c = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region1: store 4: "); // asks user to enter Store4, region1 sales.
double d = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region1: store 5: "); // asks user to enter Store5, region1 sales.
double e = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region2: store 1: "); // asks user to enter Store1, region2 sales.
double f = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region2: store 2: "); // asks user to enter Store2, region2 sales.
double g = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region2: store 3: "); // asks user to enter Store3, region2 sales.
double h = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region3: store 1: "); // asks user to enter Store1, region3 sales.
double l = Convert.ToDouble(Console.ReadLine());
System.Console.Write("Enter sales for region3: store 2: "); // asks user to enter Store2, region3 sales.
double k = Convert.ToDouble(Console.ReadLine());
double[][] region = new double[3][]; // scores
region[0] = new double[5] { a, b, c, d, e }; // input into region0 array
region[1] = new double[3] { f, g, h, };//inout into region1 array
region[2] = new double[2] { l, k }; //input into region3 array
double sum; // sum of the sales for each region
double total = a + b + c + d + e + f + g + h + l + k; //for calulation of company sales.
Thanks for the ideas.
-sloshy