Fall 2023 - CS304 - 2
Fall 2023 - CS304 - 2
Fall 2023 - CS304 - 2
#include <iostream>
#include <string>
class Base {
public:
virtual void display() const = 0; // Pure virtual function
};
private:
std::string studentName;
};
private:
std::string course;
};
}
std::cout << std::endl;
std::cout << "---------------" << std::endl;
}
void sumLastThreeDigits(const int* idArray, int size) {
if (size < 3) {
std::cout << "Cannot calculate the sum of the last three digits." << std::endl;
return;
}
int main() {
int studentIDArray[] = {2, 1, 0, 4, 1, 4, 6, 0, 4};
int arraySize = sizeof(studentIDArray) / sizeof(studentIDArray[0]);
child1 d1;
child2 d2;
Base* p;
return 0;
}