-
Notifications
You must be signed in to change notification settings - Fork 0
/
C++.php
164 lines (163 loc) · 8.03 KB
/
C++.php
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
</head>
<body>
<?php
include("header.php");
?>
<div class="table-responsive">
<table class="table table-dark table-bordered">
<tr>
<th colspan="2">Q. In CPP, cin and cout are the predefined stream __________</th>
</tr>
<tr>
<td id="q1o1" onclick="wrong(this.id)"> A. Operator</td>
<td id="q1o2" onclick="wrong(this.id)"> B.Functions</td>
</tr>
<tr>
<td id="q1o3" onclick="correct(this.id)"> C.Objects</td>
<td id="q1o4" onclick="wrong(this.id)"> D.Data types</td>
</tr>
<tr>
<th colspan="2">Q.Constant variables can be created in CPP by using ________ </th>
</tr>
<tr>
<td id="q2o1" onclick="wrong(this.id)"> A.enum</td>
<td id="q2o2" onclick="wrong(this.id)"> B.const</td>
</tr>
<tr>
<td id="q2o3" onclick="wrong(this.id)"> C.#define</td>
<td id="q2o4" onclick="correct(this.id)"> D.All of these</td>
</tr>
<!--###########################-->
<tr>
<th colspan="2">Q. Object oriented programming employs_________ programming approach.</th>
</tr>
<tr>
<td id="q3o1" onclick="correct(this.id)"> A.bottom-up</td>
<td id="q3o2" onclick="wrong(this.id)"> B.top-down</td>
</tr>
<tr>
<td id="q3o3" onclick="wrong(this.id)"> C.procedural</td>
<td id="q3o4" onclick="wrong(this.id)"> D.All of these</td>
</tr>
<!--###########################-->
<tr>
<th colspan="2">Q. _________________are used for generic programming.</th>
</tr>
<tr>
<td id="q4o1" onclick="wrong(this.id)"> A.Inheritance</td>
<td id="q4o2" onclick="wrong(this.id)"> B.Virtual Functions</td>
</tr>
<tr>
<td id="q4o3" onclick="correct(this.id)"> C.Templates</td>
<td id="q4o4" onclick="wrong(this.id)"> D.None of these</td>
</tr>
<tr>
<th colspan="2">Q.While redefining a virtual function in the derived class, if its prototype is changed then _________ .</th>
</tr>
<tr>
<td id="q5o1" onclick="wrong(this.id)"> A.It will be overloaded by the compiler</td>
<td id="q5o2" onclick="wrong(this.id)"> B.Its virtual nature will be lost</td>
</tr>
<tr>
<td id="q5o3" onclick="wrong(this.id)"> C.Compiler will generate “Prototype mismatch error"</td>
<td id="q5o4" onclick="correct(this.id)"> D.both a and b</td>
</tr>
<!--###########################-->
<tr>
<th colspan="2">Q.Object based language differs from object oriented language as it does not support features _____ .</th>
</tr>
<tr>
<td id="q6o1" onclick="wrong(this.id)"> A.Encapsulation & Inheritance</td>
<td id="q6o2" onclick="wrong(this.id)"> B.Dynamic Binding & Abstraction</td>
</tr>
<tr>
<td id="q6o3" onclick="correct(this.id)"> C. Inheritance & Dynamic Binding</td>
<td id="q6o4" onclick="wrong(this.id)"> D. Polymorphism & Encapsulation</td>
</tr>
<!--############################################################################################################-->
<tr>
<th colspan="2">Q.Classes in CPP are________ .</th>
</tr>
<tr>
<td id="q7o1" onclick="wrong(this.id)"> A.built-in data types</td>
<td id="q7o2" onclick="correct(this.id)"> B.User defined data types</td>
</tr>
<tr>
<td id="q7o3" onclick="wrong(this.id)"> C .derived data types</td>
<td id="q7o4" onclick="wrong(this.id)"> D. All of these</td>
</tr>
<!--###########################-->
<tr>
<th colspan="2">Q.If a class contains static variable, then every object of the class has its copy of static variable.</th>
</tr>
<tr>
<td id="q8o1" onclick="correct(this.id)"> A.False</td>
<td id="q8o2" onclick="wrong(this.id)"> B.True</td>
</tr>
<tr>
<td id="q8o3" onclick="wrong(this.id)"> C.I don't know</td>
<td id="q8o4" onclick="wrong(this.id)"> D.Don't worry i will tell you</td>
</tr>
<!--############################################################################################################-->
<tr>
<th colspan="2">Q. __________________ is the OOP feature and mechanism that binds together code and the data it manipulates, and keep both safe from outside world.</th>
</tr>
<tr>
<td id="q9o1" onclick="wrong(this.id)"> A.Data Binding</td>
<td id="q9o2" onclick="wrong(this.id)"> B.Data Storing</td>
</tr>
<tr>
<td id="q9o3" onclick="correct(this.id)"> C.Data Encapsulation</td>
<td id="q9o4" onclick="wrong(this.id)"> D.Data Abstraction</td>
</tr>
<!--###########################-->
<tr>
<th colspan="2">Q. ____________ refers to the act of representing only essential features without including the background details.</th>
</tr>
<tr>
<td id="q10o1" onclick="wrong(this.id)"> A.Data Hiding</td>
<td id="q10o2" onclick="wrong(this.id)"> B.Data Encapsulation</td>
</tr>
<tr>
<td id="q10o3" onclick="correct(this.id)"> C.Data Abstraction</td>
<td id="q10o4" onclick="wrong(this.id)"> D.All of these</td>
</tr>
</table>
</div>
<?php
include("score_btn.php");
?>
<?php
include("footer.php");
?>
<script language="javascript" type="text/javascript">
var x=0,y=0;
function correct(id){
//document.getElementById("print").innerHTML="CORRECT ANSWER";
document.getElementById(id).style.backgroundColor="#00cd00";
document.getElementById(id).style.color="white";
x++;
}
function wrong(id){
//document.getElementById("print").innerHTML="WRONG ANSWER";
document.getElementById(id).style.backgroundColor="#ff0000";
document.getElementById(id).style.color="white";
y++;
}
function score(){
//document.getElementById("print").innerHTML=x+"/"+(x+y);
alert("YOU SCORE :-"+x+"/"+(x+y));
}
</script>
</body>
</html>