Course Solutions Uncategorized (Solved) : Class Program Static Void Main String Args Ragged Array Store Temperatures Double Temps Ne Q33115248 . . . .

(Solved) : Class Program Static Void Main String Args Ragged Array Store Temperatures Double Temps Ne Q33115248 . . . .

 

class Program
{
static void Main(string[] args)
{
// ragged array to store temperatures
double[][] temps = { new double[31], new double[28], newdouble[31], new double[30],
new double[31], new double[30], new double[31], newdouble[31],
new double[30], new double[31], new double[30], new double[31]};
int row = 0; // row counter variable
int col = 0; // column counter variable
try
{
using (StreamReader sr = newStreamReader(“../../TestFile.txt”))
{
while (sr.Peek() > -1)
{
String line = sr.ReadLine();
col = 0;
String[] strArray = line.Split(‘,’);

foreach (String s in strArray)
{
temps[row][col] = Convert.ToDouble(s);

col++;
}
row++;
}
}
}
catch (Exception e)
{
Console.WriteLine(“The file could not be read:”);
Console.WriteLine(e.Message);
}

Can’t attach the text file but it goes like this for 12line:

-28.6,-27.1,-24.5,-28.9,-15.5,-28.0,-18.5,-20.6,-10.3,-11.3,-8.8,-5.5,-4.5,-3.2,-4.5,-10.5

-30.0,-16.3,-29.0,-5.0,-25.5,-28.0,-24.0,-1.0,-14.0,-24.3,-2.1,-8.0,-21.0,-28.3,-23.0,-12.0,-9.0

27.0,21.0,33.3,32.1,21.9,18.0,25.6,19.2,20.8,22.3,23.9,31.0,34.0,24.8,25.0

.
.
.

Expert Answer


An answer will be send to you shortly. . . .

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Answered) :(Answered) :

From your reading of Nolan (2006) argue the current inefficiencies and inequities in the Irish health insurance market and the health system in general. In your answer provide a debate