Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- namespace _114_Assignment7_Task5
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- }
- public class MaxArray
- {
- public class MaxArray
- {
- private int[,] matrix;
- public MaxArray(string arrayFileName, int m, int n)
- {
- matrix = new int[m, n];
- FileStream file = new FileStream(arrayFileName, FileMode.Open, FileAccess.Read);
- StreamReader reader = new StreamReader(file);
- // verify "arrayFileName" is actually a valid file that exists
- // open the file
- // read the contents into m_matrix[][]
- // make sure you are safe not to accidentally go out of bounds on array
- }
- public int MaxFinder(int m, int n)
- {
- int maxValue = 0;
- int max = 0;
- int M = 0;
- if (m > maxValue)
- {
- maxValue = m;
- }
- else if (n > maxValue)
- {
- maxValue = n;
- }
- return maxValue;
- max = matrix[0, 0];
- for (int row = 0; row < M; row++)
- for (int column = 0; column < N; column++)
- {
- if (matrix[row, column] > max)
- max = matrix[row, column];
- }
- return max;
- // loop through all rows & columns of m_matrix
- // if (value > maxValue)
- // store biggest value
- // should we PRINT OUT the value?
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment