Assessment Type: Summative: End of CO: in LMS
Assessment Type: Summative: End of CO: in LMS
<Assessments>: <Formative>
<Pratibha Pednekar>
Summative: Q 1 Summative: Q 2
c) c)both of these
d) d)none of these
Ans: b Ans: b
Summative: Q 3 Summative: Q 4
Which among the following best describes abstract classes? Is it necessary that all the abstract methods must
be defined from an abstract class?
A. If a class has more than one virtual function, it’s abstract A. Yes, depending on code
class
B. If a class have only one pure virtual function, it’s abstract B. Yes, always
class
C. If a class has at least one pure virtual function, it’s C. No, never
abstract class
D. If a class has all the pure virtual functions only, then it’s D. No, if function is not used, no
abstract class definition is required
Ans: C Ans: B
Assessment Type: Practice Worksheets: End of CO: in LMS/ downloadable PDF
If students have access to laptop/ desktop – they can answer it on LMS, else download it and answer it and file
it for later use. They can also copy the question in their notebook in case the space provided is insufficient.
#include <iostream>
using namespace std;
class Shape
{
public:
virtual void draw()=0;
};
class Rectangle : Shape
{
10. public:
11. void draw()
12. {
13. cout < <"drawing rectangle..." < <endl;
14. }
15. };
16. class Circle : Shape
17. {
18. public:
19. void draw()
20. {
21. cout <<"drawing circle..." < <endl;
22. }
23. };
24. int main( ) {
25. Rectangle rec;
26. Circle cir;
27. rec.draw();
28. cir.draw();
29. return 0;
30. }
Output:
drawing rectangle...
drawing circle...