
求一份学生管理系统课程设计报告,数据结构课程设计 100
现有学生成绩信息文件1(1.txt)
内容如下
姓名 学号 语文 数学 英语
张明明 01 67 78 82
李成友 02 78 91 88
张辉灿 03 68 82 56
王露 04 56 45 77
陈东明 05 67 38 47
…. .. .. ..
…
学生成绩信息文件2(2.txt)
内容如下:
姓名 学号 语文 数学 英语
陈果 31 57 68 82
李华明 32 88 90 68
张明东 33 48 42 56
李明国 34 50 45 87
陈道亮 35 47 58 77
…. .. .. ..
…
试编写一管理系统,要求如下:
1) 实现对两个文件数据进行合并,生成新文件3.txt
2) 抽取出三科成绩中有补考的学生并保存在一个新文件4.txt
3) 对合并后的文件3.txt中的数据按总分降序排序(至少采用两种排序方法实现)
4) 输入一个学生姓名后,能查找到此学生的信息并输出结果(至少采用两种查找方法实现)
所采用数据结构:
使用结构体,链或数组等实现上述要求.
大家帮下忙,答案可以贴网上,也可以发我qq:2407806506
拜托了,采纳可以加分
紧急!! 展开
为什么要中间拿那么多空格隔开呢?逗号或“|”都比那好弄。
如果这题是老师出的,老师一定脑袋有问题。
//==============
效果图查询自己写
需要的控件
private System.Windows.Forms.Button button1;
private System.Windows.Forms.RichTextBox richTextBox1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.RichTextBox richTextBox2;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
后台
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.Text;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class cj : Form
{
public StreamWriter SW;
public cj()
{
InitializeComponent();
string Header = "姓名" + " " + "学号" + " " + "语文" + " " + "数学" + " " + "英语" + "\n";
richTextBox1.AppendText(Header);
richTextBox2.AppendText(Header);
CheckDirectory();
}
private void button1_Click(object sender, EventArgs e)
{
string strFile;
strFile = System.Windows.Forms.Application.StartupPath + "\\3.txt";
OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.Filter = "文本文件(*.txt)|*.txt";
openFileDialog1.DefaultExt = "txt";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
string FileName = openFileDialog1.FileName;
if (Path.GetExtension(FileName) != ".txt")
{
MessageBox.Show("格式不对");
}
else
{
FileStream stream = new FileStream(openFileDialog1.FileName, FileMode.Open, FileAccess.Read);
StreamReader sReader = new StreamReader(openFileDialog1.FileName, Encoding.Default);
if (sReader.ReadLine().Split('\n').Length > 0)
{
richTextBox1.AppendText(sReader.ReadToEnd());
}
richTextBox1.AppendText("\n");
// StreamWriter ssw = new System.IO.StreamWriter(FileName, true, System.Text.Encoding.Default);
}
}
}
private void WriteLog(string msg)
{
string strFile;
strFile = System.Windows.Forms.Application.StartupPath + "\\data\\3.log";
// StreamWriter SW;
try
{
SW = new System.IO.StreamWriter(strFile, true);
SW.WriteLine(msg);
}
catch (Exception ex)
{
WriteLog(ex.Message);
}
finally
{
SW.Flush();
SW.Close();
}
}
private void button2_Click(object sender, EventArgs e)
{
richTextBox1.Text = "姓名" + " " + "学号" + " " + "语文" + " " + "数学" + " " + "英语" + "\n";
}
private void CheckDirectory()
{
if (Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\data") == false)
{
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\data");
}
if (Directory.Exists(System.Windows.Forms.Application.StartupPath + "\\data") == false)
{
Directory.CreateDirectory(System.Windows.Forms.Application.StartupPath + "\\data");
}
}
private void button3_Click(object sender, EventArgs e)
{
string rowdata = "";
int m = richTextBox1.Lines.Length;
string[] lines = new string[m];
for (int i = 1; i < m-1; i++) //每一行
{
lines[i] = richTextBox1.Lines[i]+"\n";
string[] cj = lines[i].Split(' ');
if (cj != null)
{
rowdata = " ";
for (int j = 0; j < cj.Length; j++) //每一列
{
if (cj[j].ToString() != "")
{
rowdata = rowdata + cj[j].ToString()+",";
}
}
rowdata.TrimEnd(',');
string[] ncj = rowdata.Split(',');
string str2 = ncj[2].ToString();
string str3 = ncj[3].ToString();
string str4 = ncj[4].ToString().TrimEnd('\n');
// if ((int.Parse(str2) + int.Parse(str3) + int.Parse(str4) < 180))
if ((int.Parse(str2)<60 || int.Parse(str3)<60 || int.Parse(str4) < 60))
{
richTextBox2.AppendText(lines[i]);
}
}
}
if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\data\\3.txt") == true)
{
File.Delete(System.Windows.Forms.Application.StartupPath + "\\data\\3.txt");
}
File.AppendAllText(System.Windows.Forms.Application.StartupPath + "\\data\\3.txt", richTextBox1.Text);
if (File.Exists(System.Windows.Forms.Application.StartupPath + "\\data\\4.txt") == true)
{
File.Delete(System.Windows.Forms.Application.StartupPath + "\\data\\4.txt");
}
File.AppendAllText(System.Windows.Forms.Application.StartupPath + "\\data\\4.txt", richTextBox2.Text);
MessageBox.Show("数据合成OK,在data文件夹");
}
}
}
那个,重大失误啊忘记说语言了,哥,能用c写一份么麻烦了,发E-mile吧