Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Computer science class 12, Study notes of Computer science

Resivion notes for class 12 computer science.

Typology: Study notes

2020/2021

Uploaded on 06/03/2021

bhavya-sharma-3
bhavya-sharma-3 🇮🇳

1 document

1 / 35

Toggle sidebar

Related documents


Partial preview of the text

Download Computer science class 12 and more Study notes Computer science in PDF only on Docsity! Unit-I : Programming And Computational Thinking CHAPTER-1 REvision of THE bAsiCs of PyTHon Topic -1 python Basics Revision Notes • Python was created by Guido van Rossum in late 1980 at National Research Institute in the Netherland. Python got its name from a BBC comedy series – “Monty Python’s Flying Circus”. Some qualities of Python based on the programming fundamentals are given below: • Interactive Mode: Interactive mode, as the name suggests, allows us to interact with OS. • Script Mode: In script mode, we type Python program in a file and then use interpreter to execute the content of the file. • Indentation: Blocks of code are denoted by line indentation, which is rigidly enforced. • Comments: A hash sign (#) that is not inside a string literal begins a single line comment. We can use triple quoted string for giving multiple-line comments. • Variables: A variable in Python is defined through assignment. There is no concept of declaring a variable outside of that assignment. Value of variable can be manipulated during program run. • Dynamic Typing: In Python, while the value that a variable points to has a type, the variable itself has no strict type in its definition. • Static Typing : In Static typing, a data type is attached with a variable when it is defined first and it is fixed. • Multiple Assignment: Python allows you to assign a single value to several variables simultaneously. For example: a = b = c = 1 a, b, c = 1, 2, “john” • Token : The smallest individual unit in a program is known as a Token or a lexical unit. • Identifiers : An identifier is a name used to identify a variable, function, class, module, or other object. An identifier starts with a letter A to Z or a to z or an underscore ( _ ) followed by zero or more letters, underscores, and digits (0 to 9). • Python does not allow punctuation characters such as @, $, and % within identifiers. Python is a case sensitive programming language. Thus, Value and value are two different identifiers in Python. Here are following identifiers naming convention for Python: Ø Class names start with an uppercase letter and all other identifiers with a lowercase letter. Ø Starting an identifier with a single leading underscore indicates by convention that the identifier is meant to be private. Ø Starting an identifier with two leading underscores indicates a strongly private identifier. Ø If the identifier also ends with two trailing underscores, the identifier is a language-defined special name. • Reserved Words(Keywords) : The following list shows the reserved words in Python Python Keyword List and del from whilenot as elif global withor assert else if yieldpass break except import print class except in raise continue finally is return def for lambda try 2 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII These reserved words may not be used as constant or variable or any other identifier names. All the Python key- words contain lowercase letters only. • Literal/ Values : Literals (Often referred to as constant value) are data items that have a fixed value. Python allows several kind of literals. String literals, Numeric literals, Boolean literals, special literal None, literal Collections • Data Types : Data type is a set of values and the allowable operations on those values. Python has a great set of use- ful data types. Python’s data types are built in the core of the language. They are easy to use and straight forward. DATA TYPES NUMBERS SEQUENCES SETS MAPS int long float complex string list tuple dictionary • Numbers can be either integers or floating point numbers. • A sequence is an ordered collection of items, indexed by integers starting from 0. Sequences can be grouped into strings, tuples and lists. Ø Strings are lines of text that can contain any character. They can be declared with single or double quotes. Ø Lists are used to group other data. They are similar to arrays. Ø A tuple consists of a number of values separated by commas. • A set is an unordered collection with no duplicate items. • A dictionary is an unordered set of key value pairs where the keys are unique. • Operator : Operators are special symbols which perform some computation. Operators and operands form an expression. Python operators can be classified as given below : Python operator types Operators Arithmetic operators Relational operators Logical operators Assignment operators Bitwise operators Membership operators + – / % ** // * < > <= >= !=or<> == or and not = += – = *= /= %= //= **= & | ^ - << >> in not in • Expressions : An expression in Python is any valid combination of operators, literals and variables. Topic-2 conditional Statements Revision Notes • A conditional is a statement which is executed, on the basis of result of a condition. • If conditional in Python have the following forms. (a) Plain if Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 5 print(a) a-=1 Output 3 2 1 a. An Infinite Loop Be careful while using a while loop. Because if you forget to increment the counter variable in Python, or write flawed logic, the condition may never become false. In such a case, the loop will run infinitely, and the conditions after the loop will starve. To stop execution, press Ctrl+C. However, an infinite loop may actually be useful. b. The else statement for while loop A while loop may have an else statement after it. When the condition becomes false, the block under the else statement is executed. However, it doesn’t execute if you break out of the loop or if an exception is raised. e.g. >>> a=3 >>> while(a>0): print(a) a-=1 else: print("Reached 0") Output 3 2 1 Reached 0 In the following code, we put a break statement in the body of the while loop for a==1. So, when that happens, the statement in the else block is not executed. e.g. >>> a=3 >>> while(a>0): print(a) a-=1 if(a==1): break; else: print("Reached 0") Output 3 2 c. Single Statement while Like an if statement, if we have only one statement in while loop’s body, we can write it all in one line. e.g. >>> a=3 >>> while a>0: print(a); a-=1; Output 3 2 1 You can see that there were two statements in while loop’s body, but we used semicolons to separate them. Without the second statement, it would form an infinite loop. 2. Python for Loop Python for loop can iterate over a sequence of items. The structure of a for loop in Python is different than that in C++ or Java. That is, for(int i=0;i<n;i++) won’t work here. In Python, we use the ‘in’ keyword. 6 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII for loop Item for sequence Block of Code >>> a = 1 >>> for a in range(3): print(a) Output 1 2 If we wanted to print 1 to 3, we could write the following code. >>> for a in range(3): print(a+1) Output 1 2 3 a. The range() function This function yields a sequence of numbers. When called with one argument, say n, it creates a sequence of numbers from 0 to n-1. >>> list(range(10)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] We use the list function to convert the range object into a list object. Calling it with two arguments creates a se- quence of numbers from the first to the second. >>> list(range(2,7)) [2, 3, 4, 5, 6] You can also pass three arguments. The third argument is the interval. >>> list(range(2,12,2)) [2, 4, 6, 8, 10] Remember, the interval can also be negative. >>> list(range(12,2,-2)) [12, 10, 8, 6, 4] • Jump Statements Python offers two jump statements break and continue-to be used within loops to jump out of loop iterations. • break statement A break statement terminates the very loop it lies within. It skips the rest of the loop and jump over to the statement following the loop. • continue statement Unlike break statement, the continue statement forces the next iteration of the loop to take place, skipping any code in between. • Nested Loops A loop may contain another loop in its body. This form of a loop, is called nested loop. But in a nested loop, the inner loop must terminate before the outer loop. e.g. for i in range(1,6): for j in range (1,i) print "*", print Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 7 Topic-4 idea of debugging Revision Notes • An error or a bug is anything in the code that prevents a program from compiling and running correctly. • These are three types of errors Compile Time errors occur at compile time. These are of two types : (i) Syntax errors occur when rules of a programming Language are misused. (ii) Semantics errors occur when statements are not meaningful. Run Time errors occur during the execution of a program. Logical Errors occur due to programmer’s mistaken analysis of the error. To remove logical errors is called debugging. This can be done by testing the software time again. (a) TDD – Test Driven Development (b) using print statements (c) By using a debugger such as Python debugger(pdb). Topic-5 Lists, Tuples and Dictionary Revision Notes List • A list is a standard data type of Python that can store a sequence of values belonging to any type. • The lists are depicted through square brackets. • These are mutable (i.e. modifiable), you can change elements of a list in place. • Lists store a reference at each index. • We can index, slice and access individual list elements. • len (L) returns the number of items in the list L membership operators in and not in can be used with list. • To join two lists use `+’ (concatenation) operator. • L [start: stop] create a list slice with starting index as start till stop as stopping index but excluding stop. • List manipulation functions are append(), insert(), extend(),sort(), remove(), reverse() and pop(). Tuples • Tuples are immutable Python sequences, i.e. you cannot change elements of a tuple in place. • Tuples items are indexed. • Tuples store a reference at each index. • Tuples can be indexed sliced and its individual items can be indexed. • len (T) returns count of tuple elements. • Tuple manipulation functions are: len(), max(), min(), cmp() and tuple(). Dictionaries • Dictionaries in Python are a collection of some key-value pairs. • These are mutable and unordered collection with elements in the form of a key : value pairs that associate keys to values. • The key of dictionaries are immutable type and unique. • To manipulate dictionaries functions are : len(). clear(), has_key(),items(), keys(), values(), update(), and cmp(). • The membership operators in and not in work with dictionary keys only. 10 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII Ø Keyword arguments are related to the function calls. When you use keyword arguments in a function call, the caller identifies the arguments by the parameter name. Ø A default argument is an argument that assumes a default value, if a value is not provided in the function call for that argument. Ø The statement return [expression] exits a function, optionally passing back an expression to the caller. A return state- ment with no arguments is the same as return None. Ø All variables in a program may not be accessible at all locations in that program. This depends on where you have declared a variable. Ø The scope of a variable determines the portion of the program where you can access a particular identifier. There are two basic scopes of variables in Python : 1. Global variables 2. Local variables Ø Variables that are defined inside a function body have a local scope, and those defined outside have a global Functions Built-in Modules defined Ø Built-in functions: Built-in functions are the functions that are built into Python and can be accessed by a programmer. Ø Examples of Some Built-in Functions (i) fabs(): It returns the absolute value of a number. (ii) factorial(): This method finds the factorial of a positive integer. (iii) random(): It produces an integer between the limit arguments. (iv) today(): This method returns the current date and time. (v) search(): This function searches the pattern inside the string. (vi) capitalize(): It returns the copy of string in capital letters, Ø String Functions (i) Partition(): It splits the string at the first occurrence of the given argument and returns a 3-tuple. (ii) Join(): It takes a list of string and joins them as a regular string. (iii) Split(): It splits the whole string in the items with separator as a delimeter. Ø Modules: A module is a file containing Python definitions and statements. We need to import modules to use any containing part before separator, separator parameter and part after the separator if the separator parameter is found in the string of its function or variable in our code. Ø User-Defined Functions: We can also create our own functions. Parameters are the values provided in the parenthe- sis in the function header when we define the function. Arguments are the values provided in function call/invoke statement. Ø Function Arguments: You can call a function by using the following types of formal arguments: • Required arguments • Keyword arguments • Default arguments • Variable-length arguments qq CHAPTER-3 filE HAndling Revision Notes Ø Files are used to store huge collection of data and records permanently. Ø File can be stored in two ways: • Text file store information in ASCII or unicode characters. In text file, each line of text is terminated, (delimited) with a special character known as EOL (End of line) character. Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 11 • Binary file are just a file that contains information in the same format in which the information is held in memory, i.e. the file contain that is returned to you is raw. In binary file, there is no delimiter for a line. Ø Access modes specify the type of operations to be performed on the opened file. Ø read(), readline() and readlines() methods are available for reading data from the file. Ø write() and writelines() are used for writing data in the file. Ø pickle module is used in serialization of data. This allows us to store data in binary form in the file. Ø dump and load functions are used to write and read data from file. Ø The open() function creates a file object which would be utilized to call other methods associated with it. Syntax : file object=open(filename[ access_mode],[ buffering]) Here is the parameter details: Ø filename: The file_name argument is a string value that contains the name of the file that you want to access. Ø access_mode: The access_mode determines the mode in which the file has to be opened i.e., read, write, append, etc. A complete list of possible values is given below in the table. This is optional parameter and the default file access mode is read (r). File Opening Modes Modes description r Opens a file for reading only. The file pointer is placed at the beginning of the file. This is the default mode. rb Opens a file for reading only in binary format. The file pointer is placed at the beginning of the file. This is the default mode. r+ Opens a file for both reading and writing. The file pointer will be at the beginning of the file. rb+ Opens a file for both reading and writing in binary format. The file pointer will be at the begin- ning of the file. w Opens a file for writing only. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. wb Opens a file for writing only in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for writing. w+ Opens a file for both writing and reading. Overwrites the file if the file exists. If the file does not exist, creates a new file for reading and writing. wb+ Opens a file for both writing and reading in binary format. Overwrites the file if the file exists. If the file does not exist, creates a new file for reading and writing. a Opens a file for appending. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. ab Opens a file for appending in binary format. The file pointer is at the end of the file if the file exists. That is, the file is in the append mode. If the file does not exist, it creates a new file for writing. a+ Opens a file for both appending and reading. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for read- ing and writing. ab+ Opens a file for both appending and reading in binary format. The file pointer is at the end of the file if the file exists. The file opens in the append mode. If the file does not exist, it creates a new file for reading and writing. Ø buffering: If the buffering value is set to 0, no buffering will take place. If the buffering value is 1, line buffering will be performed while accessing a file. If you specify the buffering value as an integer greater than 1, then buffering action will be performed with the indicated buffer size. If negative, the buffer size is the system default (default behaviour). Ø The file object attributes: Once a file is opened and you have one file object, you can get various information related to that file. Here is a list of all attributes related to file object: 12 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII Attributes description file.closed Returns true if file is closed, false otherwise. file.mode Returns access mode with which file was opened. file.name Returns name of the file. file.softspace Returns false if space explicitly required with print, true otherwise. Ø file () : This is same as open (). Ø Random Access : There are two functions that allow us to access a file in a non-sequential or random mode. • tell() : It tells us the position of the file pointer. • seek() : It moves the file pointer to the position specified. Ø Functions (a) read () : syntax: <file handle>.read([n]) It reads at most n bytes and returns the read bytes as string. If `n’ is not specified it reads the entire file. (b) readline () : syntax: <file handle>.readline ([n]) It reads a line of input, and returns it in the form of a string. (c) readlines () : syntax: <file handle>.readlines () It reads all lines and returns them in a list. (d) write () : syntax: <filehandle>.write (str1) It writes string str1 to file referenced by <file handle> (e) writelines () : syntax: <file handle>.writelines (L). It writes all strings in list L as lines to file referenced by <file handle> (f) flush () : syntax: <file object>.flush() It forces the writing of data on disc that is still pending in output buffer. (g) Importing sys module lets you read/write from the standard input/output device using sys.stdin.read () and sys.stdout.write(). (h) split () function splits a line in columns. It returns columns as items of a list. (i) rename () function is used to rename a file existing on the disk. syntax: os.remane(<current_file_name>,<new_file_name>) (j) remove () function is used to delete a file existing on the disk. syntax: os.remove(<file_name>) (k) os.path.join () is used to assemble directory names into a path. (l) os.path.split () is used to splits off the last path component. (m) os.path.splittext() is used to split file name into primary name and extension. (n) os.path.exists () function check if a path actually exists. qq CHAPTER-4 using PyTHon libRARiEs Revision Notes Ø Python has packages for directories and modules for files. Ø As our application program grows larger in size, we place similar modules in one package and different modules in different packages. Ø A python package can have subpackages and modules. Ø A directory must contain a file named__init__.py in order for and Python to consider it as a package. Ø Modules can be imported using dot operator. Ø dir( ) is used to find out names that are defined inside a module. Ø The names that begin with an __(underscore) are default Python attributes associated with the module. Ø __name__ attribute contains the name of the module. Ø Interpreter looks for a package or module in a list of directories defined in sys.path. Ø While using the import syntax for packages the last attribute must be a subpackage as a module, it should not be any function or class name. Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 15 Ø Pie ( ) is used to plot a pie chart. Labels is an argument that is a list to define the parts of a pie chart. Ø grid ( ) – is used to show grid in the chart. Ø subplot ( ) – is used to create more than one plot on the same screen, it takes three arguments : (1) nrows :– number of rows that the figure must have. (2) ncols : number of columns that the figure must have. (3) Plot-number : which refers to the number of figure on that screen. Ø savefig ( ) is used to save the charts to a file. Ø xticks () is used to create names on the x-axis for bar graph. Ø yticks () is used to create names on the y-axis for horizontal bar graphs. qq CHAPTER-8 dATA sTRuCTuREs Topic-1 Data Structures and Lists Revision Notes Ø A data structure is a named group of data of different data types which can be processed as a single unit. Static Structure Non-linear Dynamic Data Structure Array Linear Stack TreeQueue GraphLinked list Union Ø Queues are FIFO lists where insertion take place at REAR end and deletion take place at FRONT end. Ø Stacks are LIFO lists where insertion and deletions take place at one end referred as TOP. Ø Some important sorting algorithms are Bubble sort, Insertion sort and selection sort. Ø Some applications of stacks are : • Expression evaluation • String Reversal • Memory management Ø Circular queues are the queues postfix conversion implemented in circular form rather than a straight line. Ø Array : A set of contiguous collection of similar data type. In contrast Python lists are actually arrays of vari- able length and have elements of different data types. Ø Sequential allocation of memory: Elements stored in object or neighbour of their declaration. Ø Traversal : To move in a list in a sequential manner starting from first to last element. Ø Raw data are raw facts. Ø Data item represent single unit of values of certain type. Ø Simple data structures are normally built from primitive data types e.g. arrays or linear lists. Ø Compound data structures are formed by combining simple data structures. Ø Linear data structures are arrangement of elements to from a sequence e.g. stack, queue and linked list. Ø Non-linear data structure are multilevel data structures e.g Tree and graph. Ø Operations on Data Structures (1) Insertion means addition of a new data element in a data structure. (2) Deletion means removal a data element from a data structure. (3) Searching means to look for a specified data element in a data structure. 16 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII (4) Traversal refers to one-by-one processing of all the data elements. (5) Sorting means arranging all the data elements of a data structure in a specified order. (6) Merging means combining two similar, data structure to from a new data structure of same type Ø Sequential Allocation : The elements of a sequence data type are allotted memory sequentially. Ø getsizeof() function of sys module is used to check for the memory size of something. Topic-2 Stacks Revision Notes Ø A stack is a linear structure implemented in LIFO manner. Ø Insertions and deletions both occur only at one end i.e. TOP. Ø Removing data is called POP. Ø Adding data is called PUSH. Ø It is a dynamic data structure i.e. it can grow and shrink. Ø Peek refers to inspecting the value at stack’s top without removing it. Ø Overflow refers to when one tries to push an item in stack that is full. Ø Underflow refers to when one tries to POP an item from an empty stack. Ø Postfix notation refers to when operator is placed after its operands. Topic-3 Queues Revision Notes Ø Queues are linear data structures implemented in FIFO (First In First Out) order. Ø Insertions take place at the “rear” end and deletions take place at the “Front” end of the queue. Ø Deques or double-ended queues are the refined queues in which elements can be removed or added at either end but not in the middle. Ø Input restricted deque is one which allows insertions at only one end but deletions are allowed at both ends. Ø Output restricted queues is one which allows deletions at only one end of the list but insertions are allowed at both ends. Ø Enqueue – Insertion of an element in the queue. Ø Dequeue – Deletion of an element in the queue. qq Unit-II : Computer Networks CHAPTER-9 nETwoRks: sTRuCTuRE, Tools And APPliCATions Topic-1 Structure of a Network Revision Notes 1. Types of Networks (a) LAN (Local Area Network) : A network spanning inside a small area generally a building is termed as Local Area Network. It usually covers an organization’s office, schools, colleges or universities. It may consist up to few hundred systems. In LAN, sharing of resources between end users becomes easy. It operates on private IP address. It uses Ethernet as Token – Ring technology. LAN can be wired, wireless or in both forms at once. Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 17 (b) WAN (Wide Area Network) : It covers a wide area that may span across many cities and even a whole country. Telecommunication networks are example of WAN. WAN uses expensive equipment as they are equipped with high speed backbone. 2. New Technologies Internet : It is network of networks inter connected to each other like web. It connects all WANs and may have connection to LANs. It uses TCP/IP protocol suites and IP as its addressing protocol. Internet enables, its users to share and access information world wide using WWW, FTP and other services. Like e-mail, fund transfer etc. (a) Cloud : Refers to a shared pool of configurable computing resources like networks, servers, network storage, application and services that can be provisioned. Some basic types of cloud delivery models are available as given below., (i) Public Cloud : Such clouds offer their services to anyone in general public and maintain large data centres and computing hardware. (ii) Private cloud : Such clouds are set up by an organization exclusively for their internal use, sometime because of security reasons and some times because of various regulations. For this, organization may set up cloud at their own data centres or use a hosted private cloud services. In a hosted private cloud service, the vendor sets aside certain computing resources that can be used by only one customer. (iii) Hybrid cloud : The infra-structure designed with the combination of public, private or community is called hybrid cloud. (b) IoT (Internet of Things) : It is a network of things (computing devices, mechanical devices and digital machines, any object of our daily life, an animal and a person). All these are provided with UIDs (Unique Identifiers) and the ability to transfer data over a network without requiring human to – human or human – to – computer interaction. (c) Wired Networks : It refers to a setup where physical cables are used to transfer data between devices and computer systems. e.g. Ethernet, Arpanet, Internet, Extranet. (d) Wireless Networks : It refers to the use of infrared or radio frequency signals to share information and resources between devices. e.g. bluetooth, wifi, wi Max, VSAT etc. (e) Client, Server Model : It is a concept where the computer tasks are distributed or divided amongst the clients, who request for a service and a server, who fulfills the requests. Both client and server use different hardware. e.g. Airlines and Railway reservation systems. 3. Network Devices : Network devices are used to connect various electronic devices and computer hardwares to a network so that data can be transmitted in a fast, secured and correct way from different networks. (a) Router : It transmits data between two same protocol supporting LANs but only after strengthening the signal. It connects at least two LANs and an ISP(Internet Service Provider). It is a network layer hardware device and receives data in the form of packets. (b) Modem : A MODEM (MOdulator DEModulator) is an electronic device that enables a computer to transmit data over telephone lines. There are two types of modems namely, internal modem and external modem. (c) RJ45 Connector : The RJ-45 (Registered Jack) connectors are the plug-in devices used in the networking and telecommunication applications. They are used primarily for connecting LANs, particularly Ethernet. (d) Ethernet Card : It is a hardware device that helps in connection of nodes within a network. Ethernet cards are sometimes known as Network Interface Cards (NICs). (e) Hub : It is a hardware device used to connect several computers together. Hubs can be either active or passive. Hubs usually can support 8, 12 or 24 RJ45 parts. (f) Switch : A switch (switching hub) is a network device which is used to interconnect computers or devices in a network. It filters and forwards data packets across a network. The main difference between a hub and a switch is that hub replicates what it received on one port to all the other ports while switch replicates what it received on one port to specified port. (g) Gateway : A gateway is a device that connects dissimilar networks. (h) Repeater : A repeater is a network device that amplifies and restores signals for long distance transmission. (i) Access Point : Access Point is a station that receives and transmits data in the network. 4. Network Stack : It is a layered set of protocols which work together to provide a set of network functions. It is also known as Protocol stack. (a) Amplitude modulation : The amplitude of the carrier wave is varied in proportion to that of the message signal being transmitted. It is used to transmit information over a radio carrier wave. (b) Frequency modulation : In frequency modulation, frequency of the radio carrier is changed in line with the amplitude of the incoming signal. (c) Collision in wireless networks : In wireless networking, hidden node problem or hidden terminal problem occurs when a node is visible to a wireless access point (AP) but not to other nodes communicating with that AP. 20 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII (b) 2G (Second Generation-2G) networks (GSM, CDMAOne, D-AMPS) are the first digital cellular systems launched in the decade of 1990, offering improved sound quality, better security and higher total capacity. GSM supports circuit-switched data (CSD), allowing users to place dial-up data calls digitally, so that the network’s switching station receives actual ones and zeroes rather than the screech of an analog modem. (c) 3G (Third Generation-3G) networks (UMTS FDD and TDD, CDMA2000 1x EVDO, CDMA2000 3x, TD- SCDMA, Arib WCDMA, EDGE, IMT-2000 DECT) are newer cellular networks that have data rates of 384kbit/s and more. The UN’s International Telecommunications Union IMT-2000 standard requires stationary speeds of 2Mbps and mobile speeds of 384kbps for a “true” 3G. (d) 4G (Fourth Generation-4G) technology refers to the fourth generation of mobile phone communication standards. LTE and WiMAX are marketed as parts of this generation, even though they fall short of the actual standard. (d) Wi – Fi (Wireless Fidelity): This technology enables us to connect to the high – speed Internet or other wireless networks. It is a trademark phrase that means IEEE 802.11x Data Communication Terminologies · Concept of Channel : A data channel is the medium used to carry information or data from one point to another. · Baud : It is the unit to measure the data transmission speed. It is equivalent to bps (bits per second). · Bandwidth : The maximum volume of data that can be transferred over any communication channel at a given point of time is known as the bandwidth. In analog systems, it is measured in hertz (Hz) and in digital systems, it is measured in bits per second (bps). · Data Transfer Rate : The amount of data transferred per second by the communication channel from one point to another is known as the data transfer rate. It is measured in bits per second (bps) and bytes per second (Bps). 1 kbps = 1000 bps (bit per second) 1 kbps = 125 Bps (Byte per second) 1 mbps = 1000 kbps 1 gbps = 1000 mbps 1 tbps = 1000 gbps 1 Mbps = 125 Kbps 1 Gbps = 125 Mbps 1 Tbps = 125 Gbps · Congestion : Traffic in excess of network capacity. · FRR (Fast Retransmit and Recovery) is a congestion cantrol algorithm that make it possible to quickly recover last data packets. Topic-2 Basic Network tools Revision Notes 1. Traceroute/Tracert : Determines the path taken to a destination by sending Internet Control Message Protocol (ICMP) echo request messages to the destination with incrementally increasing Time to Live (TTL) field values. Syntax : tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout] target_name 2. Ping : It is a TCP/IP command used to trouble shoot connectivity, reachability and name resolution. Ping calculate the round trip time of the data packets route from its source to the destination and back and determines whether any packet were lost during the trip. syntax: ping [hostname] 3. ipconfig(Internet Protocol configuration) : It displays all current TCP/IP network configuration values and refreshes DHCP and DNS settings. syntax : ipconfig [/all][/renew [Adapter]][/release [adapter]] [/Plushdns][/displaydns][/registerdns] [/showclassid [Adapter]][/setclassid Adapter [class ID]] 4. nslookup (Name Server Lookup) : It is a UNIX shell command to query Internet domain name servers. In addition to looking up server information, nslookup can be used to test IP connections. 5. whois : This is used to find out who owns the domain. It can also be used to find out whether a domain name is available or has already been taken. 6. Speed test : Network speed test measures your network delay, download speed and upload speed. Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 21 Topic-3 Application layer Revision Notes 1. HTTP – Hyper Text Transfer Protocol (HTTP) is an application layer protocol for hypermedia systems. It is World Wide Web’s data communication foundation. It has following features, (a) HTTP is connectionless i.e. the client and server know each other only during the current request. Further requests are made on new connection. (b) HTTP is media independent i.e. any type of data can be sent by HTTP as long as both the client and the server know how to handle the data contents. (c) HTTP is stateless i.e. neither client nor the server can retain the information between different requests across the web pages. 2. Email : Electronic mail (E-mail) most commonly referred to as E-mail, is a method of exchanging digital message from sender to one or more recipient. E-mail system consists of three parts. (a) Mailer or mail application or mail client is an application that helps us to massage, read and compare e-mail. (b) Mail Server receives, stores and delivers the e-mail. (c) Mailbox is a folder that contains emails and information about them. Working – It works on client server model. It sends, compares a message using mailer and clicks send. The email text and attachments are uploaded to the SMTP to receiver’s mail server. The POP server of the receiver check for and received mail. Received mail is forwarded and stored in receiver’s device. 3. Secure Communication : It refers to communication between two parties without any third party knowing about it. • Encryption : It is the process of translating readable data into something that appears random and has no meaning unless you know how to decrypt. • Digital certificate are issued to individuals on making payment. These are used by organizations to verify the identities of people and organization. • SSL or Secured Socket Layer is the way a website creates a secure connection with a web browser. • SSL Certificate : The web server must have an SSL certificate to create an SSL connection. • HTTPS : Hypertext Transfer Protocol Secure combines HTTP with SSL to ensure security. 4. Network applications are the applications that either run on a network or use data stored on a network or both. These use client server architecture. • Remote Desktop allows a user to access an operating computer’s desktop using internet or another network. • Remote Login (Login is a UNIX command) that allows an authorized user to login other UNIX machines on a network. • FTP transfers files from one computer to another. It involves two processes. (a) Downloading : To obtain files from a server to a client’s workstation. (b) Uploading : To move files from a workstation to a sever. • TELNET allows workstation to access the server for an application program. The workstation then acts as a dumb terminal. • SSH (Secure Socket Shell) is a cryptographic protocol and interface. It enables two remotely connected computers to perform network communication over unsecured network. • POP : It is a protocol that is used to retrieve e-mail from a mail server. • IMAP : Internet Message Access Protocol is a protocol used for accessing and storing mail on a mail server. • Difference between POP and IMAP is that POP works with only one client connected to a mail server while IMAP can work for multiple clients of the same mail box. • VoIP : Voice over Internet Protocol is a category of hardware and software using which telephone calls can be done. Here internet is the transmission medium and voice data is sent in packets using IP. • NFC : Near Field Communication is a communication protocol that enables two devices to communicate wirelessly when kept in near proximity line about 4 cm near to each other. This does not require Internet. • SCP : Secure Copy Protocol 22 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII Know the Terms · ARPANET : Advanced Research Projects Agency Network. Landmark packet-switching network established in 1969. ARPANET was developed in the 1970s by BBN and founded by ARPA and later DARPA. It eventually evolved into the Internet. The term ARPANET was officially retired in 1990. · Backbone : Referring to the internet, a central network that provides a pathway for other networks to communicate. · Bridge : A Data Link Layer device that limits traffic between two network segments by filtering the data between them based on hardware addresses. · Broadband : A transmission system capable of carrying many channels of communication simultaneously by modulating them on one of several carrier frequencies. · Bus Topology : Linear LAN architecture in which transmissions from network stations propagate the length of the medium and are received by all other stations. · Congestion : Traffic in excess of network capacity may cause traffic jamming. · Data Link : The physical connection between two devices such as Ethernet, LocalTalk or Token Ring that is capable of carrying information in the service or networking protocols such as AppleTalk, TCP/IP orXNS. · Destination Address : Address of a network device that is receiving data. · Dot Address : Refers to the common notation for IP addresses in the form of <n.n.n.n> where each number n represents, in decimal, 1 byte of the 4-byte IP address. Also called dotted notation or four-part dotted notation. · Optical Fibre Cable : Physical medium capable of conducting modulated light transmission. Compared with other transmission optical fibre cable is more expensive, but is not susceptible to electromagnetic interference and is capable of higher data rates called as optical fibre. · Firewall : A piece of security software or hardware designed to protect web servers. They are typically used to protect sites from hacker attacks/unauthorized accesses. · Gbps : Gigabits per second. · GHz : Gigahertz. · KBPS : A unit of measure used to describe the rate of data transmission equal to 1000 bits per second. · MBPS : A unit of measure used to describe the rate of data transmission equal to one millions bits per second. · Packet : A discrete chunk of communication in a predefined format. · Server : A device that is shared by several users of a network. · Session : An on-going relationship between two computing devices involving the allocation of resources and sustained data flow. · Hybrid Cloud : The cloud service that utilizes both private and public cloud. · SaaS : Software as a Service is a software development method that provides access to software and its function remotely as a Web-based service. · PaaS : Platform as a Service is computing platform being delivered as a service. · IaaS (Infrastructure as a Service) : Computer infrastructure, such as servers, storage and network delivered as a service. · OSI (Open System Interconnection ) model service is a standard template describing a network protocol stack. · RTS : Request to send. · CTS : Clear to send. · DHCP : Dynamic Host Configuration Protocol. · DNS : Domain Name System. · Node : Any system or device connected to a network. qq Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 25 CHAPTER-12 sql CommAnds Revision Note 1. Structured Query Language (SQL) l When a user wants to get some information from a database file, he can issue a query. l A query is a user-request to retrieve data or information with a certain condition. l SQL is a query language that allows user to specify the conditions, (instead of algorithms). 2. Types of SQL commands l Data Definition Language Commands (DDL Command): All the commands used to create, modify or delete physical structure of an object like table. e.g., Create, Alter, Drop. l Data Manipulation Language Command (DML Command): All the commands used to modify contents of a table comes under this category. e.g., Insert, Delete, Update commands. l TCL command: These commands are used to control transaction of DML commands. e.g., Commit, Rollback. 3. Basic structure of an SQL query l General structure SELECT, ALL/DISTINCT, *, AS, FROM, WHERE l Comparison IN, BETWEEN, LIKE “% _” l Grouping GROUP BY, HAVING, COUNT(), SUM(), AVG(), MAX(), MIN() l Display order ORDER BY, ASC/DESC l Logical operators AND, OR, NOT 4. Constraint l Constraint is a condition applicable on a field or group of fields. l Two types of constraint: l Column constraint: Apply only to individual column. l Table constraint: Apply to group of columns. l Different constraints: Unique Constraint-Primary Key constraint. Default constraint-Check constraint. Applying Constraint Example: Create a student table with filled student id, student name, father’s name, age, class, address. CREATE TABLE student sid char (4) PRIMARY KEY, sname char (20) NOT NULL, fname char (20), age number (2) CHECK (age<20), class char (5) NOT NULL, address char (50)); 5. SELECT COMMAND The SELECT command is a query that is given to produce certain specified information from the database table. Syntax: SELECT <column-name>,[,<column-name>,......] FROM <table-name>; Example: Write a query to display the name and salary of the employee in emp table. SELECT ename, sal FROM emp; 26 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII Variations of SELECT command: (i) Selecting specific Rows........WHERE clause Syntax: SELECT <column-name> [,<column-name>.......] FROM <table-name> WHERE <condition>; Example: Display the codes, names and salary of employees who belong to ‘Manager’ category. SELECT empno, ename, sal FROM emp WHERE job=“MANAGER”; (ii) Searching for NULL (IS NULL command) The Null value in a column can be searched for in a table using IS NULL in the WHERE Clause Syntax: SELECT......<column-name>[,<column-name> y;......] FROM <table-name> WHERE <column-name> IS NULL; Example: Display the codes, names and jobs of employees whose DeptNo is Null. SELECT empno,empname, job FROM emp WHERE DeptNo IS NULL; (iii) IS NOT NULL Command Example: Display the names and jobs of those employees; whose deptNo is not Null. SELECT ename, job FROM emp WHERE deptno IS NOT NULL; (iv) Sorting Result-ORDER BY Clause The resulting column can be sorted in ascending and descending order using the ORDER BY clause. Syntax: SELECT <column-name>[,<column-name>.......] FROM <table-name> WHERE <condition> ORDER BY <column-name> Example: Display the list of employees in the descending order of employee code, who is manger. SELECT * FROM emp WHERE job=“MANAGER” ORDER BY ecode; (v) Conditions based on a range SQL provides a BETWEEN operator that defines a range of values that the column value must fall for the condition to become true. Example: Select Roll_no, name From student WHERE Roll_no BETWEEN 100 AND 103; The given command displays Roll_no and name of those students whose Roll_no lies in the range 100 to 103 (both 100 and 103 are included in the range): (vi) Conditions based on a list To specify a list of values, IN operator is used. This operator selects values that match any value in the given list. Example: SELECT * FROM student WHERE city IN (‘Delhi’, ‘Agra’, ‘Gwalior’). The above command displays all those records whose city is either Delhi or Agra or Gwalior. (vii) Conditions based on Pattern SQL provides two wild card characters that are used while comparing the strings with LIKE operator. (a) percent (%) matches any string. (b) Underscore(_) matches any one character. Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 27 Example: SELECT Roll_no, name, city FROM student WHERE Roll_no LIKE “%3”; displays those records where last digit of Roll_no is 3 and may have any number of characters in front. Example: Select Roll-no, name, city FROM student WHERE Roll_no LIKE “1_3”; displays those records whose Roll_no starts with 1 and second letter may be any letter but ends with digit 3. 6. The INSERT command The tuples are added to relation using INSERT command of SQL. Syntax: INSERT INTO <table-name>[<column list>] VALUES (<value>,<value>,<value>,.....); Example: Enter a new record in student table. INSERT INTO student (sid,sname,fname,age, class,address); VALUES("101",“Mohan”,“Pawan”,15,“8”,“Jaipur”); Output: sid sname fname age class address 101 Mohan Pawan 15 8 Jaipur 7. The DELETE command The delete command removes the tuples from the tables. This command remove the entire row from the table and not the individual field. So, no field argument is needed. Syntax: DELETE FROM <table-name> WHERE <condition>; Example: Delete all the records of employee whose salary is less than 3000. DELETE FROM emp WHERE sal<3000; l To delete all the record from the table. Syntax: DELETE FROM<table-name>; 8. The UPDATE command The UPDATE command is used to change some values in existing rows. The UPDATE command specifies the rows to be changed using the WHERE clause, and new data using the SET keyword. Example: Update the salary of employee to 5000 whose employee code is 1011. UPDATE emp SET sal=5000 WHERE empno=1011; 9. The ALTER TABLE command The ALTER command is used to change the definition of existing table. (a) It can be used to add columns to a table. Syntax (to add a column to a table): ALTER TABLE<table-name> ADD <column name> <data type> <size>; (b) To modify existing columns of a table: Syntax: ALTER TABLE <table-name> MODIFY (Column-name newdatatype (newsize)); Example: To modify column job of table emp to have new width of 30 character. ALTER TABLE emp MODIFY (job char (30)); 10. The DROP Command: The DROP command is used to drop the table from the database. For dropping a table all the tuples should be deleted first i.e., the table should be empty. Syntax: DROP TABLE <table-name> 30 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII Types of software Licenses (i) Proprietary License where the copyright stays with the produces and the user is granted the right to use the software. (ii) GNU General Public License (GPL), Which are agreements under which “open source” are usually licensed. It allows end users to change the source code too, must also be made available under a GNU GPL license. (iii) End User License Agreement (EULA) indicates the terms under which the end user may use the software. (iv) Workstation Licenses are Licenses that permit the installation of an application on a single computer. Before installing it on a different machine the software must be removed from the first machine. (v) Concurrent use Licenses permits purchase of multiple Licenses of the same software to be installed on multiple machines at the same time. (vi) Site Licenses permit the use of software on any number of computer located at a single site. (vii) Perpetual Licenses allows the software to be used indefinitely as it come without an expiry date. (viii) Non-perpetual License are leases that allow the user to use the software for a specified time limit after which a license fee needs to be paid to be able to use the software. (ix) License with Maintenance offers software assurance. (x) Creative Commons (CC) license is a public copyright license that enables free distribution of a copyrighted work. By using this license the author allows the users the right to share, use and further build upon a work that he/she has created. There are several types of creative common licenses that differs by various combinations. All CC Licenses grant the “baseline rights” such as the non-commercial distribution of the copyrighted work without modification. Type of license can be determined by selecting a combination out of the following. (a) Attribution (By)-It gives the right to copy, distribute, display and perform the work and make derivative works only after giving proper attribution to the original author (Licenser). (b) Share-alike (SA)-The derivative works can be distributed only under a license identical to the original work. (c) Non-Commercial (NC)-The duplicate work may be distributed, displayed and performed only for non-commercial purposes. (d) No Derivative Works (ND)-Only the verbtim copies of the original work may be copied, distributed and displayed. No derivatives or remixes are allowed. 5. Unlike Windows server that requires a commercial license. Apache is the most popular Web server software that enables a computer to host one or more websites, Apache is open source and free to use hence enabling Web hosting companies to offer Web hosting solutions at minimal costs. • Platforms supported by Apache-Linux, Windows and Macintosh operating system. • Server side scripting Languages- PHP, Python, Perl. • Apache Web server software is also known as “Apache HTTP Server” 6. Apache software Foundation (ASF) is an American nonprofit corporation founded to support Apache software projects. • It is a decentralised open source community. • They produce FOSS (Free and Open Source Software) under the terms of the Apache License. 7. Open Source means making design of something publicly accessible so that people can modify and share it. Open source Softwares have source code that anyone can modify, develop and distribute. 8. Open Data : The data that is freely available to everyone to use and republish according to their own requirement, without any restrictions is called open data. • Open government data is created by routing government institutions. • Open data also includes non-textual material such as maps, genomes, mathematical and scientific formulae, medical data and practice, bioscience and biodiversity. 9. Privacy : In terms of computer, privacy refers to the information shared with visiting web page, how that information is used, who that information is shared with or if that information is used to track users. Internet Privacy refers to the security level of data published via Internet. It is also known as online privacy. The risks include • Phishing : Act of stealing secure data including username, password, bank account number, PIN or credit card number. Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII [ 31 • Pharming : Directing a legitimate website visitor to a different IP address. • Spyware : An offline application that obtains data without a user’s consent and then sends it to the spyware source the next time a computers is online. • Malware : An application that damages online and offline computers through Trojans, viruses and sypware. 10. Information privacy laws have been formed to prohibit the disclosure or misuse of information about private individuals. Different countries and various laws. • The basic principles of data protection as union have adopted • The purpose of any data collection should be clearly stated. • Records about an individual must be correct and up to date data and a mechanism should be their data periodically. • The data collected should not be disclosed to other organizations unless specifically authorized and it should be deleted when the purpose of its collection is ows. • The data should be transmitted to other locations only if their is “equivalent” personal data protection. • Sensitive data should be collected only under extreme circumstances. 11. Frauds : According to oxford dictionary is “ Wrongful or criminal deception intended to result in financial or personal gain” • Internet frauds/online frauds make use of internet. Type of Internet frauds i. Internet auction Fraud and non delivery of Merchandise (i) Spam and Identity theft (ii) Credit Card Fraud (iii) Internet banking fraud. 12. Illegal Downloading is obtaining files that you do not have the right to use form the internet. 13. Child Pornography refers to the sexual abuse perpetrated against a child. It can be through any means including print or audio or video that is centred on sex act or the genital organs of children. This also includes computer generated contents. 14. Scams : It is a term used to describe any fraudulent business or scheme that takes money or other goods from an unsuspecting person. After the Internet became widely used, new forms of scams emerged such as scam bating, email spoofing, phishing or request for helps. 15. Computer Forensics involves using technology to determine and reveal technical criminal evidence. Mostly it involves extraction of stored data for legal purposes. • Computer forensics techniques include : (a) Cross driven analysis that correlates data from multiple hard drives. (b) Live analysis, which obtains data acquisitions before a PC is shut down. (c) Deleted File recovery. • Ethical hacker or white hat hacker is an information security expert who penetrates a network or other computing resource with the permission of its owners to find security vulnerabilities that can be exploited by a malicious hacker. 16. Cyber Crimes are the criminally intended activities done in cyberspace. Various categories of cyber crimes are : • Cyber crimes against persons. • Cyber crimes against property. • Cyber crimes against government. • Cyber crimes against persons include various crime like transmission of child pornography, harassment (sexual, racial, religious or other) using e-mails and cyber stalking, posting and distributing obscene material. • Cyber crimes against property refers to all digital properties and unauthorized trespassing through cyberspace. • Using cyberspace to threaten government and terrorize the citizens of a country generally by hacking a government or military maintenance website is referred to as cyber crime against government. 17. IT ACT 2000 has been enacted by GOI (Government) to facilitate lawful electronic, digital and online transactions and mitigate cyber crime. 32 ] Oswaal CBSE Chapterwise & Topicwise Revision Notes, computer science, Class – XII • Enacted on 9 June 2000 • An amendment to the act was made in 2008 under section 66A to penalize the sending of offensive messages. • Section 69 was introduced to grant power to authorities to intercept, monitor or decrypt to any information through any computers resource. • It also introduced amendments for child porn, cyber terrorism and voyeurism. Topic-2 Technology and society Revision Notes 1. New Technology improves quality of life for human beings and as a side effect makes it complex and has a negative effects on society and environment. 2. Technology is the reflection of people's imagination on solving existing problems. 3. Technology such as computers, smartphones, laptop, etc have made life easier. 4. Exchanging information, making faster decisions, interacting socially, entertainment, financial transaction processing, online shopping, managing homes all have become as easy and fast as blink of an eye. 5. These technologies though have made life easier but are posing many societical and environmental hazards 6. The advancement in technology has made many tasks simple and easies as compared to the conventional ways. 7. Sending and receiving messages, documents etc has become a matter of few minutes and is much cheaper. 8. No more stepping out early from home to wait for a taxi or public transport for going somewhere. 9. Technology itself is not harmful for the society but the way we use it leads to the negative impacts of technology. 10. Negative impacts on society • Resource depletion : More and more use and fast growing demand of technically advanced gadgets has led to a pressure on mother nature and hence a fast depletion of natural resources. • Increased population : Technology has helped us live longer by improving health facilities. It has been a negative effect for developing countries. • Increased pollution : Advancement in technology has led to more and more manufacturing units and hence to environmental pollution. • Lack of social skills : Frequency of interacting personally has been reduced much thus kids and teenagers are deprived of basic social manner. • Poor sleep Habits : Endorsing online activities have affected the sleeping pattern of people. • Loneliness/Isolation : Engaged in our gadgets we get isolated from the world around us even if we are at a crowded place. • Addiction : Addiction to technology is no less than the drug addiction. • Obesity : Sitting on social media and dependence on technology for minimal tasks like grocery shopping has led to obesity kids don't feel a need to go out and play with friends when they can sit back at home and play online games with their online friends • Depression : Dependance on technology and less interaction with fellow human beings can lead to depression. • Lack of Privacy : People are opening up their private space by giving their information on other sites thus giving rise to criminal activities. • Overshare on social media has led to the tendency of crossing social boundaries and cyberstalking has become common. • Children at much younger age get an exposure to sexual submissions. • Sexting has become another major problem. • Lesser attention span : Constant newsfeed, getting hundred of messages in a minute switching application too frequently has led to our mind being programmed for lesser attention span on a particular task. Hence remembering and recalling are becoming tough tasks. • People are loosing empathies due to lack of knowledge about social ethics and hence social violence is on an increase. • Using earphones, headphones could cause people to reduce their hearing after sometime.
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved