Last Flashcards
1
Q
codingan Polymorphism?
A
#include using namespace std;
class CPolygon { protected: int width, height; public: void setup (int first, int second) { width= first; height= second; } };
class CRectangle: public CPolygon { public: int area() { return (width * height); } };
class CTriangle: public CPolygon { public: int area() { return (width * height / 2); } };
int main ()
{
CRectangle rectangle;
CTriangle triangle;
CPolygon * ptr_polygon1 = &rectangle; CPolygon * ptr_polygon2 = ▵ ptr_polygon1->setup(2,2); ptr_polygon2->setup(2,2); cout << rectangle.area () << endl; cout << triangle.area () << endl; return 0; }
2
Q
Sebutkan 3 bahasa imperative?
A
C, C++, C#
3
Q
Sebutkan 3 bahasa functional?
A
Haskell, Mercury, Clean
4
Q
Sebutkan 3 bahasa logic?
A
Prolog, Visual Prolog, Janus