কম্পিউটার সায়েন্স এন্ড ইঞ্জিনিয়ারিং
Subjects / বিষয়
Non-Technical · Shared by all departments
পদার্থ বিজ্ঞান
8 chapters
Non-Technical · Shared by all departments
রসায়ন
15 chapters
Non-Technical · Shared by all departments
গণিত
4 chapters
Non-Technical · Shared by all departments
ইংরেজি
11 chapters
Technical
Computer Science and Engineering
12 chapters
Questions
0 read · 0 practiced · 0 answered in examsQuestion 2
What is inheritance? Write a program to show the inheritance used in a class. [ইনহেরিটেন্স কি? ক্লাসে ইনহেরিটেন্স দেখানোর জন্য একটি প্রোগ্রাম লিখ।]
CQ / Written solution
Inheritance-এ derived class base class-এর accessible data ও behaviour পুনর্ব্যবহার করে এবং নতুন behaviour যোগ করতে পারে। উদাহরণ: Vehicle থেকে Car ও Bus।
#include <iostream>
class Vehicle {
public:
void start() const { std::cout << "Started\n"; }
};
class Car : public Vehicle {
public:
void drive() const { std::cout << "Driving\n"; }
};
int main() { Car c; c.start(); c.drive(); }
Question 3
(a) The blood groups of people are distributed as follows: 50 have type A blood, 65 have type B blood, 70 have type O blood and 15 have type AB blood. If a person from this group is selected at random, what is the probability that this person has type O blood? [২০০ জন লোকের রক্তের গ্রুপ নিম্নরূপ: ৫০ জন A গ্রুপের, ৬৫ জন B গ্রুপের, ৭০ জন O গ্রুপের এবং ১৫ জন AB গ্রুপের। এদের মধ্যে দৈবভাব একজনকেও নির্বাচন করলে তার রক্তের গ্রুপ O হওয়ার সম্ভাবনা কত?]
CQ / Written solution
\[P(O)=\frac{70}{200}=\frac7{20}=\boxed{0.35}\]
(b) Show that, $(p \oplus q)$ and $\sim(p \leftrightarrow q)$ are logically equivalent. [দেখাও যে- $(p \oplus q)$ ও $\sim(p \leftrightarrow q)$ যৌক্তিকভাবে সমতুল্য]
CQ / Written solution
| p | q | p XOR q | NOT (p ↔ q) |
|---|---|---|---|
| 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 |
| 1 | 1 | 0 | 0 |
শেষ দুই column একই, তাই proposition দুটি logically equivalent।
4. (a) Classify data structures with examples.
[উদাহরণ ডাটা স্ট্রাকচার সমূহের শ্রেণীবিভাগ কর।]
CQ / Written solution
| ধরন | উদাহরণ |
|---|---|
| Primitive | Integer, character, boolean |
| Non-primitive linear | Array, linked list, stack, queue |
| Non-primitive non-linear | Tree, graph |
Allocation-এর দিক থেকে fixed-size array static-size; linked list dynamic-size।
4. (b) An automobile company keeps the records of sold automobile in AUTO array in every year from 1940 to 2000. If $\text{Base}(\text{AUTO}) = 200$ and $\text{W} = 4\text{ words/ memory cell}$, calculate the address of array element for the year of 1985.
[একটি অটোমোবাইল কোম্পানি 1940 থেকে 2000 সাল পর্যন্ত প্রতি বছরে বিক্রিত অটোমোবাইল সংখ্যার রেকর্ড AUTO অ্যারেতে save করে। যদি $\text{Base}(\text{AUTO}) = 200$ এবং $\text{W} = 4\text{ words/ memory cell}$ হয়, তবে 1985 সনের অ্যারের উপাদানের অ্যাড্রেস নিরূপণ কর।]
CQ / Written solution
\[\operatorname{LOC}(AUTO[y])=200+4(y-1940)\]
\[\operatorname{LOC}(AUTO[1985])=200+4(45)=\boxed{380}\]
প্রশ্নে address unit word ধরা হয়েছে।
5. Let the following relation schemas be given: $\text{R} = (\text{A}, \text{B}, \text{C})$ and $\text{S} = (\text{D}, \text{E}, \text{F})$. Let relations $r(\text{R})$ and $s(\text{S})$ be given. Give an expression in SQL that is equivalent to each of the following queries:
[নিম্নলিখিত রিলেশনাল স্কীমা দেওয়া আছে: $\text{R} = (\text{A}, \text{B}, \text{C})$ এবং $\text{S} = (\text{D}, \text{E}, \text{F})$। $r(\text{R})$ এবং $s(\text{S})$ রিলেশন ধরে নিম্নের কুয়েরীগুলি SQL এর মাধ্যমে প্রকাশ কর:]
(i) $\prod A(r)$
(ii) $\sigma B = 17(r)$
(iii) $r \times s$
(iv) $\prod A, F(\sigma C=D(r \times s))$
CQ / Written solution
Relational algebra set semantics বজায় রাখতে projection-এ DISTINCT ব্যবহার করা হয়েছে।
-- (i) Projection of A
SELECT DISTINCT A FROM r;
-- (ii) Selection B = 17
SELECT * FROM r WHERE B = 17;
-- (iii) Cartesian product
SELECT * FROM r CROSS JOIN s;
-- (iv) Projection A, F after C = D selection
SELECT DISTINCT r.A, s.F
FROM r JOIN s ON r.C = s.D;
6. Define system and information system. State the key elements of a system.
[সিস্টেম ও ইনফরমেশন সিস্টেমের সংজ্ঞা দাও। সিস্টেমের মূল উপাদানগুলো লিখ।]
CQ / Written solution
System হলো নির্দিষ্ট লক্ষ্য অর্জনে পরস্পর-সম্পর্কযুক্ত উপাদানের সমষ্টি।
- Input
- Processing
- Output
- Control ও feedback
- Boundary, environment ও interface
Information system মানুষ, procedure, data ও technology ব্যবহার করে তথ্য সংগ্রহ, প্রক্রিয়াকরণ, সংরক্ষণ ও বিতরণ করে।
8. (b) Describe the functions of flag of 8086 microprocessor.
[8086 মাইক্রোপ্রসেসরের flag register সমূহের কাজ লিখ।]
CQ / Written solution
8086-এ একটি 16-bit FLAGS register আছে; এর 9টি flag সক্রিয়।
| Flag | কাজ |
|---|---|
| CF | Unsigned carry/borrow |
| PF | ফলাফলের নিচের 8 বিটে even parity |
| AF | Bit 3 থেকে bit 4-এ carry/borrow |
| ZF | ফলাফল শূন্য |
| SF | ফলাফলের sign bit |
| OF | Signed arithmetic overflow |
| TF | Single-step execution |
| IF | Maskable interrupt enable |
| DF | String operation-এর দিক: 0 হলে বৃদ্ধি, 1 হলে হ্রাস |
9. (a) What is a MAC address? [ম্যাক অ্যাড্রেস কি?] (b) Define DNS [DNS এর সংজ্ঞা দাও]
CQ / Written solution
MAC address হলো link-layer interface identifier, সাধারণ Ethernet-এ 48-bit। Locally administered MAC বদলানো সম্ভব। DNS = Domain Name System; domain name-কে IP address-সহ resource record-এর সঙ্গে resolve করে।
10. What are 10 Base 2, 10 Base 5 and 10 Base T Ethernet LANs? [10 Base 2, 10 Base 5 এবং 10 Base T ইথারনেট LANs কি?]
CQ / Written solution
| Standard | Media | Speed | Maximum segment |
|---|---|---|---|
| 10BASE2 | Thin coaxial | 10 Mbit/s | 185 m |
| 10BASE5 | Thick coaxial | 10 Mbit/s | 500 m |
| 10BASE-T | Twisted pair | 10 Mbit/s | 100 m |