Home / MCQ Bank / Computer
Computer Concept Of Object Oriented Programs In Python Difficulty: Medium

What is the main advantage of using abstraction in object-oriented programming?

Select the correct option to test your answer:

More Computer Questions

What will be the output of the following C++ code? #include <iostream> using namespace std; class vec { public: vec(float f1, float f2) { x = f1; y = f2; } vec() { } float x; float y; }; vec addvectors(vec v1, vec v2); int main() { vec v1(3, 6); vec v2(2, -2); vec v3 = addvectors(v1, v2); cout << v3.x << ", " << v3.y << endl; } vec addvectors(vec v1, vec v2) { vec result; result.x = v1.x + v2.x; result.y = v1.y + v2.y; return result; }; The active cell: The default case sensitivity of database and table names depends on . . . . . . . . What will be the output of the following C++ code? #include <iostream> using namespace std; class BaseClass { int x; public: void setx(int n) { x = n; } void showx() { cout << x ; } }; class DerivedClass : private BaseClass { int y; public: void setxy(int n, int m) { setx(n); y = m; } void showxy() { showx(); cout << y << '\n'; } }; int main() { DerivedClass ob; ob.setxy(10, 20); ob.showxy(); return 0; } What will be the output of the following C code? #include <stdio.h> struct student { char a[5]; }; void main() { struct student s[] = {"hi", "hey"}; printf("%c", s[0].a[1]); }