Computer Fundamentals – 35 MCQs Blog /* ─── RESET & BASE ─── */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: 'Segoe UI', Roboto, system-ui, sans-serif; background: #f0f4f9; color: #1e293b; padding: 20px; display: flex; justify-content: center; } .blog { max-width: 860px; width: 100%; background: #ffffff; border-radius: 28px; box-shadow: 0 16px 60px rgba(0, 20, 40, 0.08); padding: 30px 32px 40px; } /* ─── HEADER ─── */ .blog-header { border-bottom: 2px solid #e9eff5; padding-bottom: 18px; margin-bottom: 24px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; } .blog-header h1 { font-size: 26px; font-weight: 700; color: #0b2b4a; display: flex; align-items: center; gap: 10px; } .blog-header h1 small { font-size: 15px; font-weight: 500; background: #1e4b6a; color: #fff; padding: 2px 14px; border-radius: 40px; letter-spacing: 0.3px; } .stats { background: #f0f5fa; padding: 6px 18px; border-radius: 40px; font-size: 15px; font-weight: 500; } .stats span { color: #1e4b6a; } /* ─── PROGRESS ─── */ .progress-wrap { margin-bottom: 28px; } .progress-bar-bg { width: 100%; height: 8px; background: #e2eaf2; border-radius: 20px; overflow: hidden; } .progress-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #2a7faa, #1a5f85); border-radius: 20px; transition: width 0.4s ease; } .progress-label { display: flex; justify-content: space-between; font-size: 14px; color: #475569; margin-top: 6px; } /* ─── QUESTION CARD ─── */ .q-card { background: #f9fcff; border-radius: 18px; padding: 22px 24px 18px; margin-bottom: 20px; border: 1px solid #e9eff5; transition: 0.2s; } .q-card:hover { border-color: #c6d8e8; } .q-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; } .q-number { font-weight: 700; font-size: 16px; color: #1e4b6a; background: #e8f0f8; padding: 2px 16px; border-radius: 30px; } .q-tag { font-size: 12px; font-weight: 600; color: #64748b; background: #f1f5f9; padding: 2px 14px; border-radius: 30px; text-transform: uppercase; letter-spacing: 0.4px; } .q-text { font-size: 18px; font-weight: 500; line-height: 1.6; margin: 6px 0 14px 0; color: #0b2b4a; } .q-text .math { font-family: 'Times New Roman', serif; font-style: italic; } /* ─── OPTIONS ─── */ .options { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px 0; } .option { padding: 10px 16px; background: #ffffff; border: 2px solid #e2eaf2; border-radius: 12px; font-size: 16px; display: flex; align-items: center; gap: 12px; cursor: default; transition: 0.15s; } .option .letter { font-weight: 700; color: #1e4b6a; min-width: 26px; } .option.correct { background: #e3f5e9; border-color: #1e8b4a; } .option.correct .letter { color: #1e8b4a; } .option.wrong { background: #fde8e8; border-color: #c0392b; } .option.wrong .letter { color: #c0392b; } .option.reveal-correct { background: #e3f5e9; border-color: #1e8b4a; } /* ─── EXPLANATION ─── */ .explanation { margin-top: 14px; padding: 14px 18px; background: #f1f8ff; border-left: 5px solid #1e4b6a; border-radius: 10px; font-size: 15px; line-height: 1.7; color: #1e2e44; display: none; } .explanation.show { display: block; } .explanation strong { color: #0b2b4a; } .explanation .badge-answer { display: inline-block; background: #1e8b4a; color: #fff; font-size: 13px; font-weight: 700; padding: 0 14px; border-radius: 30px; margin-right: 6px; } /* ─── REVEAL BUTTON ─── */ .reveal-btn { background: #e8f0f8; border: none; padding: 8px 22px; border-radius: 40px; font-size: 14px; font-weight: 600; color: #1e3a5a; cursor: pointer; transition: 0.2s; margin-top: 6px; } .reveal-btn:hover { background: #d0deec; } .reveal-btn.revealed { background: #1e4b6a; color: #fff; } .reveal-btn.revealed:hover { background: #123a54; } /* ─── RESPONSIVE ─── */ @media (max-width: 640px) { .blog { padding: 16px 14px 28px; } .blog-header h1 { font-size: 20px; } .blog-header h1 small { font-size: 12px; padding: 1px 10px; } .stats { font-size: 13px; padding: 4px 12px; } .q-text { font-size: 16px; } .option { font-size: 14px; padding: 8px 12px; } .q-card { padding: 16px 14px 14px; } } @media (max-width: 420px) { .blog-header { flex-direction: column; align-items: stretch; gap: 4px; } .stats { text-align: center; } } /* small helper */ .mt-8 { margin-top: 8px; } .text-center { text-align: center; } 💻 Computer Fundamentals 35 MCQs ✅ 0 · 📌 0/35 0% 0 / 35 // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // DATA : 35 COMPUTER FUNDAMENTALS MCQs // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ const questions = [{ id: 1, text: `Who is the father of Computers?`, options: ['James Gosling', 'Charles Babbage', 'Dennis Ritchie', 'Bjarne Stroustrup'], answer: 1, explanation: `Charles Babbage is known as the "father of the computer" for his work on the Analytical Engine.` }, { id: 2, text: `Which of the following is the correct abbreviation of COMPUTER?`, options: [ 'Commonly Occupied Machines Used in Technical and Educational Research', 'Commonly Operated Machines Used in Technical and Environmental Research', 'Commonly Oriented Machines Used in Technical and Educational Research', 'Commonly Operated Machines Used in Technical and Educational Research' ], answer: 3, explanation: `COMPUTER stands for "Commonly Operated Machines Used in Technical and Educational Research".` }, { id: 3, text: `Which of the following is the correct definition of Computer?`, options: [ 'Machine or device that can be programmed to perform arithmetic or logic operations automatically', 'Computer understands only binary language (0s & 1s)', 'Programmable electronic device that stores, retrieves, and processes data', 'All of the mentioned' ], answer: 3, explanation: `All three statements correctly describe a computer.` }, { id: 4, text: `What is the full form of CPU?`, options: ['Computer Processing Unit', 'Computer Principle Unit', 'Central Processing Unit', 'Control Processing Unit' ], answer: 2, explanation: `CPU stands for Central Processing Unit – the brain of the computer.` }, { id: 5, text: `Which language does the computer understand directly?`, options: ['C Language', 'Assembly Language', 'Binary Language', 'BASIC'], answer: 2, explanation: `Computers natively understand machine language, which is binary (0s and 1s).` }, { id: 6, text: `Which computer language is written in binary codes only?`, options: ['Pascal', 'Machine Language', 'C', 'C#'], answer: 1, explanation: `Machine language consists solely of binary instructions (0s and 1s).` }, { id: 7, text: `Which part is known as the brain of the computer?`, options: ['Central Processing Unit', 'Memory', 'Arithmetic and Logic Unit', 'Control Unit'], answer: 0, explanation: `The CPU (Central Processing Unit) is considered the brain of the computer.` }, { id: 8, text: `Which of the following is NOT a characteristic of a computer?`, options: ['Versatility', 'Accuracy', 'Diligence', 'I.Q.'], answer: 3, explanation: `Computers have no intelligence (I.Q.) of their own – they only follow instructions.` }, { id: 9, text: `What is the smallest unit of data in a computer?`, options: ['Bit', 'KB', 'Nibble', 'Byte'], answer: 0, explanation: `A bit (binary digit) is the smallest unit of data, representing 0 or 1.` }, { id: 10, text: `Which unit converts user data into a computer‑understandable format?`, options: ['Output Unit', 'Input Unit', 'Memory Unit', 'Arithmetic & Logic Unit'], answer: 1, explanation: `The Input Unit converts human‑readable data into machine‑readable form.` }, { id: 11, text: `Which monitor looks like a television and is used with non‑portable systems?`, options: ['LED', 'LCD', 'CRT', 'Flat Panel Monitors'], answer: 2, explanation: `CRT (Cathode Ray Tube) monitors resemble traditional TVs.` }, { id: 12, text: `Which of the following is NOT a type of computer code?`, options: ['EDIC', 'ASCII', 'BCD', 'EBCDIC'], answer: 0, explanation: `EDIC is not a standard code; ASCII, BCD, and EBCDIC are widely used.` }, { id: 13, text: `Which processor part contains the hardware to perform all operations?`, options: ['Controller', 'Registers', 'Cache', 'Data path'], answer: 3, explanation: `The data path includes the ALU and registers for executing instructions.` }, { id: 14, text: `What is designed to control the operations of a computer?`, options: ['User', 'Application Software', 'System Software', 'Utility Software'], answer: 2, explanation: `System Software (e.g., the OS) manages and controls hardware and operations.` }, { id: 15, text: `Which device uses positional notation to represent decimal numbers?`, options: ['Pascaline', 'Abacus', 'Computer', 'Calculator'], answer: 1, explanation: `The abacus uses positional notation to represent numbers.` }, { id: 16, text: `Where is EBCDIC commonly used?`, options: ['Super Computers', 'Mainframes', 'Machine Codes', 'Programming'], answer: 1, explanation: `EBCDIC is primarily used in IBM mainframe systems.` }, { id: 17, text: `Physical devices of a computer are called:`, options: ['Hardware', 'Software', 'System Software', 'Package'], answer: 0, explanation: `Hardware refers to the physical components of a computer.` }, { id: 18, text: `What defines the ordering of characters used by the computer?`, options: ['Accumulation', 'Sorting', 'Collating Sequence', 'Unicode'], answer: 2, explanation: `Collating sequence defines character ordering (e.g., in ASCII).` }, { id: 19, text: `Which storage uses a robotic arm to connect/disconnect offline media?`, options: ['Magnetic', 'Secondary', 'Virtual', 'Tertiary'], answer: 3, explanation: `Tertiary storage (e.g., tape libraries) uses robotic arms for media management.` }, { id: 20, text: `What is the interval between a disk request and its completion?`, options: ['Disk utilization time', 'Drive utilization time', 'Disk access time', 'Disk arrival time'], answer: 2, explanation: `Disk access time includes seek, rotational, and transfer times.` }, { id: 21, text: `Which devices enable communication between computer and the outer world?`, options: ['Compact', 'I/O', 'Drivers', 'Storage'], answer: 1, explanation: `I/O (Input/Output) devices provide the interface with the external world.` }, { id: 22, text: `Which input devices allow direct data entry from source documents?`, options: ['System Access devices', 'Data acquiring devices', 'Data retrieving devices', 'Data Scanning devices' ], answer: 3, explanation: `Data Scanning devices (e.g., OCR, MICR) read source documents directly.` }, { id: 23, text: `Which device converts maps, pictures, and drawings into digital form?`, options: ['Image Scanner', 'Digitizer', 'MICR', 'Scanner'], answer: 1, explanation: `A digitizer converts analogue graphics into digital data.` }, { id: 24, text: `Who can access a server?`, options: ['Web Client', 'User', 'Web Browser', 'Web Server'], answer: 0, explanation: `A web client (like a browser) makes requests to the server.` }, { id: 25, text: `Which language is made up of binary‑coded instructions?`, options: ['High level', 'BASIC', 'C', 'Machine'], answer: 3, explanation: `Machine language is binary coded (0s and 1s).` }, { id: 26, text: `Which package helps users store and retrieve personal information?`, options: ['Personal assistance package', 'Graphics package', 'Spreadsheet package', 'Animation package' ], answer: 0, explanation: `Personal assistance packages manage contacts, calendars, and other personal data.` }, { id: 27, text: `What is created when a user opens an account in a computer system?`, options: ['SFD', 'MFD', 'Subdirectory', 'RFD'], answer: 2, explanation: `A subdirectory (user directory) is created for the new user.` }, { id: 28, text: `Which technique marked the beginning of computer communications?`, options: ['User Environment', 'Batch Environment', 'Time Sharing', 'Message passing'], answer: 2, explanation: `Time‑sharing enabled interactive communication between users and computers.` }, { id: 29, text: `In which technique are dumb terminals connected to a central system?`, options: ['Time Sharing', 'Message passing', 'Batch environment', 'User environment'], answer: 0, explanation: `Time‑sharing systems use dumb terminals connected to a mainframe.` }, { id: 30, text: `Which service allows logging into another computer on the Internet?`, options: ['e‑mail', 'UseNet', 'Telnet', 'FTP'], answer: 2, explanation: `Telnet provides remote login capabilities over the Internet.` }, { id: 31, text: `Which is NOT a type of computer based on operation?`, options: ['Digital', 'Analog', 'Hybrid', 'Remote'], answer: 3, explanation: `Digital, Analog, and Hybrid are the three operational types; Remote is not.` }, { id: 32, text: `Which computer type is mostly used for automatic operations?`, options: ['Analog', 'Digital', 'Hybrid', 'Remote'], answer: 0, explanation: `Analog computers are often used in automatic control systems.` }, { id: 33, text: `Which invention led to much cheaper microcomputers?`, options: ['PDAs', 'Microprocessors', 'Microcomputers', 'Mainframes'], answer: 1, explanation: `The microprocessor made low‑cost personal computers possible.` }, { id: 34, text: `Which computers are lower than mainframes in speed and storage?`, options: ['Mainframes', 'Hybrid', 'Mini', 'Super'], answer: 2, explanation: `Mini‑computers are less powerful than mainframes.` }, { id: 35, text: `What is the name of the first neural network computer?`, options: ['AN', 'AM', 'RFD', 'SNARC'], answer: 3, explanation: `SNARC (Stochastic Neural Analog Reinforcement Computer) was the first neural network machine.` }]; // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // STATE // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ let userAnswers = {}; // { qId: selectedOptionIndex } let revealed = {}; // { qId: true } if explanation is shown // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // DOM REFS // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ const container = document.getElementById('questionsContainer'); const scoreDisplay = document.getElementById('scoreDisplay'); const answeredDisplay = document.getElementById('answeredDisplay'); const progressFill = document.getElementById('progressFill'); const progressText = document.getElementById('progressText'); const counterLabel = document.getElementById('counterLabel'); // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // RENDER // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ function render() { let html = ''; const letters = ['A', 'B', 'C', 'D']; questions.forEach((q, idx) => { const selected = userAnswers[q.id] !== undefined ? userAnswers[q.id] : null; const isAnswered = selected !== null; const isRevealed = revealed[q.id] || false; html += ``; html += ``; html += `Q${idx + 1}`; html += `${isAnswered ? '✅ Answered' : '⏳ Pending'}`; html += ``; html += `${q.text}`; html += ``; q.options.forEach((opt, optIdx) => { let cls = 'option'; if (isAnswered) { if (optIdx === q.answer) cls += ' correct'; else if (selected === optIdx && optIdx !== q.answer) cls += ' wrong'; } html += ``; html += `${letters[optIdx]}. ${opt}`; html += ``; }); html += ``; // Explanation const showExp = isAnswered || isRevealed; html += ``; if (showExp) { const isCorrect = selected === q.answer; const icon = isCorrect ? '✅' : '❌'; html += `${letters[q.answer]} `; html += `${icon} ${isCorrect ? 'Correct!' : 'Wrong.'} – `; html += q.explanation; } html += ``; // Reveal button (only if not answered) if (!isAnswered) { html += `💡 Show Answer & Explanation`; } else { html += `🔽 Hide Explanation`; } html += ``; }); container.innerHTML = html; // ── Attach event listeners ── document.querySelectorAll('.reveal-btn').forEach(btn => { btn.addEventListener('click', function(e) { const qid = parseInt(this.dataset.qid); const action = this.dataset.action; if (action === 'reveal') { // Reveal the answer without scoring revealed[qid] = true; render(); // Scroll to the question document.getElementById(`q-${qid}`).scrollIntoView({ behavior: 'smooth', block: 'center' }); } else if (action === 'hide') { // Hide explanation delete revealed[qid]; render(); } }); }); // ── Option clicks (only if not answered) ── // We need to attach click to the option divs // Since we re-render, we can use event delegation on container // But we need to know which question. We'll use data attributes. // Better: use a global listener. // We'll add a listener to the container for clicks on .option that are not .correct/.wrong (i.e., not answered) // But we can also re-attach via querySelectorAll after render. // Let's just re-run the attachment each render. // We'll clear previous listeners by using a fresh event listener on container. // Actually, we can add a single event listener on container using event delegation. // Remove previous listener by cloning? No, let's just use a flag. // We'll attach a new listener each time but remove old one by replacing. // Since we re-render, we can just add a listener to the container once. // But it will duplicate. Let's use a single listener outside render. // We'll handle it in the global setup. updateStats(); } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // UPDATE STATS // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ function updateStats() { const total = questions.length; let answered = 0; let correct = 0; questions.forEach(q => { const ans = userAnswers[q.id]; if (ans !== undefined) { answered++; if (ans === q.answer) correct++; } }); scoreDisplay.textContent = correct; answeredDisplay.textContent = answered; const pct = total === 0 ? 0 : Math.round((answered / total) * 100); progressFill.style.width = pct + '%'; progressText.textContent = pct + '%'; counterLabel.textContent = `${answered} / ${total}`; } // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // EVENT DELEGATION (for option clicks) // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ container.addEventListener('click', function(e) { const optionDiv = e.target.closest('.option'); if (!optionDiv) return; // Find the parent q-card const card = optionDiv.closest('.q-card'); if (!card) return; const qid = parseInt(card.id.replace('q-', '')); const q = questions.find(q => q.id === qid); if (!q) return; // If already answered, ignore if (userAnswers[q.id] !== undefined) return; // Find which option index const options = card.querySelectorAll('.option'); let selectedIdx = -1; options.forEach((opt, idx) => { if (opt === optionDiv) selectedIdx = idx; }); if (selectedIdx === -1) return; // Record answer userAnswers[q.id] = selectedIdx; // Auto-reveal explanation revealed[q.id] = true; render(); }); // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ // INIT // ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ render();