1. Planning
1.1 Requirements Description
According to the teacher's request, the problem of finding the largest sub-array in an array is solved by the program.
1.2 Estimated development time
five days.
1.3 Fill in the project data
generate the corresponding results according to your own programming.
1.4 Fill in the time log
1. Development
2.1 Design Program
By defining the array and then generating the corresponding program by using the Loop statement and the corresponding button.
2.2 Design implementation
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;
Namespace WindowsFormsApplication5
{
public partial class Form1:form
{
int []arraydata =new int [6];
Public Form1 ()
{
InitializeComponent ();
}
private void Form1_Load (object sender, EventArgs e)
{
}
private void Button1_Click (object sender, EventArgs e)
{
Lbldatafirst.text = "";
Random arr = new Random ();
for (int i = 0; i < 6; i++)
{
Arraydata[i] = arr. Next (50);
Lbldatafirst.text + = Arraydata[i]. ToString () + "";
}
Array.Sort (Arraydata);
Array.reverse (Arraydata);
foreach (int x in Arraydata)
{
Lbldatasecond.text + = x + "";
}
int M, N, M;
M = arraydata[0];
N = arraydata[1];
m = m + N;
Lbldatathird.text + = m;
}
private void Button2_Click (object sender, EventArgs e)
{
Lbldatafirst.text = "";
Lbldatasecond.text = "";
Lbldatathird.text = "";
}
}
}
2.3 Compile the program, repair and record the bugs found, and fill in the bug log
1. Summary
This program took about four days to complete, during the compilation process, the response to many of their own problems, such as in the code to write the syntax errors, forget or add symbols, as well as the debugging process occurs during debug expiration and other issues. But it has been preliminarily completed.
PSP0 Level Report