DUET CSE 2006-2007 - Previous Year
Reading mode — untimed, no attempt is recorded1. (a) Write a program in C language to read data from the keyboard, write it in a file called “INPUT” again read the same data from the “INPUT’ file and display it on the screen. [সি ভাষায় একটি প্রোগ্রাম লিখ যা কি বোর্ড থেকে ডাটা পড়বে এবং INPUT নামে একটি ফাইলে লিখবে এবং পুনরায় INPUT নামের ফাইল থেকে পড়বে এবং স্ক্রীনে প্রদর্শন করবে।]
একটি line keyboard থেকে পড়ে INPUT ফাইলে লিখে আবার file থেকে দেখানো:
#include <stdio.h>
int main(void) {
char data[1024];
if (!fgets(data, sizeof data, stdin)) return 1;
FILE *fp = fopen("INPUT", "w");
if (!fp) { perror("INPUT"); return 1; }
if (fputs(data, fp) == EOF) { fclose(fp); return 1; }
if (fclose(fp) != 0) return 1;
fp = fopen("INPUT", "r");
if (!fp) { perror("INPUT"); return 1; }
int ch;
while ((ch = fgetc(fp)) != EOF) putchar(ch);
int failed = ferror(fp);
fclose(fp);
return failed ? 1 : 0;
}
1. (b) How many keywords are there in C++ programming language? Mention at least six keywords. [সি++ প্রোগ্রামিং ল্যাঙ্গুয়েজে কতটি কী ওয়ার্ড আছে? কমপক্ষে ০৬ টি কীওয়ার্ডের নাম উল্লেখ কর।] (07)
C++ keyword count language-standard version অনুযায়ী বদলায়; version ছাড়া একটিমাত্র সংখ্যা নির্ভুল নয়। ছয়টি keyword: class, public, private, protected, virtual, return। এগুলো case-sensitive reserved words।
2. (a) Let B = {a, b, c, d, e, f, g, h} and A = {a, b, c, k, e}. Find (i) A $\cup$ B (ii) A $\cap$ B (iii) A - B (iv) B - A [ধর, B = {a, b, c, d, e, f, g, h} এবং A = {a, b, c, k, e} বাহির কর (i) A$\cup$B (ii) A$\cap$B (iii) A - B (iv) B - A] (04)
\[A\cup B=\{a,b,c,d,e,f,g,h,k\}\]
\[A\cap B=\{a,b,c,e\}\]
\[A-B=\{k\},\qquad B-A=\{d,f,g,h\}\]
2. (b) If we roll a what be will be the probability of getting a number divisible by 2 or 3. [আমরা যদি একটি ছক্কা নিক্ষেপ করি তাহলে উপরের পিঠে ২ অথবা ৩ দ্বারা বিভাজ্য সংখ্যা পাওয়ার সম্ভবতা কত?]
\[E=\{2,3,4,6\},\qquad P(E)=\frac46=\boxed{\frac23}\]
Fair six-sided die ধরা হয়েছে; 6-কে একবারই গণনা করা হয়।
3. Consider a linear array AAA (5:50), BBB (-5:10) and CCC (18), suppose base (AAA) = 300 and the number of words per memory cell is 4 for AAA. a) Find the number of elements in each array b) The address of AAA (15), AAA (35) and AAA [55] [(AAA (5:50). BBB(-5:10) এবং CCC (18) & ধর বেইস (AAA) = 300 এবং AAA এর জন্য মেমোরি সেলের ওয়ার্ড সংখ্যা 4 (চার) (a) প্রত্যেক এ্যারের এলিমেন্ট সংখ্যা বের কর। (b) AAA [15], AAA [35] এবং AAA [55] এর এড্রেস বের কর। (14)
\[N_{AAA}=50-5+1=46,\quad N_{BBB}=10-(-5)+1=16,\quad N_{CCC}=18\]
\[\operatorname{LOC}(AAA[k])=300+4(k-5)\]
\[\operatorname{LOC}(AAA[15])=340,\quad\operatorname{LOC}(AAA[35])=420\]
AAA[55] invalid: declared upper bound 50। Formula-এ 500 পাওয়া গেলেও সেটি array-এর বৈধ element address নয়।
4. (a) What is database ? Define primary key with example. (ডাটাবেস বলতে কি বুঝায়। Primary Key উদাহরণসহ সংজ্ঞায়িত কর।)
Database হলো সংগঠিত সম্পর্কিত data-এর collection। Primary key প্রতিটি row-কে uniquely চিহ্নিত করে; এটি unique এবং NOT NULL। উদাহরণ: Student(StudentID, Name)-এ StudentID primary key।
4. (b) Write six components of an E-R diagram. [E-R ডায়াগ্রামের ছয়টি কম্পোনেন্টের নাম লিখ।] (06)
| Component | Chen notation |
|---|---|
| Entity | Rectangle |
| Weak entity | Double rectangle |
| Relationship | Diamond |
| Attribute | Oval |
| Key attribute | Underlined attribute name |
| Multivalued attribute | Double oval |
5. (a) What are the advantages of database management system? [ডাটাবেস ম্যানেজমেন্ট সিস্টেমের সুবিধাগুলি লিখ।] (04)
- নিয়ন্ত্রিত redundancy ও consistency।
- Constraints দিয়ে data integrity।
- Authorization ও access control।
- Transactions ও concurrent access।
- Backup এবং crash recovery।
- Data independence ও SQL query।
5. (b) What is meant by data query? Mention the names of different types of query? [ডাটাকুয়েরী বলতে কি বুঝায়? বিভিন্ন ধরণের কুয়েরীর নাম উল্লেখ কর।] (09)
Query হলো database থেকে data চাওয়া বা data পরিবর্তনের নির্দেশ।
- SELECT/retrieval query।
- Parameter query।
- Aggregate/summary ও crosstab query।
- Action queries: INSERT, UPDATE, DELETE।
Query-builder product অনুযায়ী type-এর নাম ভিন্ন হতে পারে।
6. What are the different information system development methodologies? Write the phases of system development life cycles (SDLC). [বিভিন্ন ইনফরমেশন সিস্টেম ডেভেলপমেন্ট মেথোডোলজিগুলো কি কি? সিস্টেম ডেভেলপমেন্ট লাইফ সাইকেলের ফেজগুলো লিখ।] (13)
Development methodologies: waterfall, iterative/incremental, prototyping, spiral, agile।
- Planning ও feasibility।
- Requirements analysis।
- System design।
- Implementation।
- Testing।
- Deployment।
- Operation ও maintenance।
7. Define top-down design, Mention has advantages of top-down design. [টপ-ডাউন ডিজাইনের সংজ্ঞা দাও। টপ-ডাউন ডিজাইন এর সুবিধাগুলো উল্লেখ কর।] (13)
Top-down design-এ বড় সমস্যাকে ছোট module/subproblem-এ ভাগ করা হয়; প্রতিটি module-কে আরও বিশদ করা হয় যতক্ষণ সরাসরি implement করা যায়।
- Complexity কমে।
- Interface ও দায়িত্ব পরিষ্কার হয়।
- Module আলাদাভাবে test ও maintain করা যায়।
- Team-এর মধ্যে কাজ ভাগ করা সহজ।
8 (a). What is meant by operating system? What are the major goals of an operating system? Write the main components of operating system. [অপারেটিং সিস্টেম বলতে কি বুঝ? অপারেটিং সিস্টেম এর প্রধান উদ্দেশ্যগুলো কি? অপারেটিং সিস্টেমের প্রধান কম্পোনেন্ট গুলো লিখ।]
Operating system hardware resources পরিচালনা করে এবং application-কে services দেয়। লক্ষ্য: convenience, efficient resource use, reliability ও protection।
- Process management ও CPU scheduling।
- Memory management।
- File এবং storage management।
- Device/I/O management।
- Security/protection।
- System-call interface ও user interface।
8. (b) Write five types of operating system used for personal computer. [Personal Computer- এ ব্যবহৃত পাঁচ প্রকার অপারেটিং সিস্টেম এর নাম লিখ।]
Personal computer operating-system উদাহরণ: Microsoft Windows, macOS, GNU/Linux, FreeBSD এবং ঐতিহাসিক MS-DOS। এগুলো উদাহরণ, বর্তমান version বা ব্যবহারের recommendation নয়।
9. What are the services provided in LINUX by the following commands? i) pwd, ii) mkdir, iii) ls -a iv) cat v) cp vi) mv [নিম্নলিখিত কমান্ডগুলো লিনাক্স এ কি কি কাজ করে? i) pwd ii) mkdir iii) ls –a iv) cat v) cp vi) mv] (12)
| Command | কাজ |
|---|---|
| pwd | Current working directory-এর path |
| mkdir | Directory তৈরি |
| ls -a | Dotfile-সহ সব directory entry দেখানো |
| cat | File content concatenate করে standard output-এ লেখা |
| cp | File copy; directory-এর জন্য recursive option |
| mv | File/directory move বা rename |
10 (a). On what basis a microprocessor is considered as 8-bit, 10-bit or a 32 bit device. [কিসের উপর ভিত্তি করে মাইক্রোপ্রসেসরকে 8-bit, 10-bit এবং 32 bit মাইক্রোপ্রসেসর বলা হয়।] (04)
Processor bitness মূলত native integer register/ALU word width দিয়ে বোঝানো হয়। 8-bit processor স্বাভাবিকভাবে 8-bit data operation করে; 16-bit ও 32-bit-এর জন্য একই ধারণা। External data/address bus width আলাদা হতে পারে। প্রশ্নের 10-bit শব্দটি অস্বাভাবিক; 16-bit বোঝালে একই ব্যাখ্যা প্রযোজ্য।
10. (b) Mention the addressing mode of 8085 microprocessor with example of each [উদাহরণ 8085 মাইক্রোপ্রসেসরের অ্যাড্রেসিং মোডগুলো উল্লেখ কর।] (10)
| Addressing mode | 8085 example |
|---|---|
| Immediate | MVI A, 25H |
| Register | MOV A, B |
| Direct | LDA 2050H |
| Register indirect | MOV A, M (HL points to memory) |
| Implied/implicit | CMA |
11. What the layers of the OSI and TCP/IP reference models. [OSI এবং TCP/IP রেফারেন্স মডেলের স্তরগুলো কি কি?]
| OSI (উপর থেকে নিচে) | মূল কাজ |
|---|---|
| Application | Application-level network service |
| Presentation | Data representation, encoding, encryption |
| Session | Session/dialog coordination |
| Transport | End-to-end process delivery, ports |
| Network | Logical addressing ও routing |
| Data link | Framing, MAC addressing, media access, error detection |
| Physical | Medium-এ bits/signals পাঠানো |
TCP/IP-এর 4 স্তর: Application, Transport, Internet, Link। Application-এ OSI-এর উপরের তিন স্তর, Link-এ নিচের দুই স্তর একত্রে ধরা হয়।
12. Distinguish between LAN (Local Area Network) and WAN (Wide Area Network) (LAN এবং WAN এর মধ্যে পার্থক্য কর।)
| Network | পরিসর | সাধারণ বৈশিষ্ট্য |
|---|---|---|
| LAN | Room/building/campus | সীমিত area, সাধারণত এক প্রতিষ্ঠানের নিয়ন্ত্রণ |
| MAN | City/metropolitan area | একাধিক LAN সংযোগ |
| WAN | Region/country/world | দূরবর্তী network যুক্ত; carrier infrastructure ব্যবহার হতে পারে |
13 (a) Convert the following numbers of decimal numbers. [নিম্নলিখিত সংখ্যাগুলোকে ডেসিমাল সংখ্যায় রূপান্তরিত কর।] (06)
(i) $(1001101)_2$ \ \ \ \ \ \ (ii) $(A90)_{16}$
\[(1001101)_2=64+8+4+1=\boxed{77}_{10}\]
\[(A90)_{16}=10\times16^2+9\times16=\boxed{2704}_{10}\]
13. (b) Simplify the expression $X = (\overline{A} + B)(A + B + D)\overline{D}$. After simplification draw a logic circuit. [$X = (\overline{A} + B)(A + B + D)\overline{D}$ সমীকরণটির সরলীকরণ কর। সরলীকরণের পরে উহার লজিক বর্তনীটি আঁক।]
\[X=(\bar A+B)(A+B+D)\bar D=(\bar A+B)(A+B)\bar D=\boxed{B\bar D}\]
Circuit: D-তে NOT gate, তারপর B এবং NOT D-কে AND gate-এ দাও।
14. What is a semiconductor? Find the current through the diode in the circuit shown in figure, Assume the diode to be ideal. [সেমিকন্ডাক্টর বলতে কি বুঝায়? নিম্নোক্ত চিত্র হতে ডায়োডের মধ্যে দিয়ে তড়িৎ প্রবাহ বের কর। মনে কর, ডায়োডটি হবে আইডিয়াল।] (14)
(Circuit Diagram features a $V = 10\text{ V}$ DC source connected to a resistor $R_1 = 50\ \Omega$, leading to a parallel branch containing a resistor $R_2 = 5\ \Omega$ and an ideal diode $D$ pointing downwards between nodes A and B).
Semiconductor-এর conductivity conductor ও insulator-এর মাঝামাঝি; doping, temperature ও electric field দিয়ে নিয়ন্ত্রণ করা যায়। উদাহরণ silicon, germanium।
Source-এর circuit description-এ 10 V source, series 50 Ω, এরপর 5 Ω-এর parallel-এ forward-biased ideal diode। Diode short হিসেবে 5 Ω bypass করে।
\[I_D=10/50=\boxed{0.2\,\mathrm A},\quad I_{5\Omega}=0\]
Diode reverse-biased হলে এই ফল নয়: ID = 0।
15. Find the current $I_0, I_1$ and $I_2$ of the following circuit. [নিম্নের সার্কিটের জন্য $I_0, I_1$ এবং $I_2$ তড়িৎ প্রবাহ নির্ণয় কর।] (14)
(Circuit Diagram features a complex bridge network powered by an unspecified voltage source, labeled with multiple resistors: $R_1 = 4\ \Omega$, $R_2 = 6\ \Omega$, $R_3 = 20\ \Omega$, $R_4 = 10\ \Omega$, $R_5 = 20\ \Omega$, $R_6 = 15\ \Omega$, $R_7 = 18\ \Omega$, $R_8 = 13\ \Omega$, $R_9 = 10\ \Omega$).
মূল চিত্র/ডেটা অসম্পূর্ণ: এই document-এ নির্ভরযোগ্য original circuit image ও সম্পূর্ণ সংযোগ নেই। তাই একক numerical answer নিশ্চিত করা যাচ্ছে না।
Supply voltage, labelled branches ও resistor connections নিশ্চিত করে node voltages বের করো।
\[I_{ij}=\frac{V_i-V_j}{R_{ij}},\qquad V_{CD}=V_C-V_D\]
Source solution-এ ধরে নেওয়া voltage বা branch numbering যাচাই ছাড়া numerical answer প্রকাশ করা হয়নি।