কম্পিউটার সায়েন্স এন্ড ইঞ্জিনিয়ারিং
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 exams(vii) Which one is the simplified form of the Boolean equation A'C + A'B + AB'C + BC? [বুলিয়ান সমীকরণ A'C + A'B + AB'C + BC এর সংক্ষিপ্তরূপ কি?]
Correct answer: b
A'C + AB'C + BC = C(A' + AB' + B) = C; ফলে F = C + A'B।
(viii) The binary code of $(21.125)_{10}$ is ---- [$(21.125)_{10}$ এর বাইনারী -----]
Correct answer: a
21.125 decimal = 10101.001 binary।
Source ambiguity: see solution note.
(ix) What is the negation of the predicate $\forall x (p(y) \rightarrow q(x))$? [$\forall x (p(y) \rightarrow q(x))$ predicate এর বিপরীত কি?]
- $\forall x \exists y (p(y) \rightarrow \sim q(x))$
- $\forall x \exists y (p(y) \wedge \sim q(x))$
- $\exists x \forall y (p(y) \wedge \sim q(x))$
- $\exists x \forall y (p(x) \wedge \sim q(x))$
CQ / Written solution
\(\neg\forall x(p(y)\to q(x))=\exists x(p(y)\land\neg q(x))\)। y free থাকে; কোনো option-এ সঠিক quantifier নেই।
(x) MAC (Medium Access Control) sublayer is the part of ------ [MAC সাব লেয়ার নিম্নের কোনটির অংশ -----]
Correct answer: c
MAC sublayer data-link layer-এর অংশ।
Source ambiguity: see solution note.
1. (a) Find out the output from the given module of program. [নিম্নে C প্রোগ্রামিং এর একটি অংশ দেওয়া হল, অংশটি থেকে আউটপুট এর মান কি কি হবে বের কর?]
void main ()
{
int a, b, c, d;
a = 15;
b = 10;
c = ++a-b;
printf(“a=%d b=%d c=%d\n”, a, b, c);
d = b ++ + a;
printf(“a=%d b=%d d=%d\n”, a, b, d);
printf(“a/b=%d\n”, a%b);
printf(a%%b=%d\n”, a%b);
printf(“a*=b=%d\n”,a*=b);
printf(“%d\n”,(c>d)? 1:0);
printf(“%d\n”, (c<d)? 1;0);
}CQ / Written solution
Printed program-এ string quotes নেই এবং শেষ ternary-তে colon-এর বদলে semicolon আছে; তাই মূল code compile হয় না। Quotes ও ternary ঠিক করলে, এবং source-এর a%b expression অপরিবর্তিত রাখলে:
a = 16 b = 10 c = 6
a = 16 b = 11 d = 26
a/b = 5
a%b = 5
a*=b = 176
0
1তৃতীয় line-এর label a/b হলেও calculation a%b; সত্যিই a/b করলে integer result 1।
1. (b) Write a program in C language to print the first 10 fibonacci number using recursion function. [রিকারসন ফাংশন ব্যবহার করে প্রথম 10 টি fibonacci number প্রিন্ট করার জন্য C ভাষায় একটি প্রোগ্রাম লিখ।]
CQ / Written solution
#include <stdio.h>
unsigned int fib(unsigned int n) {
return n < 2 ? n : fib(n - 1) + fib(n - 2);
}
int main(void) {
for (unsigned int i = 0; i < 10; ++i)
printf("%u%c", fib(i), i == 9 ? '\n' : ' ');
return 0;
}Output: 0 1 1 2 3 5 8 13 21 34।
2. (a) What are the main features of OOP? [OOP এর প্রধান বৈশিষ্ট্যগুলো কি?]
CQ / Written solution
- Encapsulation: data ও methods একই class-এ রাখা এবং access control।
- Abstraction: প্রয়োজনীয় interface প্রকাশ, implementation লুকানো।
- Inheritance: base class থেকে behaviour reuse/extend।
- Polymorphism: একই interface দিয়ে বিভিন্ন implementation।
Class, object এবং message/method call OOP-এর মৌলিক ধারণা।
(b) Distinguish between static binding and dynamic binding. [Static binding এবং dynamic binding এর মধ্যে পার্থক্য কর।]
CQ / Written solution
| Static binding | Dynamic binding |
|---|---|
| Compile-time-এ function নির্বাচন | Run-time object type অনুযায়ী নির্বাচন |
| উদাহরণ: overload, non-virtual member | উদাহরণ: virtual function override |
| Declared type/argument type গুরুত্বপূর্ণ | Base reference/pointer দিয়ে derived virtual method call |
3. (a) Suppose A and B are sets and $|\text{A}| = 140$, $|\text{B}| = 90$.
(i) Find $|\text{A} \cup \text{B}|$ given that $|\text{A} \cap \text{B}| = 36$. (ii) Find $|\text{A} \cap \text{B}|$ given that $|\text{A} \cup \text{B}| = 150$.
[মনে কর, A ও B একটি সেট এবং $|\text{A}| = 140$, $|\text{B}| = 90$। (i) যদি $|\text{A} \cap \text{B}| = 36$ হয় তাহলে $|\text{A} \cup \text{B}|$ এর মান নির্ণয় কর। (ii) যদি $|\text{A} \cup \text{B}| = 150$ হয় তাহলে $|\text{A} \cap \text{B}|$ এর মান নির্ণয় কর।]
CQ / Written solution
\[|A\cup B|=|A|+|B|-|A\cap B|\]
\[\text{(i)}\quad|A\cup B|=140+90-36=194\]
\[\text{(ii)}\quad|A\cap B|=140+90-150=80\]
3. (b) How many strings of three decimal digits are possible? If the string (i) do not contain the same digit three times (ii) begin with an odd digit (iii) have exactly three digits that are 9s. [তিন দশমিক সংখ্যার কতগুলো স্ট্রিং হবে যদি...]
(Top left text continues from the previous page's sub-questions)
[(i) একই অংক তিনবার না ধারণ করে (ii) বিজোড় অংক দ্বারা শুরু হয় (iii) তিনটি অংকেই 9 আছে।]
CQ / Written solution
String-এ leading zero অনুমোদিত। প্রতিটি অবস্থানে 10টি digit।
\[N=10^3=1000\]
- তিন digit একই নয়: \(1000-10=990\)।
- Odd digit দিয়ে শুরু: \(5\times10\times10=500\)।
- ঠিক তিনটি 9 আছে: শুধু 999, অর্থাৎ 1টি।