摘要: 实验任务1 运行结果截图如下 问题1 GradeCalc 类声明中,体现"组合"关系的成员声明及对应功能如下: std::vector<int> grades; grades用于存储所有成绩数据 std::array<int, 5> counts; counts用于统计各分数段人数 std::arr 阅读全文
posted @ 2025-12-02 20:51 勤垦原 阅读(3) 评论(0) 推荐(0)
摘要: 实验任务1 源代码如下: button.hpp #pragma once #include <iostream> #include <string> class Button { public: Button(const std::string &label_); const std::string 阅读全文
posted @ 2025-11-26 00:36 勤垦原 阅读(10) 评论(1) 推荐(0)
摘要: 实验任务1 源代码 T.cpp #include "T.h" #include <iostream> #include <string> // 类T实现 // static成员数据类外初始化 const std::string T::doc{"a simple class sample"}; con 阅读全文
posted @ 2025-10-28 21:44 勤垦原 阅读(8) 评论(2) 推荐(0)
摘要: 1. 实验任务1 验证性实验。 在C++编码环境中,输入、运行并观察以下代码,结合运行结果和注释,体验使用C++标准库进行编程的便捷性。从面 向对象编程范式的角度,体会封装与基于接口编程的意义。 #include <iostream> #include <string> #include <vect 阅读全文
posted @ 2025-10-17 22:35 勤垦原 阅读(21) 评论(1) 推荐(1)