Computer MCQs | part-3 with Explanations * { margin: 0; padding: 0; box-sizing: border-box; } body { background: #f1f5f9; font-family: 'Segoe UI', 'Inter', system-ui, -apple-system, sans-serif; padding: 2rem 1rem; color: #0f172a; } .container { max-width: 1100px; margin: 0 auto; } .quiz-header { background: linear-gradient(135deg, #0f2b3d 0%, #1e4a6e 100%); border-radius: 1.5rem; padding: 1.5rem 2rem; margin-bottom: 2rem; color: white; box-shadow: 0 10px 20px -5px rgba(0,0,0,0.2); } .quiz-header h1 { font-size: 1.8rem; font-weight: 700; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; } .badge { background: #f59e0b; color: #0f2b3d; font-size: 0.85rem; padding: 4px 14px; border-radius: 40px; font-weight: 600; } .sub { margin-top: 10px; opacity: 0.85; font-size: 0.9rem; } .stats-bar { background: #fff; border-radius: 60px; padding: 12px 20px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 25px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); border: 1px solid #e5e7eb; } .progress { background: #eef2ff; color: #1e3a8a; padding: 24px 24px; border-radius: 30px; font-size: 15px; font-weight: 600; } .score { background: #fef3c7; color: #92400e; padding: 8px 18px; border-radius: 30px; font-size: 15px; font-weight: 600; } .reset-btn { background: #ef4444; color: #fff; border: none; padding: 8px 22px; border-radius: 30px; cursor: pointer; font-weight: 600; transition: 0.3s; } .reset-btn:hover { background: #dc2626; transform: translateY(-2px); } .questions-grid { display: flex; flex-direction: column; gap: 1.5rem; } .card { background: white; border-radius: 1.25rem; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); overflow: hidden; border: 1px solid #e2edf7; } .card-header { background: #fafcff; padding: 1rem 1.5rem; border-bottom: 2px solid #eef2ff; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: baseline; } .q-num { font-weight: 800; color: #0f3b5c; font-size: 1rem; } .q-text { font-weight: 600; color: #0c4a6e; font-size: 1rem; line-height: 1.4; flex: 1; } .options-area { padding: 1.2rem 1.5rem 0.8rem 1.5rem; display: flex; flex-direction: column; gap: 0.7rem; } .option { display: flex; align-items: center; gap: 14px; background: #ffffff; padding: 8px 16px; border-radius: 60px; border: 1px solid #dee7f0; cursor: pointer; transition: all 0.15s; } .option:hover { background: #f8fafc; border-color: #94a3b8; } input[type="radio"] { accent-color: #2563eb; width: 18px; height: 18px; cursor: pointer; } .option-label { font-weight: 500; color: #1e293b; flex: 1; cursor: pointer; font-size: 0.95rem; } .card-footer { padding: 0.8rem 1.5rem 1.3rem 1.5rem; background: #fefefe; border-top: 1px solid #eef2ff; display: flex; flex-direction: column; gap: 12px; } .feedback { font-size: 0.85rem; font-weight: 600; padding: 6px 14px; border-radius: 30px; display: inline-block; width: fit-content; } .feedback.correct { background: #d1fae5; color: #065f46; } .feedback.wrong { background: #fee2e2; color: #991b1b; } .feedback.neutral { background: #f1f5f9; color: #475569; } .explanation { background: #f0f9ff; padding: 12px 16px; border-radius: 1rem; font-size: 0.85rem; color: #0369a1; border-left: 4px solid #0ea5e9; display: none; } .explanation.show { display: block; } .explanation strong { color: #0c4a6e; } .toggle-explanation { background: none; border: none; color: #3b82f6; font-weight: 600; font-size: 0.75rem; cursor: pointer; padding: 4px 12px; border-radius: 20px; transition: 0.1s; } .toggle-explanation:hover { background: #eef2ff; text-decoration: underline; } .action-bar { display: flex; justify-content: flex-start; align-items: center; flex-wrap: wrap; gap: 10px; } @media (max-width: 700px) { .quiz-header h1 { font-size: 1.3rem; } .option { padding: 6px 12px; } .stats-bar { flex-direction: column; border-radius: 20px; text-align: center; } .progress, .score, .reset-btn { width: 100%; } } footer { text-align: center; margin-top: 2rem; font-size: 0.75rem; color: #5b6e8c; background: transparent; } 📚 MCQ part 3 with Explanations Number Systems, Memory, CPU, Signals, Digital Fundamentals — Competitive Exam Prep 📋 Attempted: 0 / 27 ⭐ Score: 0 ⟳ Reset All ✅ Select any option • Click "Show Explanation" for detailed solution • Auto-saves progress const questions = [ { id: 46, text: "Convert 101110 into decimal notation.", options: ["44", "56", "72", "46"], correct: "46", explanation: "101110₂ = 1×32 + 0×16 + 1×8 + 1×4 + 1×2 + 0×1 = 32+0+8+4+2 = 46." }, { id: 47, text: "The decimal representation of the binary number (101010.011)₂ is", options: ["42.25", "24.25", "24.375", "42.375"], correct: "42.375", explanation: "101010₂ = 32+8+2 = 42. .011₂ = 0×0.5 + 1×0.25 + 1×0.125 = 0.375. Total = 42.375." }, { id: 48, text: "The 2's complement of the binary number (11001001)₂ is", options: ["(000110110)₂", "(00111111)₂", "(00110111)₂", "(10110111)₂"], correct: "(00110111)₂", explanation: "1's complement of 11001001 = 00110110. Add 1 → 00110111." }, { id: 49, text: "Considering 2's complement representation for negative numbers –128 will be stored into an 8-bit memory space as:", options: ["11111111", "10000000", "11111110", "10000001"], correct: "10000000", explanation: "In 8-bit 2's complement, range is -128 to +127. -128 is represented as 10000000." }, { id: 50, text: "In octal number system the different symbols used are.", options: ["8", "2", "16", "4"], correct: "8", explanation: "Octal system uses digits 0 to 7 → total 8 symbols." }, { id: 51, text: "The octal representation of 195.25 is", options: ["(303.20)₈", "(303.02)₈", "(313.120)₈", "(323.20)₈"], correct: "(303.20)₈", explanation: "195 decimal: 195 ÷ 8 = 24 rem 3, 24 ÷ 8 = 3 rem 0, 3 ÷ 8 = 0 rem 3 → 303₈. 0.25 × 8 = 2.0 → .20₈ → (303.20)₈." }, { id: 52, text: "The 15's complement of the hexadecimal number (B0210)₁₆ is.", options: ["(4FDEF)₁₆", "(4FDF0)₁₆", "(50EF0)₁₆", "(40DE0)₁₆"], correct: "(4FDF0)₁₆", explanation: "15's complement: subtract each digit from F (15). B(11)→4, 0→F, 2→D, 1→E, 0→F → 4FDF0₁₆." }, { id: 53, text: "How many Gigabyte is equal to 1 Petabyte.", options: ["256", "512", "1024", "1024×1024"], correct: "1024×1024", explanation: "1 PB = 1024 TB, 1 TB = 1024 GB → 1 PB = 1024×1024 GB = 1,048,576 GB." }, { id: 54, text: "The interface between an analog signal and a digital processor is.", options: ["D/A converter", "A/D converter", "Modulator", "Remodulator"], correct: "A/D converter", explanation: "Analog-to-Digital Converter (ADC) converts analog signals to digital for processing." }, { id: 55, text: "The speech signal is obtained after.", options: ["Analog to digital conversion", "Digital to analog conversion", "Modulation", "Quantization"], correct: "Digital to analog conversion", explanation: "Speech output from speakers requires DAC (Digital to Analog Conversion)." }, { id: 56, text: "Telegraph signals are example of", options: ["Digital signals", "Analog signals", "Impulse signals", "Pulse train"], correct: "Digital signals", explanation: "Telegraph uses discrete ON/OFF (Morse code) → digital signals." }, { id: 57, text: "As compared to the analog systems, the digital processing of signals allow: 1. Programmable operations 2. Flexibility in system design 3. Cheaper systems 4. More reliability", options: ["1,2 and 3 are correct", "1 and 2 are correct", "1,2 and 4 are correct", "All the four are correct"], correct: "All the four are correct", explanation: "Digital systems offer programmable operations, design flexibility, cost-effectiveness, and high reliability." }, { id: 58, text: "DTFT is the representation of.", options: ["Periodic Discrete Time Signals", "Aperiodic Discrete Time Signals", "Aperiodic Continuous Signals", "Periodic Continuous Signals"], correct: "Aperiodic Discrete Time Signals", explanation: "DTFT (Discrete-Time Fourier Transform) represents aperiodic discrete-time signals." }, { id: 59, text: "Which of the following is the characteristic of the power signal?", options: ["Power signal is infinite", "Power signals are time-limited", "Aperiodic signals are power signals", "None of the above"], correct: "None of the above", explanation: "Power signals have finite average power and infinite energy; not all aperiodic are power signals." }, { id: 60, text: "The hardware unit which is used to monitor computer processing is?", options: ["ROM", "Mouse", "Dot Matrix printer", "Console"], correct: "Console", explanation: "Console (monitor + keyboard) allows monitoring and controlling computer processing." }, { id: 61, text: "Which of the following data is put into a formula to produce commonly accepted results?", options: ["Raw", "Processed", "Synchronized", "All of the mentioned"], correct: "Raw", explanation: "Raw data is input into formulas to generate processed results/information." }, { id: 62, text: "Which of the following is equal to a gigabyte?", options: ["1024 bytes", "512 GB", "1024 megabytes", "1024 bits"], correct: "1024 megabytes", explanation: "1 GB = 1024 MB = 1024 × 1024 KB = 1024 × 1024 × 1024 bytes." }, { id: 63, text: "Which type of program acts as an intermediary between a user of a computer and the computer hardware?", options: ["Operating system", "User thread", "Super user thread", "Application program"], correct: "Operating system", explanation: "Operating system manages hardware and provides interface between user and hardware." }, { id: 64, text: "Which of the following values is the correct value of the binary code 1011 and 1111?", options: ["11 and 14", "12 and 15", "11 and 15", "12 and 14"], correct: "11 and 15", explanation: "1011₂ = 8+2+1 = 11; 1111₂ = 8+4+2+1 = 15." }, { id: 65, text: "Which of the following is not one of the internal components of a CPU?", options: ["Control sequencer", "M-D-R", "M-A-R", "Floppy disk"], correct: "Floppy disk", explanation: "Floppy disk is a storage device, not an internal CPU component. MAR, MDR, Control sequencer are inside CPU." }, { id: 66, text: "What is the speed of computer measured in?", options: ["Nanoseconds", "Kilo-seconds", "Gigahertz", "Megabytes"], correct: "Gigahertz", explanation: "CPU speed (clock rate) is measured in Hertz (GHz, MHz)." }, { id: 67, text: "Pentium is related with which part of the computer.", options: ["DVD", "Hard disk", "Microprocessor", "Mouse"], correct: "Microprocessor", explanation: "Pentium is a brand of x86 microprocessors (CPU) by Intel." }, { id: 68, text: "What difference does the 5th generation computer have from other generation computer?", options: ["Technological Advancement", "Object oriented programming", "Scientific Code", "All of the above"], correct: "All of the above", explanation: "5th gen introduced AI, parallel processing, OOP, and advanced tech." }, { id: 69, text: "When a key is pressed on keyboard, which standard is used for converting the keystroke into the corresponding bits.", options: ["ANSI", "ASCII", "EBCDIC", "ISO"], correct: "ASCII", explanation: "ASCII (American Standard Code for Information Interchange) is most common for keyboard encoding." }, { id: 70, text: "Which device used as the standard pointing device in a graphical user environment?", options: ["keyboard", "mouse", "joystick", "trackball"], correct: "mouse", explanation: "Mouse is the standard pointing device for GUI environments like Windows, macOS." }, { id: 71, text: "The section of the CPU that is responsible for performing mathematical operations.", options: ["Memory", "Register Unit", "Control Unit", "ALU"], correct: "ALU", explanation: "ALU (Arithmetic Logic Unit) performs arithmetic and logical operations." }, { id: 72, text: "A half byte is called a", options: ["Byte", "Nibble", "Bit", "Word size"], correct: "Nibble", explanation: "1 byte = 8 bits, half byte = 4 bits = 1 nibble." } ]; let answersState = {}; function initState() { for (let q of questions) { if (!answersState[q.id]) { answersState[q.id] = { selected: null, showExplanation: false }; } } } initState(); function getStats() { let attempted = 0, correct = 0; for (let q of questions) { const ans = answersState[q.id].selected; if (ans && ans !== "") { attempted++; if (ans === q.correct) correct++; } } return { attempted, correct }; } function updateUIStats() { const { attempted, correct } = getStats(); document.getElementById('attemptCount').innerHTML = `📋 Attempted: ${attempted} / 27`; document.getElementById('scoreValue').innerHTML = `⭐ Score: ${correct}`; } function renderQuestions() { const container = document.getElementById('questionsContainer'); if (!container) return; let html = ''; for (let q of questions) { const state = answersState[q.id]; const selectedVal = state.selected || ""; const showExp = state.showExplanation; let feedbackText = "", feedbackClass = "neutral"; if (selectedVal !== "") { if (selectedVal === q.correct) { feedbackText = "✓ Correct"; feedbackClass = "correct"; } else { feedbackText = `✗ Incorrect · Correct: ${q.correct}`; feedbackClass = "wrong"; } } else { feedbackText = "⚡ Not attempted yet"; feedbackClass = "neutral"; } let optionsHtml = ''; q.options.forEach(opt => { const escapedOpt = opt.replace(/'/g, "\\'").replace(/"/g, '"'); const radioId = `q${q.id}_opt_${opt.replace(/\s/g, '').replace(/[\(\)]/g, '')}`; const checkedAttr = (selectedVal === opt) ? 'checked' : ''; optionsHtml += ` ${opt} `; }); const explanationClass = showExp ? "show" : ""; html += ` Q${q.id}. ${q.text} ${optionsHtml} ${feedbackText} ${showExp ? "Hide Explanation" : "📖 Show Explanation"} 💡 Explanation: ${q.explanation} `; } container.innerHTML = html; updateUIStats(); document.querySelectorAll('.toggle-explanation').forEach(btn => { const qid = parseInt(btn.getAttribute('data-id')); btn.removeEventListener('click', (e) => {}); btn.addEventListener('click', (e) => { e.stopPropagation(); toggleExplanation(qid); }); }); } window.selectAnswer = function(qid, selectedValue) { answersState[qid].selected = selectedValue; renderQuestions(); saveToLocalStorage(); }; function toggleExplanation(qid) { answersState[qid].showExplanation = !answersState[qid].showExplanation; renderQuestions(); saveToLocalStorage(); } function resetQuiz() { for (let q of questions) { answersState[q.id] = { selected: null, showExplanation: false }; } renderQuestions(); saveToLocalStorage(); } function saveToLocalStorage() { const toSave = {}; for (let q of questions) { toSave[q.id] = { selected: answersState[q.id].selected, showExplanation: answersState[q.id].showExplanation }; } localStorage.setItem('quizMCQ_set3', JSON.stringify(toSave)); } function loadFromLocalStorage() { const saved = localStorage.getItem('quizMCQ_set3'); if (saved) { try { const parsed = JSON.parse(saved); for (let id in parsed) { const qid = parseInt(id); if (answersState[qid]) { answersState[qid].selected = parsed[id].selected || null; answersState[qid].showExplanation = parsed[id].showExplanation || false; } } renderQuestions(); } catch(e) {} } else { renderQuestions(); } } document.getElementById('resetAll')?.addEventListener('click', () => { resetQuiz(); }); loadFromLocalStorage();