
GEC Bilaspur Quiz 5 -- C++ -- Prof. Manish Tiwari
Authored by Manish Tiwari
Computers
University
Used 17+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
5 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
5 mins • 1 pt
Given condition 1: Class A is base class, and there are 5 other classes derived directly from this class (A1, A2, A3, A4 and A5). Each derived class has additional member int z defined in public section of each derived class.
Class A has 2 members declared in private section: <int x1> and <void getdata()>.
Class A has 4 members declared in protected section: <int p1, p2, p3, p4>.
Class A has 2 members declared in public section: <float r1, r2>.
All question further are based on this condition only. Assume every variable and every function takes exactly 1 block of memory.
.............................................................................................................................
Q1---In int main() function, if first line of code, how many memory blocks will be allocated after this line is executed.
................................................
A Student;
2
8
13
1
2.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
For Condition 1---
Q2---If this is 1 line of code in int main(), how many memory blocks will be allocated in total and how many will have some valid data in these blocks and how many will be empty in these blocks. Answer in 3 parts as "Total Allocated / Valid Data / Empty"
............................
A1 Grades;
1/0/1
8/1/7
1/1/0
9/0/9
3.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
For Condition 1--
Q3--If these are 2 lines of code in int main(), how many memory blocks will have valid data in them.
.....................................................................................
A rt1;
A1 rt2;
A2 rt3;
3
10
0
9
4.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
For Condition 1--
Q4--If an 8 bit register is considered as "one" block of memory, how many total bits will be allocated in total, if this one line of code is written in int main().
.......................................................................
A1 rt2;
1x8
9x8
7x8
8
5.
MULTIPLE CHOICE QUESTION
3 mins • 1 pt
For Condition 1---Modified--Instead of every variable and function using only 1 block of memory, now variable uses 1 block and function uses 4 blocks of memory.
..................................
Q5--If one block is 8 bit register, how many total memory bits will be allocated after execution of these lines of code in int main().
......................................
Line 1----- int k1;
Line 2---- A1 A9;
Line 3---- A A12;
Line 4---- A4 B1;
Line 5--- B1.z = 45;
5x8= 40 bits
21x8 = 168 bits
28x8 = 224 bits
36x8 = 288 bits
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?