Your next chapter starts hereExplore admission guide

DUET CSE 2005-2006 - Previous Year

Reading mode — untimed, no attempt is recorded
Back
Question 1a Programming

1. (a) Write a program using C/C++ language to find the smallest number from an Array containing integer numbers [C/C++ ল্যাঙ্গুয়েজ ব্যবহার করে n সংখ্যক integer সম্বলিত Array থেকে সবচেয়ে ছোট সংখ্যা বের করার প্রোগ্রাম লিখ।] (14)

Solution
#include <stdio.h>
int main(void) {
    int n, a[1000];
    if (scanf("%d", &n) != 1 || n < 1 || n > 1000) return 1;
    for (int i = 0; i < n; ++i)
        if (scanf("%d", &a[i]) != 1) return 1;
    int minimum = a[0];
    for (int i = 1; i < n; ++i)
        if (a[i] < minimum) minimum = a[i];
    printf("%d\n", minimum);
    return 0;
}

Time O(n); empty array-এর minimum সংজ্ঞায়িত নয়।

Question 2 Programming

2. What will be the output of the following program. (নিম্নোক্ত প্রোগ্রামের output কি হবে? (11)

void main()
{
long int n;
int I, j;
n = 1;
for (i = 1; i <= 2; i++)
for (j = 1; j <= 5; j++)
n = n * i * j;
cout << n;
}
Solution

Source-এ I declared কিন্তু i ব্যবহৃত; C++ case-sensitive, তাই মূল code compile হয় না। int i, j;, proper header ও int main() ধরে:

\[n=\left(\prod_{j=1}^5 1j\right)\left(\prod_{j=1}^5 2j\right)=120\times(2^5\times120)=\boxed{460800}\]

Question 3 Data Structure

3. Prepare a Binary search tree for the following data: (7,9,25,1,77,100,112) [নিম্নোক্ত ডাটাগুলো ব্যবহার করে একটি বাইনারী সার্চ ট্রি তৈরি কর: (7,9,25,1,77,100,112)

Solution

7 root; 1 left child; 9 right child। এরপর 25 → 77 → 100 → 112 ক্রমাগত right child।

Inorder: 1, 7, 9, 25, 77, 100, 112।

bst 2005
Question 4 Database Management

4. Write down the SQL command to find the following Query language considering the relation given below. (a) Find all the Department in which number of students are more than 60. (b) Find all the Department in which number of Teachers are less than 12. (নিম্নের রিলেশন ব্যবহার করে নিম্নেক্ত Query এর জন্য SQL Command লিখ। (a) ঐ সমস্ত বিভাগ বের কর যাদের ছাত্র সংখ্যা 60 এর বেশী (b) ঐ সমস্ত বিভাগ বের কর যাদের শিক্ষক সংখ্যা 12 এর কম।) (10)

DUET

Department Students Teachers
CE 120 18
ME 120 14
EEE 120 10
CSE 60 12
TE 20 2
Solution
SELECT Department FROM DUET WHERE Students > 60;
SELECT Department FROM DUET WHERE Teachers < 12;
QueryResult
Students > 60CE, ME, EEE
Teachers < 12EEE, TE

CSE-এর students = 60 ও teachers = 12, তাই strict inequality-তে অন্তর্ভুক্ত নয়।

Question 5 Database Management

5. Explain with example super key and Candidate key. [সুপারকি এবং ক্যান্ডিডেটকি উদাহরণসহ ব্যাখ্যা কর।] (10)

Solution

Superkey uniquely row শনাক্ত করে। Candidate key হলো minimal superkey: কোনো attribute বাদ দিলে uniqueness থাকে না।

Student(ID, Email, Name)-এ ID ও Email দুটোই unique এবং non-null ধরলে {ID}, {Email} candidate key। {ID, Name} superkey, কিন্তু minimal নয় বলে candidate key নয়।

Question 6 Programming

6. Explain Class, object and Function overloading. (Class, object এবং Function overloading ব্যাখ্যা কর।) (12)

Solution

Class হলো data ও functions-এর user-defined type; object হলো class-এর instance। Function overloading-এ একই নামের একাধিক function-এর parameter list আলাদা হয়; শুধু return type বদলে overload করা যায় না।

class Box { public: int width = 0; };
Box first;
int add(int a, int b) { return a + b; }
double add(double a, double b) { return a + b; }
Question 7 Data Communication & Computer Network

7. Identity the several layers of OSI reference model and write the main task of data link layer. (OSI reference মডেলের বিভিন্ন লেয়ারগুলি চিহ্নিত কর এবং ডাটা লিংক লেয়ারের প্রধান কার্যবিবরণী লিখ।) (10)

Solution
OSI (উপর থেকে নিচে)মূল কাজ
ApplicationApplication-level network service
PresentationData representation, encoding, encryption
SessionSession/dialog coordination
TransportEnd-to-end process delivery, ports
NetworkLogical addressing ও routing
Data linkFraming, MAC addressing, media access, error detection
PhysicalMedium-এ bits/signals পাঠানো
Question 8 Microprocessor & Microcomputer

8. What do you mean by Address Bus and Data Bus? How many memory locations can address if CPU with 16 Bit address line [Address Bus এবং Data Bus বলতে কি বুঝায়? যদি CPU তে 16 Bit এড্রেস লাইন থাকে তাহলে কতগুলি মেমোরী লোকেশন হবে) (10)

Solution

Address bus কোন memory/I/O location access হবে তা নির্বাচন করে; data bus CPU, memory ও I/O-এর মধ্যে data বহন করে।

\[N=2^{16}=\boxed{65536\text{ locations}}\]

প্রতি location এক byte হলে capacity 64 KiB।

Question 9 Historical: Software Development

9. Name six groups of information system stakeholders, (Information system stakeholder এর ছয়টি গ্রুপের নাম লিখ।) (08)

Solution
  1. System owners/sponsors
  2. End users
  3. System analysts
  4. System designers/architects
  5. Developers/builders
  6. Project managers
Question 10 Data Structure

10. Prepare a graph from the following matrix. Where 1 represents there is a path. 0 represents no path. (নিম্নের ম্যাট্রিক্স দিয়ে একটি গ্রাফ তৈরি কর, যেখানে 1 প্রকাশ করে একটি পথ আছে 0 প্রকাশ করে পথ নেই।)

$$\begin{matrix} & 1 & 2 & 3 & 4 & 5 \\ 1 & \begin{bmatrix} 0 & 1 & 0 & 1 & 0 \\ 1 & 1 & 1 & 0 & 0 \\ 0 & 0 & 1 & 1 & 1 \\ 1 & 1 & 0 & 1 & 1 \\ 1 & 0 & 1 & 0 & 1 \end{bmatrix} \end{matrix}$$

Solution

Matrix asymmetric, তাই directed graph; row i থেকে column j-তে edge। Diagonal 1 self-loop নির্দেশ করে।

VertexOutgoing neighbours
12, 4
21, 2, 3
33, 4, 5
41, 2, 4, 5
51, 3, 5
directed graph 2005
Question 11a Data Structure

11. (a) What is stack and queue? What is the main difference between stack and queue? (Stack এবং queue কি? এদের মধ্যে মূল পার্থক্য লিখ?)

Solution
StackQueue
LIFO: last in, first outFIFO: first in, first out
Push/pop একই top-এEnqueue rear-এ, dequeue front-এ
উদাহরণ: call stack, undoউদাহরণ: print queue, BFS
Question 11b Microprocessor & Microcomputer

11. (b) Write down the function of AX, BX, CX and DX registers, (AX, BX, CX এবং DX রেজিস্টার এর কার্যাবলী লিখ।)

(12)

Solution
8086 registerবিশেষ ব্যবহার
AXAccumulator; arithmetic, multiplication/division ও I/O
BXBase register; effective-address calculation
CXCount; LOOP, REP ও variable shifts
DXExtended data; multiply/divide high part এবং I/O port address

এগুলো general-purpose register-ও; বিশেষ ব্যবহার instruction-এর ওপর নির্ভর করে।

Question 12a Digital Electronics

12. (a) Write down the truth table of R-S, J-K and D flip flops (R-S, J-K এবং D ফ্লিপ ফ্লপের truth table লিখ।)

Solution
SRQ(next), active-high SR
00Q
010
101
11Forbidden/invalid
JKQ(next)
00Q (hold)
010 (reset)
101 (set)
11NOT Q (toggle)

D flip-flop: active clock edge-এ Q(next) = D।

Question 12b Operating System

12. (b) What the main functions of an operating system? (Operating system এর প্রধান কাজগুলি কী কী?) (05)

Solution

Operating system হলো system software যা hardware resource পরিচালনা করে এবং application-এর জন্য service দেয়।

  1. Process/CPU scheduling ও process coordination।
  2. Memory allocation, protection ও virtual memory।
  3. File, storage ও I/O device management।
  4. User authentication, access control ও system-call interface।
Question 13 Basic Electricity

13. A battery of unknown e.m.f is connected to a circuit as shown below. The voltage drop across the $8\ \Omega$ register is $20\ \Omega$ register is 20 V. What will be the current reading in the ammeter? (একটি অজানা সার্কিট এর ব্যাটারী সংযুক্ত সার্কিট $8\ \Omega$ রোধকের across এর ভোল্টেজ 20V। অ্যামিটারের কারেন্টের মান নির্ণয় কর।)

(Circuit diagram showing an unknown voltage source $E$, resistors of $8\ \Omega$, $11\ \Omega$, $11\ \Omega$, $13\ \Omega$, and $15\ \Omega$, a voltmeter across the $8\ \Omega$ resistor, and an ammeter $A$ in series with the bottom branch).

Solution

\[I=20/8=2.5\,\mathrm A\]

Ideal voltmeter ও ammeter ধরে, current 11 Ω এবং (15 + 13) Ω branch-এ ভাগ হয়।

\[I_A=2.5\frac{11}{11+15+13}=\boxed{0.70513\,\mathrm A}\]

Question 14a Data Communication & Computer Network

14. (a) Explain Simplex, Half-Duplex and Full-Duplex data transmission. (সিমপ্লেক্স, হাফ-ডুপ্লেক্স ও ফুল ডুপ্লেক্স ডাটা ট্রান্সমিশন ব্যাখ্যা কর। (10)

ClK Q J K Q Comment
0 * * * * No change No
1 0 0 0 0 change Reset
1 0 0 1 0 set Toggle.
1 0 1 0 1
1 0 1 1 1

Fig: J-K, F.F Characteristic table

Solution
Modeদিকউদাহরণ
Simplexশুধু এক দিকেBroadcast television
Half-duplexদুই দিকে, তবে একই সময়ে নয়Walkie-talkie
Full-duplexদুই দিকে একই সময়েTelephone conversation
Question 14b Data Communication & Computer Network

14. (b) Write down the transmission characteristics of twisted pair and coaxial cable. (টুইস্টেড পেয়ার এবং কোএক্সিয়াল ক্যাবল এর ট্রান্সমিশন বৈশিষ্ট্য লিখ।) (08)

Solution
Twisted pairCoaxial cable
দুটি insulated conductor পাকানোCentral conductor, dielectric ও outer shield
Twisting common-mode interference কমায়Shield external interference কমায়
Ethernet/telephone-এ প্রচলিতCable TV/broadband/RF-এ প্রচলিত
সাধারণত কম খরচ, সহজ installationসাধারণত বেশি shielding ও mechanical bulk

Bandwidth ও distance cable grade, frequency ও signalling standard-এর ওপর নির্ভর করে।

Question 15a Digital Electronics

15. (a) Implement the following Boolean function using only NOR gate. (কেবলমাত্র NOR gate ব্যবহার করে নিম্নোক্ত Boolean function টি বাস্তবায়ন কর।) F = (A+B') (A'+B)C' (10)

Solution

NOR(X,Y) = NOT(X+Y)। শুধু NOR gate দিয়ে:

\[n_A=\operatorname{NOR}(A,A),\quad n_B=\operatorname{NOR}(B,B)\]

\[u=\operatorname{NOR}(A,n_B),\quad v=\operatorname{NOR}(n_A,B)\]

\[F=\operatorname{NOR}(u,v,C)=(A+\bar B)(\bar A+B)\bar C\]

শেষটি 3-input NOR। শুধু 2-input NOR থাকলে t = NOR(u,v), w = NOR(t,t), F = NOR(w,C)।

Question 15b Digital Electronics

15. (b) Classify multivibrator and state the characteristics of the output wave shape for each type. (Multivibrator এর শ্রেণি বিন্যাস কর এবং প্রত্যেক প্রকারের output wave shape. (10)

Solution

Multivibrator হলো switching circuit যা দুই state-এর মধ্যে পরিবর্তিত হয়।

TypeStable statesOutput / use
Bistable2Trigger-এ state বদলায়; memory/latch
Monostable1Trigger-এ একটি নির্দিষ্ট সময়ের pulse; timer
Astable0নিরবচ্ছিন্ন periodic rectangular waveform; clock