[404218]: / Code / C++ / C++ Tutorial Source Files / 43_C++_Inheritkkawchak.cpp

Download this file

41 lines (35 with data), 868 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
using namespace std;
class AI {
public:
void makeArchitecture(){
cout << "AI has a less complex architecture" << endl;
}
void makeParameter(){
cout << "AI architecture has parameters" << endl;
}
void makeLearning(){
cout << "AI parameters allow for learning" << endl;
}
};
class GenAI : public AI {
public:
void makeArchitecture(){
cout << "GenAI has a more complex architecture" << endl;
}
void makeLearning(){
cout << "GenAI parameters allow for enhanced learning" << endl;
}
};
int main()
{
AI ai;
ai.makeParameter();
ai.makeLearning();
ai.makeArchitecture();
GenAI genai;
genai.makeParameter();
genai.makeLearning();
genai.makeArchitecture();
return 0;
}