简易MFC的成绩管理系统

请添加图片描述

意义

掌握MFC控件的基本使用,结合了面向对象和Window消息机制的知识。
选择做简单的成绩管理系统,该项目切合大学生实际情况。易于更好理解。
项目实现了成绩的增加、修改、删除、存储(文件读写操作)的功能。

创建项目

打开软件:VS2022;创建新项目MFC应用;选择基于对话框;有必要的话添加对话框标题(用户界面功能)

设置UI界面

请添加图片描述

1、工具控件:列表(List Control),编辑框(Edit Control),静态文本(Static Text),下拉框(Combo Box),按钮(Button);
2、列表控件属性: 视图为Report
3、下拉列表外观属性 : 类型为下拉列表;行为属性:数据是 男;女;

为UI控件添加变量(很详细,必须理解)

1、选中控件,右键鼠标,添加变量。
在这里插入图片描述

2、添加控制变量,类别、名称、访问权限。(完成所有控件的变量设置,都是重复操作)
在这里插入图片描述
3、类向导
界面全部控件添加变量的类型和名称 (选择对话框 右击选择类向导可查看全部控件变量)
请添加图片描述
可以看到5个按钮对应界面的增 删 改 确定 取消,7个编辑框对应界面相应的属性等。

代码部分

1、创建两个类,一个为Student,存储学生的个人信息;一个为Management,管理学生的个人信息。
2、Student类包含七个成员变量,分别为学号、姓名、性别、年龄、地址、数学成绩、C++成绩。
3、Student类成员函数包括对 七个属性的值的获取与设置。
4、Management类成员变量即Student类列表。
5、Management类有四个成员函数对Student类进行 增 删 改 清

//Student.h
#pragma once
#include <iostream>
using namespace std;
class Student
{
   
private:
	string id;
	string name;
	string sex;
	string age;
	string address;
	string math;
	string programing;
public:
	Student();
	Student(string sid, string sname, string ssex, string sage, string saddress, string smath, string sprograming);
	void setName(string sname);
	void setId(string sid);
	void setAge(string sage);
	void setSex(string ssex);
	void setAddress(string saddress);
	void setMath(string smath);
	void setPrograming(string sprograming);
	string  getName();
	string  getSex();
	string  getAddress();
	string  getId();
	string  getAge();
	string  getMath();
	string  getPrograming();
	friend ostream& operator <<(ostream& os, Student& st);
	friend istream& operator >>(istream& is, Student& st);
	friend bool LessMath(const Student* st1, const Student* st2);
	friend bool LessOop(const Student* st1, const Student* st2);
	~Student();
};

//Student.cpp
#include "pch.h"
#include "Student.h"
#include <iostream>
#include <string>
using namespace std;

Student::Student() {
   }
Student::Student(string sid, string sname, string ssex, string sage, string saddress, string smath, string sprograming)
{
   
	id = sid;
	name = sname;
	sex = ssex;
	age = sage;
	address = saddress;
	math = smath;
	programing = sprograming;

}
void Student::setName(string sname)
{
   
	name = sname;
}
void Student::setId(string sid)
{
   
	id = sid;
}
void Student::setAge(string sage)
{
   
	age = sage;
}
void Student::setSex(string ssex)
{
   
	sex = ssex;
}
void Student::setAddress(string saddress)
{
   
	address = saddress;
}
void Student::setMath(string smath)
{
   
	math = smath;
}
void Student::setPrograming(string sprograming)
{
   
	programing = sprograming;
}
string Student::getName()
{
   
	return name;
}
string Student::getSex()
{
   
	return sex;
}
string Student::getAddress()
{
   
	return address;
}
string Student::getId()
{
   
	return id;
}
string  Student::getAge()
{
   
	return age;
}
string  Student::getMath()
{
   
	return math;
}
string Student::getPrograming()
{
   
	return programing;
}
ostream& operator<<(ostream& os, Student& st)
{
   
	os << st.id << '\t' << st.name << '\t';
	os << st.sex << '\t' << st.age << '\t';
	os << st.address << '\t' << st.math << '\t' << st.programing;
	return os;
}

istream& operator>>
  • 3
    点赞
  • 31
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
摘 要:随着社会的发展与科技的全面进步,使得人们越来越向信息化、数字化发展,管理 信息系统(MIS)是一个由人、计算机等组成的能进行信息的收集、传递、储存、加工、 维护和实用的系统,必然会代替过去大量的、繁琐的手工操作。对于学校来说,对学生 的各种信息进行统计并显示是非常重要的。本文通过Visual C++ 6.0的编程环境编写学生信息管理系统,利用Microsoft Office Access 2003数据库系统编写数据表,采用ADO数据库访问技术,用模块化设计方式将系统各个功 能模块层层分解,设计出系统的模块化结构,并根据系统的具体要求和需要实现功能, 详细的定义了各个模块的具体功能。开发主要包括后天数据库的建立和维护以及前端应 用程序的开发两个方面,实现了学生信息的创建及学生信息的输入、浏览、维护和统计 ,使得系统具有功能强大,界面友好的特点。 关键词:信息管理 ;Visual C++ 6.0 ;Access ;ADO Abstract: With the development of society and the progress of technology, cause the people more and more to the information, the digitized develop, the management information system composed by people and computer is a system which can collect, transmit, store, process and maintenance the information. It inevitably can massively replace the numerous and diver manual operation. For a school, it is very important to impose the information of the students and show them out. This article through the environment of Visual C++ 6.0 to compile the students information management system, uses Microsoft Office Access 2003 database system design database tables, uses the ADO technology contact the database, the systematic each function module layer upon layer will decompose with the way of the modular design, designs the modular structure of the system. The function of each modular will found according to the specific request of the system. The develops mainly includes two aspects, the backstage establishment and maintenance of database as well as the front end development of application procedure, has realized foundation, input, browsing, maintenance and statistics, enables the system to has the characteristics that formidable function and friendly surface. Key words: Information management; Visual C++6.0;Access; ADO 目 录 1 引言 1 2 系统概述 2 2.1 系统需求分析 2 2.1 可行性分析 2 3 运行环境及系统技术简介 2 3.1 Visual C++ 6.0简介 3 3.2 Microsoft Office Access 2003技术简介 3 3.3 ADO技术简介 4 3.4 C++语言简介 5 4 系统分析 5 4.1 系统流程 5 4.2 功能模块设计与实现 6 5 系统的设计与实现 7 5.1 数据库的分析与设计 7 5.1.1 创建数据库 7 5.1.2 创建用户信息表 7 5.1.3

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值