Nepal SEE Computer Science cheat sheet
Nepal SEE Computer Science · Keep the key ideas within reach.
Nepal SEE Computer Science
Number systems: binary base 2, octal base 8, decimal base 10, hexadecimal base 16; each hex digit maps to exactly 4 binary bits, each octal digit to 3 bits.
Decimal to binary: divide repeatedly by 2, record remainders, read remainders bottom-to-top; e.g. 45 = 101101.
Binary to octal: group bits in threes from the right; binary to hex: group in fours from the right, pad the leftmost group with zeros.
Two's complement of an n-bit number = 2^n − value; flip all bits and add 1. Range of signed n-bit values is −2^(n−1) to 2^(n−1) − 1.
1 KB = 1024 bytes, 1 MB = 1024 KB, 1 GB = 1024 MB, 1 TB = 1024 GB; a nibble is 4 bits and a byte is 8 bits.
Logic gates: AND gives 1 only if all inputs are 1; OR gives 1 if any input is 1; NOT inverts; NAND and NOR are negations of AND and OR; XOR gives 1 for odd numbers of 1 inputs.
Universal gates are NAND and NOR: any logic circuit can be built using only one of these gate types.
Truth table rows = 2^n where n is the number of input variables; a half adder has two inputs (A, B) and outputs Sum = A XOR B, Carry = A AND B.
Nepal SEE Computer Science
Hardware is the physical part of a computer; software is the set of programs and instructions. Firmware (BIOS) is stored in ROM and sits between hardware and software.
Input devices: keyboard, mouse, scanner, microphone, joystick, light pen, OMR, OCR, barcode reader, touch screen, webcam.
Output devices: monitor (soft copy), printer (hard copy), plotter, speaker, projector. Impact printers (dot matrix, daisy wheel) strike the paper; non-impact printers (inkjet, laser) do not.
Primary memory: RAM (volatile, read/write) and ROM (non-volatile: PROM, EPROM, EEPROM). Secondary storage: hard disk, SSD, pen drive, CD/DVD, magnetic tape.
CPU has three units: ALU (arithmetic and logic), Control Unit (directs operations), and registers (accumulator, program counter, instruction register).
System software includes the operating system, language translators (compiler, interpreter, assembler) and utility programs; application software includes word processors, spreadsheets and browsers.
A compiler translates the whole program at once and reports all errors together; an interpreter translates line by line and stops at the first error.
Computer generations: first used vacuum tubes, second transistors, third integrated circuits, fourth microprocessors, fifth artificial intelligence; ENIAC was a first-generation machine.
Nepal SEE Computer Science
Operating system functions: process management, memory management, file management, device management, and providing a user interface; examples are Windows, Linux, macOS, Android.
Number of hosts in a network with n host bits = 2^n − 2 (network and broadcast addresses excluded); a /24 subnet has 254 usable hosts.
Network topologies: star uses a central hub/switch, ring connects each node to two neighbours, bus shares one backbone cable, mesh links every node to every other.
LAN covers a room or building, MAN a city, WAN a country or the world; the Internet is the largest WAN.
IP addresses: IPv4 is 32 bits in four dotted decimal octets; IPv6 is 128 bits. Private ranges include 10.0.0.0/8 and 192.168.0.0/16.
Protocols: HTTP/HTTPS for web pages, FTP for file transfer, SMTP for sending mail, POP3/IMAP for receiving mail, TCP (reliable) and UDP (fast, connectionless).
Cyber threats: virus attaches to files, worm self-replicates across networks, Trojan disguises as useful software, phishing tricks users into revealing credentials; antivirus, firewall and strong passwords are countermeasures.
E-commerce models: B2B, B2C, C2C, and B2G; e-governance delivers government services online.
Nepal SEE Computer Science
QBasic statements: CLS clears the screen, REM or apostrophe marks a comment, INPUT takes user data, PRINT displays output, LET assigns a value, END terminates the program.
Variable naming: must begin with a letter, may contain letters, digits and a period, cannot contain spaces, and must not be a reserved keyword; variable names are case-insensitive.
Numeric types: INTEGER (whole numbers), LONG INTEGER, SINGLE and DOUBLE (decimal precision), with type-declaration suffixes % & ! #.
String functions: LEN(s) length, LEFT$(s,n), RIGHT$(s,n), MID$(s,start,length), UCASE$, LCASE$, LTRIM$, RTRIM$, STR$, VAL, CHR$, ASC.
Arithmetic operators in precedence order: exponentiation ^, negation −, multiplication and division *, /, integer division , MOD, then addition and subtraction.
Relational operators = <> < > <= >= yield true or false; logical operators NOT, AND, OR are used to combine conditions.
FOR...NEXT loops a known number of times; DO...LOOP WHILE/UNTIL loops on a condition; a WHILE...WEND loop tests the condition before each iteration.
IF...THEN...ELSE selects between two paths; nested IF handles multiple conditions; SELECT CASE compares one expression against several case values.
Nepal SEE Computer Science
HTML tags: , , , <body>; headings <h1> to <h6>; paragraph <p>; line break <br>; horizontal rule <hr>.</p>
Text formatting tags: bold, italic, underline, strikethrough, subscript, superscript, for colour and size.
Lists:
- unordered (bulleted),
- list item, definition list with term and description.
- ordered (numbered),
Links and images: text creates a hyperlink; embeds an image; the alt attribute gives alternative text.
Tables:
,
row, header cell, data cell, with attributes border, cellpadding, cellspacing, colspan and rowspan. Forms:
, ,Frames and multimedia: embeds another page; or inserts audio/video; deprecated tags such as and are not standard.
HTML is a markup language (not a programming language) and is case-insensitive; CSS controls presentation and JavaScript adds behaviour.
Nepal SEE Computer Science
Database objects: table (stores records), query (retrieves data), form (data entry interface), report (printable output), macro and module.
Field data types in MS Access: Text, Memo, Number, Date/Time, Currency, AutoNumber, Yes/No, OLE Object, Hyperlink, Lookup Wizard.
A primary key uniquely identifies each record, cannot be null and cannot repeat; a foreign key in one table refers to the primary key of another table.
SQL clauses: SELECT columns FROM table WHERE condition GROUP BY column HAVING condition ORDER BY column ASC/DESC.
SQL data actions: INSERT INTO table VALUES (...), UPDATE table SET column=value WHERE condition, DELETE FROM table WHERE condition.
Aggregate functions: COUNT counts rows, SUM totals numeric values, AVG averages, MAX and MIN return extremes; COUNT(*) counts all rows including nulls.
Relationships: one-to-one, one-to-many (most common), and many-to-many (implemented with a junction table).
Wildcards in queries: * matches any number of characters, ? matches a single character; criteria for text are enclosed in quotes, dates in # symbols.