面向对象程序设计-2020级 (南京信息工程大学)

  • 实验四:继承

    1.实验任务2 程序源码如下: 1 #include <iostream> 2 #include<typeinfo> 3 4 class Graph{ 5 public: 6 virtual void draw(){ 7 std::cout<<"Graph::draw():just as an in
    Beeatbonnie   2021-11-28 10:56   0   4
  • 实验4 继承

    四、实验结论 1.实验任务1 验证性内容。 2.实验任务2 程序源码,及,运行结果截图 #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::
    幸福^_^灿灿   2021-11-27 23:05   0   7
  • 实验四

    ELectricCar.hpp: #ifndef ELECTRICCAR_H #define ELECTRICCAR_H #include<iostream> #include<string> using namespace std; class Battery { public: Battery(
    向胃猛冲   2021-11-27 21:09   1   3
  • 实验四

    实验四 1.map的用法(实现键值对应): 练习一:输入数字输出字母 #include<iostream> #include<map> #include<string> int main(){ using namespace std; map<int,string> trans{{0,"a"}, {
    蒋如萍   2021-11-27 21:05   2   10
  • 实验四

    task2 程序源码 #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just as
    芍灸   2021-11-27 20:59   0   4
  • 实验四 继承

    没加virtual之前: task1.cpp #include<iostream> #include<typeinfo> //definition of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : j
    歧念   2021-11-27 20:59   0   1
  • 实验四 继承

    任务二: #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just as an int
    姬冰洁   2021-11-27 20:03   0   2
  • 实验四

    任务三 Battery.hpp #pragma once #include<iostream> using namespace std; class Battery { public: Battery(float n=70) :capacity{ n } {} float get_capacity(
    under_world   2021-11-27 19:54   0   4
  • 实验4 继承

    task2程序源码 #include <iostream> #include <typeinfo> // definitation of Graph class Graph { public: void draw() { std::cout << "Graph::draw() : just as a
    Asll321   2021-11-27 19:51   0   3
  • 实验四

    #include<iostream> #include<typeinfo> class Graph { public: virtual void draw(){std::cout<<"Graph::draw():just as an interface\n";} }; class Rectangle
    202083290040王博宇   2021-11-27 16:22   0   4