简单的Java小项目
学生选课系统
在控制台输入输出信息:
在eclipse上面的超级简单文件结构:
Main.java
package experiment_4;import java.util.*;
import java.io.*;public class Main {public static List<Course> courseList = new ArrayList<>();public static List<Teacher> teacherList = new ArrayList<>();public static List<Student> studentList = new ArrayList<>();public static void main(String[] args) {loadData();Scanner scanner = new Scanner(System.in);while (true) {System.out.println("===== 欢迎使用学生选课系统 =====");System.out.print("请输入用户名(输入exit退出):");String username = scanner.nextLine();if (username.equals("exit")) {saveData();break;}System.out.print("请输入密码:");String password = scanner.nextLine();User user = null;if (username.equals("admin")) {user = new Admin(username, courseList, teacherList, studentList);} else {user = findUserByUsername(username);}if (user == null) {System.out.println("用户不存在!");continue;}if (!user.verifyPassword(password)) {System.out.println("密码错误!");continue;}user.operate();}scanner.close();}private static User findUserByUsername(String username) {for (Teacher teacher : teacherList) {if (teacher.getUsername().equals(username)) {return teacher;}}for (Student student : studentList) {if (student.getUsername().equals(username)) {return student;}}return null;}private static void loadData() {try (ObjectInputStream ois1 = new ObjectInputStream(new FileInputStream("C:\\Users\\86183\\Desktop\\courses.txt"));ObjectInputStream ois2 = new ObjectInputStream(new FileInputStream("C:\\Users\\86183\\Desktop\\teachers.txt"));ObjectInputStream ois3 = new ObjectInputStream(new FileInputStream("C:\\Users\\86183\\Desktop\\students.txt"))) {courseList = (List<Course>) ois1.readObject();teacherList = (List<Teacher>) ois2.readObject();studentList = (List<Student>) ois3.readObject();} catch (Exception e) {System.out.println("初次运行,未找到数据文件。");}}private static void saveData() {try (ObjectOutputStream oos1 = new ObjectOutputStream(new FileOutputStream("C:\\Users\\86183\\Desktop\\courses.txt"));ObjectOutputStream oos2 = new ObjectOutputStream(new FileOutputStream("C:\\Users\\86183\\Desktop\\teachers.txt"));ObjectOutputStream oos3 = new ObjectOutputStream(new FileOutputStream("C:\\Users\\86183\\Desktop\\students.txt"))) {oos1.writeObject(courseList);oos2.writeObject(teacherList);oos3.writeObject(studentList);System.out.println("数据已保存。");} catch (IOException e) {e.printStackTrace();}}
}
Admin.java
package experiment_4;import java.util.*;
import java.io.*;public class Admin extends User {private List<Course> courseList;private List<Teacher> teacherList;private List<Student> studentList;public Admin(String username, List<Course> courseList, List<Teacher> teacherList, List<Student> studentList) {super(username);this.courseList = courseList;this.teacherList = teacherList;this.studentList = studentList;}@Overridepublic void displayMenu() {System.out.println("===== 管理员菜单 =====");System.out.println("1. 添加课程");System.out.println("2. 删除课程");System.out.println("3. 按照选课人数排序");System.out.println("4. 显示课程清单");System.out.println("5. 修改授课教师");System.out.println("6. 显示学生列表");System.out.println("7. 显示教师列表");System.out.println("8. 恢复学生和教师初始密码");System.out.println("9. 添加老师和学生");System.out.println("10. 删除老师和学生");System.out.println("0. 退出");System.out.print("请选择操作:");}@Overridepublic void operate() {Scanner scanner = new Scanner(System.in);while (true) {displayMenu();int choice = scanner.nextInt();switch (choice) {case 1:addCourse();break;case 2:deleteCourse();break;case 3:sortCoursesByStudentNumber();break;case 4:displayCourseList();break;case 5:modifyCourseTeacher();break;case 6:displayStudentList();break;case 7:displayTeacherList();break;case 8:resetPasswords();break;case 9:addUser();break;case 10:deleteUser();break;case 0:System.out.println("退出管理员系统。");return;default:System.out.println("无效的选择,请重新输入。");}}}private void addCourse() {Scanner scanner = new Scanner(System.in);System.out.print("请输入课程ID:");String courseID = scanner.nextLine();System.out.print("请输入课程名称:");String courseName = scanner.nextLine();System.out.print("请输入授课教师用户名:");String teacherName = scanner.nextLine();Teacher teacher = findTeacherByUsername(teacherName);if (teacher == null) {System.out.println("教师不存在!");return;}System.out.print("课程类型(1.必修 2.选修):");int type = scanner.nextInt();if (type == 1) {Course course = new CompulsoryCourse(courseID, courseName, teacher);courseList.add(course);// 所有学生自动加入必修课for (Student student : studentList) {student.getCoursesEnrolled().add(course);course.incrementStudentNumber();}} else if (type == 2) {System.out.print("请输入选修课最大人数:");int maxStudents = scanner.nextInt();Course course = new ElectiveCourse(courseID, courseName, teacher, maxStudents);courseList.add(course);} else {System.out.println("无效的课程类型!");return;}teacher.getCoursesTaught().add(courseList.get(courseList.size() - 1));System.out.println("课程添加成功!");}private void deleteCourse() {Scanner scanner = new Scanner(System.in);System.out.print("请输入要删除的课程ID:");String courseID = scanner.nextLine();Course course = findCourseByID(courseID);if (course != null) {courseList.remove(course);// 从教师和学生的课程列表中删除该课程course.getTeacher().getCoursesTaught().remove(course);for (Student student : studentList) {student.getCoursesEnrolled().remove(course);}System.out.println("课程删除成功!");} else {System.out.println("课程不存在!");}}private void sortCoursesByStudentNumber() {Collections.sort(courseList, new Comparator<Course>() {@Overridepublic int compare(Course c1, Course c2) {return c2.getNumberOfStudents() - c1.getNumberOfStudents();}});System.out.println("课程已按照选课人数排序!");}private void displayCourseList() {System.out.println("===== 课程清单 =====");for (Course course : courseList) {System.out.println(course);}}private void modifyCourseTeacher() {Scanner scanner = new Scanner(System.in);System.out.print("请输入要修改的课程ID:");String courseID = scanner.nextLine();Course course = findCourseByID(courseID);if (course == null) {System.out.println("课程不存在!");return;}System.out.print("请输入新教师的用户名:");String teacherName = scanner.nextLine();Teacher newTeacher = findTeacherByUsername(teacherName);if (newTeacher == null) {System.out.println("教师不存在!");return;}// 更新教师信息course.getTeacher().getCoursesTaught().remove(course);course.setTeacher(newTeacher);newTeacher.getCoursesTaught().add(course);System.out.println("授课教师修改成功!");}private void displayStudentList() {System.out.println("===== 学生列表 =====");for (Student student : studentList) {System.out.println(student.getUsername());}}private void displayTeacherList() {System.out.println("===== 教师列表 =====");for (Teacher teacher : teacherList) {System.out.println(teacher.getUsername());}}private void resetPasswords() {for (Student student : studentList) {student.setPassword("123456");}for (Teacher teacher : teacherList) {teacher.setPassword("123456");}System.out.println("学生和教师密码已重置为初始密码!");}private void addUser() {Scanner scanner = new Scanner(System.in);System.out.print("添加对象(1.教师 2.学生):");int type = scanner.nextInt();scanner.nextLine(); // 消耗换行符System.out.print("请输入用户名:");String username = scanner.nextLine();if (type == 1) {Teacher teacher = new Teacher(username);teacherList.add(teacher);System.out.println("教师添加成功!");} else if (type == 2) {Student student = new Student(username);// 将学生加入所有必修课for (Course course : courseList) {if (course instanceof CompulsoryCourse) {student.getCoursesEnrolled().add(course);course.incrementStudentNumber();}}studentList.add(student);System.out.println("学生添加成功!");} else {System.out.println("无效的类型!");}}private void deleteUser() {Scanner scanner = new Scanner(System.in);System.out.print("删除对象(1.教师 2.学生):");int type = scanner.nextInt();scanner.nextLine(); // 消耗换行符System.out.print("请输入用户名:");String username = scanner.nextLine();if (type == 1) {Teacher teacher = findTeacherByUsername(username);if (teacher != null) {teacherList.remove(teacher);// 从课程中移除教师for (Course course : courseList) {if (course.getTeacher().equals(teacher)) {course.setTeacher(null);}}System.out.println("教师删除成功!");} else {System.out.println("教师不存在!");}} else if (type == 2) {Student student = findStudentByUsername(username);if (student != null) {studentList.remove(student);// 从课程中移除学生for (Course course : student.getCoursesEnrolled()) {course.decrementStudentNumber();}System.out.println("学生删除成功!");} else {System.out.println("学生不存在!");}} else {System.out.println("无效的类型!");}}private Teacher findTeacherByUsername(String username) {for (Teacher teacher : teacherList) {if (teacher.getUsername().equals(username)) {return teacher;}}return null;}private Student findStudentByUsername(String username) {for (Student student : studentList) {if (student.getUsername().equals(username)) {return student;}}return null;}private Course findCourseByID(String courseID) {for (Course course : courseList) {if (course.getCourseID().equals(courseID)) {return course;}}return null;}
}
CompulsoryCourse.java
package experiment_4;public class CompulsoryCourse extends Course {public CompulsoryCourse(String courseID, String courseName, Teacher teacher) {super(courseID, courseName, teacher);}@Overridepublic String toString() {return super.toString() + "(必修课)";}
}
Course.java
package experiment_4;import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;public class Course implements Serializable {protected String courseID;protected String courseName;protected Teacher teacher;protected int numberOfStudents;protected List<Student> enrolledStudents;public Course(String courseID, String courseName, Teacher teacher) {this.courseID = courseID;this.courseName = courseName;this.teacher = teacher;this.numberOfStudents = 0;this.enrolledStudents = new ArrayList<>();}public String getCourseID() {return courseID;}public Teacher getTeacher() {return teacher;}public void setTeacher(Teacher teacher) {this.teacher = teacher;}public int getNumberOfStudents() {return numberOfStudents;}public void incrementStudentNumber() {this.numberOfStudents++;}public void decrementStudentNumber() {this.numberOfStudents--;}public List<Student> getEnrolledStudents() {return enrolledStudents;}@Overridepublic String toString() {return "课程ID:" + courseID + ", 课程名称:" + courseName + ", 授课教师:" + teacher.getUsername() +", 选课人数:" + numberOfStudents;}
}
ElectiveCourse.java
package experiment_4;public class ElectiveCourse extends Course {private int maxStudents;public ElectiveCourse(String courseID, String courseName, Teacher teacher, int maxStudents) {super(courseID, courseName, teacher);this.maxStudents = maxStudents;}public int getMaxStudents() {return maxStudents;}@Overridepublic String toString() {return super.toString() + ", 最大选课人数:" + maxStudents + "(选修课)";}
}
Student.java
package experiment_4;import java.util.*;public class Student extends User {private List<Course> coursesEnrolled;public Student(String username) {super(username);this.coursesEnrolled = new ArrayList<>();}@Overridepublic void displayMenu() {System.out.println("===== 学生菜单 =====");System.out.println("1. 修改登录密码");System.out.println("2. 查看自己所上课程");System.out.println("3. 选修课选课");System.out.println("0. 退出");System.out.print("请选择操作:");}@Overridepublic void operate() {Scanner scanner = new Scanner(System.in);while (true) {displayMenu();int choice = scanner.nextInt();scanner.nextLine(); // 消耗换行符switch (choice) {case 1:changePassword(scanner); // 传递 Scanner 对象break;case 2:viewCoursesEnrolled();break;case 3:selectElectiveCourse();break;case 0:System.out.println("退出学生系统。");return;default:System.out.println("无效的选择,请重新输入。");}}}public void changePassword(Scanner scanner) { // 接受 Scanner 作为参数System.out.print("请输入新密码:");String newPassword = scanner.nextLine();super.changePassword(newPassword); // 调用父类的方法}public void viewCoursesEnrolled() {System.out.println("===== 已选课程列表 =====");for (Course course : coursesEnrolled) {System.out.println(course);}}public void selectElectiveCourse() {Scanner scanner = new Scanner(System.in);System.out.print("请输入选修课ID:");String courseID = scanner.nextLine();Course course = findCourseByID(courseID);if (course == null) {System.out.println("课程不存在!");return;}if (!(course instanceof ElectiveCourse)) {System.out.println("这不是一门选修课!");return;}ElectiveCourse electiveCourse = (ElectiveCourse) course;if (electiveCourse.getNumberOfStudents() >= electiveCourse.getMaxStudents()) {System.out.println("选课人数已满!");return;}if (coursesEnrolled.contains(course)) {System.out.println("您已选过此课程!");return;}coursesEnrolled.add(course);course.incrementStudentNumber();System.out.println("选课成功!");}private Course findCourseByID(String courseID) {for (Course course : Main.courseList) {if (course.getCourseID().equals(courseID)) {return course;}}return null;}public List<Course> getCoursesEnrolled() {return coursesEnrolled;}
}
Teacher.java
package experiment_4;import java.util.*;public class Student extends User {private List<Course> coursesEnrolled;public Student(String username) {super(username);this.coursesEnrolled = new ArrayList<>();}@Overridepublic void displayMenu() {System.out.println("===== 学生菜单 =====");System.out.println("1. 修改登录密码");System.out.println("2. 查看自己所上课程");System.out.println("3. 选修课选课");System.out.println("0. 退出");System.out.print("请选择操作:");}@Overridepublic void operate() {Scanner scanner = new Scanner(System.in);while (true) {displayMenu();int choice = scanner.nextInt();scanner.nextLine(); // 消耗换行符switch (choice) {case 1:changePassword(scanner); // 传递 Scanner 对象break;case 2:viewCoursesEnrolled();break;case 3:selectElectiveCourse();break;case 0:System.out.println("退出学生系统。");return;default:System.out.println("无效的选择,请重新输入。");}}}public void changePassword(Scanner scanner) { // 接受 Scanner 作为参数System.out.print("请输入新密码:");String newPassword = scanner.nextLine();super.changePassword(newPassword); // 调用父类的方法}public void viewCoursesEnrolled() {System.out.println("===== 已选课程列表 =====");for (Course course : coursesEnrolled) {System.out.println(course);}}public void selectElectiveCourse() {Scanner scanner = new Scanner(System.in);System.out.print("请输入选修课ID:");String courseID = scanner.nextLine();Course course = findCourseByID(courseID);if (course == null) {System.out.println("课程不存在!");return;}if (!(course instanceof ElectiveCourse)) {System.out.println("这不是一门选修课!");return;}ElectiveCourse electiveCourse = (ElectiveCourse) course;if (electiveCourse.getNumberOfStudents() >= electiveCourse.getMaxStudents()) {System.out.println("选课人数已满!");return;}if (coursesEnrolled.contains(course)) {System.out.println("您已选过此课程!");return;}coursesEnrolled.add(course);course.incrementStudentNumber();System.out.println("选课成功!");}private Course findCourseByID(String courseID) {for (Course course : Main.courseList) {if (course.getCourseID().equals(courseID)) {return course;}}return null;}public List<Course> getCoursesEnrolled() {return coursesEnrolled;}
}
User.java
package experiment_4;import java.io.Serializable;//允许类的对象可以被序列化public abstract class User implements Serializable {protected String username;protected String password;//在定义该成员的类内部、同一包中的其他类、以及任何子类中(无论子类是否在同一个包中)都可以访问。public User(String username) {this.username = username;this.password = "123456"; // 初始密码}public String getUsername() {return username;}public void setPassword(String newPassword) {//设置密码this.password = newPassword;}public boolean verifyPassword(String password) {//验证密码return this.password.equals(password);}public void changePassword(String newPassword) {//修改密码this.password = newPassword;System.out.println("密码修改成功!");}public abstract void displayMenu();public abstract void operate();
}
无需用到模块化module-info.java
/*** */
/*** */
module experiment_4 {
}
相关文章:

简单的Java小项目
学生选课系统 在控制台输入输出信息: 在eclipse上面的超级简单文件结构: Main.java package experiment_4;import java.util.*; import java.io.*;public class Main {public static List<Course> courseList new ArrayList<>();publi…...

使用layui的table提示Could not parse as expression(踩坑记录)
踩坑记录 报错图如下 原因: 原来代码是下图这样 上下俩中括号都是连在一起的,可能导致解析问题 改成如下图这样 重新启动项目,运行正常!...
区块链共识机制详解
一.共识机制简介 在区块链的交流和学习中,「共识算法」是一个很频繁被提起的词汇,正是因为共识算法的存在,区块链的可信性才能被保证。 1.1 为什么需要共识机制? 所谓共识,就是多个人达成一致的意思。我们生活中充满…...

【Excel】单元格分列
目录 分列(新手友好) 1. 选中需要分列的单元格后,选择 【数据】选项卡下的【分列】功能。 2. 按照分列向导提示选择适合的分列方式。 3. 分好就是这个样子 智能分列(进阶) 高级分列 Tips: 新手推荐基…...

【含开题报告+文档+PPT+源码】基于微信小程序的旅游论坛系统的设计与实现
开题报告 近年来,随着互联网技术的迅猛发展,人们的生活方式、消费习惯以及信息交流方式都发生了深刻的变化。旅游业作为国民经济的重要组成部分,其信息化、网络化的发展趋势也日益明显。旅游论坛作为旅游信息交流和分享的重要平台࿰…...

微软 Phi-4:小型模型的推理能力大突破
在人工智能领域,语言模型的发展日新月异。微软作为行业的重要参与者,一直致力于推动语言模型技术的进步。近日,微软推出了最新的小型语言模型 Phi-4,这款模型以其卓越的复杂推理能力和在数学领域的出色表现,引起了广泛…...

操作系统课后习题2.2节
操作系统课后习题2.2节 第1题 CPU的效率指的是CPU的执行速度,这个是由CPU的设计和它的硬件来决定的,具体的调度算法是不能提高CPU的效率的; 第3题 互斥性: 指的是进程之间的同步互斥关系,进程是一个动态的过程&#…...
[小白系列]安装sentence-transformers
python环境为3.13.1执行 pip install sentence-transformers 总是报以下问题 ERROR: Cannot install sentence-transformers0.1.0, sentence-transformers0.2.0, sentence-transformers0.2.1, sentence-transformers0.2.2, sentence-transformers0.2.3, sentence-transformers…...
Python字符串format方法全面解析
在Python中,format方法是一种用于格式化字符串的强大工具。它允许你构建一个字符串,其中包含一些“占位符”,这些占位符将被format方法的参数替换。以下是对format方法用法的详细解释: 基本用法 format方法的基本语法如下&#…...

【Reading Notes】Favorite Articles from 2024
文章目录 1、January2、February3、March4、April5、May6、June7、July8、August9、September10、October11、November12、December 1、January 2、February 3、March Sora外部测试翻车了!3个视频都有Bug( 2024年03月01日) 不仔细看还真看不…...

Python爬虫之Scrapy框架基础入门
Scrapy 是一个用于Python的开源网络爬虫框架,它为编写网络爬虫来抓取网站数据并提取结构化信息提供了一种高效的方法。Scrapy可以用于各种目的的数据抓取,如数据挖掘、监控和自动化测试等。 【1】安装 pip install scrapy安装成功如下所示:…...

spring cloud contract mq测试
对于spring cloud contract的环境配置和部署,请看我之前的文章。 一 生产者测试 测试生产者是否发送出消息,并测试消息内容是否正确。 编写测试合同 测试基类(ContractTestBase)上面要添加下面注解 SpringBootTest AutoConfig…...

Axure原型设计技巧与经验分享
AxureRP作为一款强大的原型设计工具,凭借其丰富的交互设计能力和高保真度的模拟效果,赢得了众多UI/UX设计师、产品经理及开发人员的青睐。本文将分享一些Axure原型设计的实用技巧与设计经验,帮助读者提升工作效率,打造更加流畅、用…...

计算机网络之王道考研读书笔记-1
第 1 章 计算机网络体系结构 1.1 计算机网络概述 1.1.1 计算机网络概念 internet(互连网):泛指由多个计算机网络互连而成的计算机网络。这些网络之间可使用任意通信协议。 Internet(互联网或因特网):指当前全球最大的、开放的、由众多网络和路由器互连…...

服务器限制某个端口只允许特定IP访问(处理第三方依赖漏洞)
最近项目部署之后,有些客户开始进行系统系统漏洞扫描,其中出现问题多的一个就是我们项目所依赖的Elasticsearch(es检索服务),很容易就被扫出来各种高危漏洞,而且这些漏洞我们在处理起来是很棘手的ÿ…...

JavaScript--原型与原型链
在JavaScript中,原型(prototype)是一个非常重要且独特的概念,它在对象创建和继承方面发挥着关键作用。理解原型及其相关的机制有助于更好地理解JavaScript的对象模型,以及如何设计和使用对象和继承。 JavaScript–原型…...

hive—常用的日期函数
目录 1、current_date 当前日期 2、now() 或 current_timestamp() 当前时间 3、datediff(endDate, startDate) 计算日期相差天数 4、months_between(endDate, startDate) 日期相差月数 5、date_add(startDate, numDays) 日期加N天 6、date_sub(startDate, numDays) 日期减…...

HTML零基础入门教学
目录 一. HTML语言 二. HTML结构 三. HTML文件基本结构 四. 准备开发环境 五. 快速生成代码框架 六. HTML常见标签 6.1 注释标签 6.2 标题标签:h1-h6 6.3 段落标签:p 6.4 换行标签:br 6.5 格式化标签 6.6 图片标签&a…...
vue3 父组件调用子组件 el-drawer 抽屉
之前 Vue3 只停留在理论,现在项目重构,刚好可以系统的实战一下,下面是封装了一个抽屉表单组件,直接在父组件中通过调用子组件的方法打开抽屉: 父组件: <template><div id"app"><…...
Java中常用算法之选择排序算法
一.选择排序(Selection Sort)是一种简单直观的排序算法。它的工作原理是每次从未排序部分选择最小(或最大)的元素,并将其放到已排序部分的末尾。以下是用Java实现选择排序的代码及其详细讲解。 二.选择排序代码 publ…...
云原生核心技术 (7/12): K8s 核心概念白话解读(上):Pod 和 Deployment 究竟是什么?
大家好,欢迎来到《云原生核心技术》系列的第七篇! 在上一篇,我们成功地使用 Minikube 或 kind 在自己的电脑上搭建起了一个迷你但功能完备的 Kubernetes 集群。现在,我们就像一个拥有了一块崭新数字土地的农场主,是时…...

【Oracle APEX开发小技巧12】
有如下需求: 有一个问题反馈页面,要实现在apex页面展示能直观看到反馈时间超过7天未处理的数据,方便管理员及时处理反馈。 我的方法:直接将逻辑写在SQL中,这样可以直接在页面展示 完整代码: SELECTSF.FE…...
纯 Java 项目(非 SpringBoot)集成 Mybatis-Plus 和 Mybatis-Plus-Join
纯 Java 项目(非 SpringBoot)集成 Mybatis-Plus 和 Mybatis-Plus-Join 1、依赖1.1、依赖版本1.2、pom.xml 2、代码2.1、SqlSession 构造器2.2、MybatisPlus代码生成器2.3、获取 config.yml 配置2.3.1、config.yml2.3.2、项目配置类 2.4、ftl 模板2.4.1、…...

基于Java+VUE+MariaDB实现(Web)仿小米商城
仿小米商城 环境安装 nodejs maven JDK11 运行 mvn clean install -DskipTestscd adminmvn spring-boot:runcd ../webmvn spring-boot:runcd ../xiaomi-store-admin-vuenpm installnpm run servecd ../xiaomi-store-vuenpm installnpm run serve 注意:运行前…...

渗透实战PortSwigger靶场:lab13存储型DOM XSS详解
进来是需要留言的,先用做简单的 html 标签测试 发现面的</h1>不见了 数据包中找到了一个loadCommentsWithVulnerableEscapeHtml.js 他是把用户输入的<>进行 html 编码,输入的<>当成字符串处理回显到页面中,看来只是把用户输…...
文件上传漏洞防御全攻略
要全面防范文件上传漏洞,需构建多层防御体系,结合技术验证、存储隔离与权限控制: 🔒 一、基础防护层 前端校验(仅辅助) 通过JavaScript限制文件后缀名(白名单)和大小,提…...

【记录坑点问题】IDEA运行:maven-resources-production:XX: OOM: Java heap space
问题:IDEA出现maven-resources-production:operation-service: java.lang.OutOfMemoryError: Java heap space 解决方案:将编译的堆内存增加一点 位置:设置setting-》构建菜单build-》编译器Complier...

Pandas 可视化集成:数据科学家的高效绘图指南
为什么选择 Pandas 进行数据可视化? 在数据科学和分析领域,可视化是理解数据、发现模式和传达见解的关键步骤。Python 生态系统提供了多种可视化工具,如 Matplotlib、Seaborn、Plotly 等,但 Pandas 内置的可视化功能因其与数据结…...

WinUI3开发_使用mica效果
简介 Mica(云母)是Windows10/11上的一种现代化效果,是Windows10/11上所使用的Fluent Design(设计语言)里的一个效果,Windows10/11上所使用的Fluent Design皆旨在于打造一个人类、通用和真正感觉与 Windows 一样的设计。 WinUI3就是Windows10/11上的一个…...

设计模式-3 行为型模式
一、观察者模式 1、定义 定义对象之间的一对多的依赖关系,这样当一个对象改变状态时,它的所有依赖项都会自动得到通知和更新。 描述复杂的流程控制 描述多个类或者对象之间怎样互相协作共同完成单个对象都无法单独度完成的任务 它涉及算法与对象间职责…...