Docsity

Computer science+2 class, Lecture notes of Computer science

Toggle sidebar
bg1
1
Chapter-1
Network Operating System
Q1. What do you mean by network?
A1. A network is the group of two or more computers that are linked in order to share
resources, exchange files or allow communications. It is capable of sharing software
and hardware resources between many users.
Q2. What is computer networks?
A2. Computer network is a collection of interconnected independent computers and
peripherals connected by communication facilities for exchanging information and
sharing resources.
A computer network is interconnection of geographically distributed multiple
computers so that a meaningful transmission and exchange of information may take
place among them.
Q3. Give advantages of network?
A3. The advantages of network are as follows :
i. Sharing files , data and information.
ii. Sharing hardware and software.
iii. File integrity
iv. Network provides a very fast communication media.
v. It provides flexibility because there is a possibility of connecting devices of different
user’s.
vi. It reduces the cost of system.
vii. Network provides security to us.
viii. Speed : Sharing and transferring files within network is very rapid.
ix. It provides backup facility.
Q4. Give disadvantages of network?
A4. The various disadvantages of network are:
i. Network failure : All the central facilities may fail due to network.
ii. Management : The management of whole network is tough.
iii. Security : Danger of security is always present on network.
iv. Expensive to build.
v. Large scale organization :Cables and other hardware are very costly to buy
and replace in large organization.
Q5. Explain various components of computer networks?
A5. Various components of computer network are:
i. Computer : The main purpose of a network is to join computers together.
The two types of computers which are used for networking are :
a. Client/Node : It is the normal computer system which is connected to
network for sharing of resources.
b. Server is a powerful computer. It helps us in sharing of resources or
information. It controls all other nodes.
ii. Network Interface Card(NIC) : It is a small computer circuit board or card that
is installed in a computer so that it can be connected to a network. This card should
be fitted in each computer known as client and server computer.
iii. Hub/Switch : It is a device that allows you to connect multiple computers to a
single network devices. It allows data sharing between all devices connected to hub.
iv. Router : It is hardware device which is designed to receive, analyze and
forward incoming data within a network or to another network.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43

Partial preview of the text

Download Computer science+2 class and more Lecture notes Computer science in PDF only on Docsity!

Chapter- Network Operating System

Q1. What do you mean by network? A1. A network is the group of two or more computers that are linked in order to share resources, exchange files or allow communications. It is capable of sharing software and hardware resources between many users. Q2. What is computer networks? A2. Computer network is a collection of interconnected independent computers and peripherals connected by communication facilities for exchanging information and sharing resources. A computer network is interconnection of geographically distributed multiple computers so that a meaningful transmission and exchange of information may take place among them. Q3. Give advantages of network? A3. The advantages of network are as follows : i. Sharing files , data and information. ii. Sharing hardware and software. iii. File integrity iv. Network provides a very fast communication media. v. It provides flexibility because there is a possibility of connecting devices of different user’s. vi. It reduces the cost of system. vii. Network provides security to us. viii. Speed : Sharing and transferring files within network is very rapid. ix. It provides backup facility. Q4. Give disadvantages of network? A4. The various disadvantages of network are: i. Network failure : All the central facilities may fail due to network. ii. Management : The management of whole network is tough. iii. Security : Danger of security is always present on network. iv. Expensive to build. v. Large scale organization :Cables and other hardware are very costly to buy and replace in large organization. Q5. Explain various components of computer networks? A5. Various components of computer network are: i. Computer : The main purpose of a network is to join computers together. The two types of computers which are used for networking are : a. Client/Node : It is the normal computer system which is connected to network for sharing of resources. b. Server is a powerful computer. It helps us in sharing of resources or information. It controls all other nodes. ii. Network Interface Card(NIC) : It is a small computer circuit board or card that is installed in a computer so that it can be connected to a network. This card should be fitted in each computer known as client and server computer. iii. Hub/Switch : It is a device that allows you to connect multiple computers to a single network devices. It allows data sharing between all devices connected to hub. iv. Router : It is hardware device which is designed to receive, analyze and forward incoming data within a network or to another network.

v. LAN cable : It is used to connect more than one computer or other devices such as printers and scanners to each other. Q6. What is TCP/IP? A6. The Internet works by using a protocol called TCP/IP or Transmission Control Protocol/Internet Protocol. It allows one computer to talk to another computer via the internet through compiling packets of data and sending them to right location. TCP layer handles the message part. The message is broken down into smaller units called packets which are then transmitted over network. IP layer is primarily concerned with the transmission portion. Q7. What is IP addressing? A7. Every machine on the internet has a unique number assigned to it called an IP address. An Internet Protocol(IP address) is a numerical label assigned to each device(e.g. computer, printer) participating in a computer network that uses the Internet Protocol for communication.An IP address consists of 32 bit of information. These bits are divided into four sections referred to as octets or bytes, each containing 1 byte(8 bits). An address space is the total number of addresses used by the protocol. If a protocol uses N bits to define an address, the address space is 2N because each bit can have two different values(0 or 1) and N bits can have 2N^ values. Q8. Name various classes of IP address? A8. IPV4 address is divided into two parts : i. Network ID :This identifies the network to which IP address belongs ii. Host ID : This identifies host on the specified network. The IPV4 addressing system is divided into five classes of IP addresses. These are : Class A, Class B , Class C, Class D , Class E address. Q9. What is IP routing? A9. IP routing is a means of specifying and discovering paths in a TCP/IP network along which network data may be sent. Routing uses a set of routing tables to direct the forwarding of network data packets from their source to the destination often via intermediary network nodes known as routers. Two types are : i. Static routing : It is the manual configuration and selection of a network route, usually managed by the network administrator. ii. Dynamic routing : It makes the automatic adjustment of the routes according to the current state of the route in the routing table. Q10. What do you mean by network operating system? Explain. A10. An operating system that provides the connectivity among a number of autonomous computers is called a network operating system. Network Operating System(NOS) runs on a server and provides server the capability to manage data, users, groups, security, applications and other network functions. Its main purpose is to allow shared file and printer access among multiple computers in a network typically a local area network, a private network or to other network. E.g. UNIX, LINUX, Novell Netware Q11. Give the functions of NOS? A11. The functions of NOS are : i. Provides access to remote devices i.e. printers etc. ii. Enabling and managing access to files on a remote systems and granting access to users. iii. Granting access to remote applications and resources such as internet. iv. Monitoring the system and security so as to provide security against viruses, hackers etc.

vi. Performance : It provides high performance on various networks and workstations. vii. Fast and Easy installation : It can be easily installed from the web and does not require any pre requirements as it can run on any hardware.

Q18. Give various components of Linux desktop? A18. The various components of Linux desktop are : i. Top Bar : The bar across the top of screen provides access to the date and time, system indicators, currently open applications. ii. Desktop : It is the area where you can open, run, rearrange multiple program and application. iii. Dock : The dock occupies the left side of the screen. It shows currently open apps and shortcut of your favourite. iv. App Drawer : It is at the bottom of the dock. When clicked it lists all of the apps installed on your computer in a grid of icons. v. Search : It appears at the top of the activities overview. Click activities option to open search later. vi. System Indicator : These are individual icons showing battery life, network connectivity, sound, Bluetooth and many more. Q19. Write note on various shell commands? A19. The various shell commands are :

(i) who : It lists all users currently on system. The syntax is : $ who (ii) who am i : It reports the user name of the command user. The syntax is : $ who am i (iii) Mkdircommand : It is used to make a new directory. The syntax is :- $ Mkdirdirname e.g. $ mkdirabc (iv) CD command : It is used for changing the directory. The syntax is :- $cd (v) Rmdircommand : It is used to remove a directory. The syntax is :- $ Rmdirdirname e.g. $ rmdirabc (vi) Ls command : It is used to display a list of files in the current working directory. The syntax is :- $ Ls To show the detail of all files in a list form : $ ls – l To show all the hidden files : $ ls - a (vii) Pwd : It is used to find the directory in which user is currently working. Pwd stands for print working directory. The syntax is : $ pwd (viii) Cp : It is used to copy a file or directory. The syntax is :- $ cp file1 file (ix) Echo : It is used to display a message on the terminal window. The syntax is : $ echo message e.g. $ echo Hello. How are you.

(x) Grep : This commands searches the named input FILEs for lines containing a match to the given PATTERN. It is used to find a string in a file or stream. The syntax is :-

$ grep [options] „string‟ [filename]

e.g. $ grep „hello‟ file1.txt

(xi) Chmd command : It changes the access mode (permission) of one or more files. Only the owner of the file or a privileged user may change the mode. Mode can be numeric or an expression in the form of who opcode permission. The syntax is :-

$ Chmod [options] mode files

e.g. $ chmod u=rwx , g = rx , o = r myfile

(xii) Cat command : The cat(short for “concatenate”) command allows to create single or multiple files, view content of file , concatenate files and redirect output in terminal or files. The cat command is used for :- a. Display text file on screen : the syntax is $ cat abc.txt b. Create a new text file : the syntax is : $ cat>newfile c. Append data in a text file : the syntax is : $ cat>> abc.txt d. File concatenation : the syntax is : $ cat file1 file2 >newfile (xiii) Find : It is used to find the files in the hard drive. The syntax is : e.g. $ find /user/bin – type f – name “.txt”* (xiv) Date command : It is used to display the current system date and time. The syntax is :- $ date (xv) Cal : It is used to print a 12 month calendar for a given year. The syntax is : $ cal 2019 (xvi) Cmp : It compares two files that they are identical. It shows 0 if they are identical otherwise it shows 1. The syntax is $ cmp file1 file (xvii) Sort : It print the lines of file in sorted order. The syntax is : $ sort filename (xviii) Ps :- It is used to view the processes that user is running. The syntax is : $ ps [option] e.g. $ ps – u username displays the processes of the specified. (xix) Kill : It is used for terminating the process. The syntax is : $ kill processid (xx) Netstat : It display the network status. It prints information about active socket, routing table, interfaces etc. the syntax is : $ netstat (xxi) Logout : It is used for logging out the Linux. The syntax is : $ logout

Q26. What is cyber crime? A26. The crimes committed with the use of computers or relating to computer using internet is called cyber crime. The most common type are : i. Fraud : is used to describe a cybercrime that intends to deceive a person in order to gain important data or information. ii. Hacking : It involves the partial or complete acquisition of certain functions within a system, network or website. It also aims to access to important data and information, breaching privacy. iii. Computer viruses : Most criminal take advantage of viruses to gain unauthorized access to systems and steal important data. iv. Spamming : It uses electronic messaging systems, most commonly emails in sending message that host malware, fake links of websites and other malicious programs. v. Phishing : Phishers act like a legitimate company or organization. They use email spoofing to extract confidential information such as credit card numbers, social security number, passwords etc. Q27. What is cyber law? A27. It is a generic term which refers to all the legal and regulatory aspects of internet and world wide web.

Chapter- Network Operating System Administration(Configuration and Maintenance)

Q1. What do you mean by network operating system? Explain. A1. An operating system that provides the connectivity among a number of autonomous computers is called a network operating system. Network Operating System(NOS) runs on a server and provides server the capability to manage data, users, groups, security, applications and other network functions. Its main purpose is to allow shared file and printer access among multiple computers in a network typically a local area network, a private network or to other network. E.g. UNIX, LINUX, Novell Netware Q2. Give the functions of NOS? A2. The functions of NOS are : i. Provides access to remote devices i.e. printers etc. ii. Enabling and managing access to files on a remote systems and granting access to users. iii. Granting access to remote applications and resources such as internet. iv. Monitoring the system and security so as to provide security against viruses, hackers etc. Q3. What do you mean by maintenance? Explain. A3. Maintenance is a regular and systematic inspection, cleaning and replacement of worn parts, materials and systems. Preventive maintenance helps to prevent the failure of parts , material and systems by ensuring that they are in good working order. Q4. Give five elements of maintenance and management of network? A4. There are five major elements to the maintenance and management of a network. They are : i. Fault management. ii. Configuration management. iii. Performance management. iv. Security management. v. Accounting management. Q5. What is network security? A5. Network security is the process of taking preventative measures to protect the underlying networking infrastructure from unauthourised access, misuse, malfunction, modification, destruction or improper disclosure. It involves the authorization of access to data in a network, which is controlled by the network security administrator/specialist. Q6. Give the responsibilities of network security specialist? A6. The responsibilities for network security specialist are as follows : i. Analyze IT specifications to assess security risks. ii. Design and implement safety measures and data recovery plans. iii. Install, configure and upgrade security software. iv. Secure networks through firewalls, password protection and other systems. v. Inspect hardware for vulnerable points of access. vi. Monitor network activity to identify issues early and communication them to IT teams. vii. Act on privacy breaches and malware threats. viii. Serve as a security expert and conduct trainings when needed. ix. Draft policies and guidelines.

Q10. What is Linux Firewall? A10. Firewall is a network security system that filters and controls the traffic on a predetermined set of rules. This is an intermediary system between the device and the internet. A network firewall protects your computer from attacks or intrusions from malicious crackers in the network. A properly configured firewall can increase the security of computer. Q11. Name five types of firewall? A11. The five types of firewall are as follows : i. Packet filtering firewall. ii. Circuit Level Gateway. iii. Stateful inspection firewall. iv. Application Level Gateway. v. Next Generation Firewall. Q12. What is Logical Volume Manager(LVM)? A12. LVM stands for Logical Volume Management. It is a system of managing logical volumes or file systems that is much more advanced and flexible than the traditional method of partitioning a disk into one or more segments and formatting that partition with a file system. There are three concepts that LVM manages : i. Volume Groups : is used for changing what abstracted set of physical partitions are presented to your operation in logical volumes. ii. Physical Volumes : used for adding or removing hard drives in volume group. iii. Logical Volumes : It will present the volume groups as partitions so that operating system can use the designated space. Q13. What is a SWAP Space? Explain. A13. It is used when the amount of physical memory(RAM) is full. If the system needs more memory resources and the RAM is full, inactive pages are moved to the swap space. While swap space can help machines with a small amount of RAM, it should not be considered a replacement for more RAM. It is located on hard drives which have a slower access time than physical memory. Q14. What is mount point in linux? A14. Mount is to access a filesystem in Linux. In Red Hat Linux each partition is used to form part of the storage necessary to support a single set of files and directories. This is done by associating a partition with a directory through a process known as mounting. Mounting a partition makes its storage available starting at the specified directory known as a mount point. Q15. What do you mean by shell scripting? Explain. A15. Shell is a program that acts as an interface between the user and the Linux kernel. The shell is a command line interpreter. Whenever we enter a command it is interpreted by the Linux shell. A shell script is file that contains ASCII text. Shell script is series of command written in plain text file. Q16. Why do we need shell scripts? A16. There are many reasons to write shell scripts : i. To avoid repetitive work and automation. ii. System admins use shell scripting for routine backups. iii. System monitoring. iv. Adding new functionality to the shell etc.

Q17. Give advantages of shell scripts? A17. The advantages of shell scripts are : i. The command and syntax are exactly the same as those directly entered in command line, so programmer do not need to switch to entirely different syntax. ii. Writing shell scripts are much quicker. iii. Quick start. iv. Interactive debugging etc. Q18. Give disadvantages of shell scripts? A18. Various disadvantages of shell scripting are : i. Prone to costly errors, a single mistake can change the command which might be harmful. ii. Slow execution speed. iii. Design flaws within the language syntax or implementation. iv. Not well suited for large and complex task. Q19. What do you mean by Red Hat Linux? Explain. A19. It is the enterprise grade version of Red Hat‟s open source Linux operating system distribution. It can be deployed on both servers and desktops. Q20. What are responsibilities of network security specialist? A20. A network security specialist is a kind of computer administrator that specializes in protecting a company‟s data and other information. Network security specialists build firewall, install antivirus software on servers and computers within a network and monitor network for breaches in security. A Network security specialist often provides training to general staff regarding security issues and he may develop policies that govern how employees can access company information using a smartphone, laptop or home computer. Q21. What do you mean by linux firewall? What are three levels of security provided by linux firewall? A21. A network firewall protects your computer from attacks or intrusions from malicious crackers in the network. A firewall exists between your computer and the internet. A properly configured firewall can increase the security of computer. There are three different levels of security : i. Highly secure firewall : it is suitable for those who are quite concerned about their security. Here all incoming network connections are disallowed unless specifically listed in the services list on the screen. ii. Medium grade secure firewall : this is default level of security and is generally adequate while using the internet. iii. No firewall : It allows any outside individuals to access network resources on your computer. Q22. What is the purpose of root user in Linux? Explain. A22. To perform system administration operations we must have access rights such as the correct password that enable to log in as root user, making us the superuser. Because the superuser i.e. root user have the power to change almost anything on the system. With the correct password, we can log in to the system as a system administrator and configure the system in different ways. Q23. What are the command for adding and deleting a user in Linux? A23. Adduser allows to add a single user to the system. All the parameters must be specified on the command line. The syntax is :sudoadduser username The command to delete a user is deluserl. With the – r option, the user‟s home directory will also be removed. The syntax is :sudodeluser username

. Q6. Give various components of CorelDraw window? A6. The various components are : Menu Bar, Property Bar, Toolbar, Title Bar, Rulers, Toolbox, Drawing Window, Drawing Page, Color Palette, Docker, Status Bar, Document Navigator, Navigator. Q7. Give various tools in CorelDraw? A7. The various tools used in CorelDraw are : i. Pick Tool : used to select, resize and rotate toward the image object. ii. Shape Tool(F10) : is used in editing an image object shape or text character by manipulating nodes. iii. Smooth Tool : It smooths object by dragging along its outline. iv. Crop tool : Remove the areas outside a selection. v. Eraser Tool(X) : It removes unwanted areas in a drawing. vi. Zoom Tool(Z) : Change the magnification level of the document window. vii. Pan Tool(H) : Drag hidden areas of a drawing into view without changing the zoom level. viii. Freehand Tool(F5) : Draw curves and straight line segments. ix. Pen Tool : It draws curves in segments and preview each segment as you draw. x. Smart Drawing Tool(Shift + s) : Convert freehand strokes to basic shapes or smoothed curves. xi. Rectangle Tool(F6) : It draws squares and rectangles by dragging in the drawing window. xii. Ellipse Tool(F7) : It draws circles and ellipses by dragging in the drawing window. xiii. Polygon Tool(Y) : It draws polygons by dragging in the drawing window. xiv. Star Tool : It draw uniform, outlined stars. xv. Basic Shapes Tool : It draws triangles, circles, cylinders, hearts and other shapes. xvi. Arrow Shape Tool : Draw arrows of various shapes and directions. xvii. Flowchart Shapes Tool : Draw flowchart symbols. xviii. Text Tool(F8) : Add an edit paragraph and artistic text. xix. Table Tool : Draw, select and edit tables. xx. Drop Shadow Tool : It apply shadows behind or below objects. xxi. Color Eyedropper Tool : Sample colors and apply them to objects. xxii. Horizontal or Vertical Dimension Tool : Draw horizontal or vertical dimension lines.

Q8. Explain the importance of tool box in Corel Draw? A8. The toolbox contains various tools you can use to select objects, edit objective draw shapes, add and edit text, navigate around the page, and perform a variety of other tasks. It contains a range of tools that can be used for specific drawing and editing tasks. Some tool let you draw shapes, and other tools let you apply colors, patterns or other types of fills to object. Q9. What is vector based drawing? A9. Vector based drawing refers to a program where images are mathematically expressed. For example a circle is expressed with equation : X^2 + Y^2 = R^2 If we resize the image of the circle the mathematical expression is recalculate resulting in a more accurate and appropriate image.

Q10. Explain the following : (i) Pixel (ii) PPI A10. Pixel : It is a single square on a computer screen. Depending upon your screen resolution your screen probably has hundreds of thousands of pixels. E.g. the most common screen resolution currently is 1074 x 768 which comes out to 786, pixels. PPI : It stands for Pixels Per Inch, the standard unit of measurement for computer graphics(sometimes known as dpi or dots per inch)

Q11. How can you enter text in Corel Draw? Explain. A11. Corel Draw lets you create two type of text: i. Paragraph text is contained within a text frame. It is used for larger blocks of text. ii. Artistic text is not contained within a text frame and you can add special effects such as contouring and drop shadows. Artistic text is ideal for logos, banners and headlines. You can create both paragraph and artistic text by using the Text tool. The steps in adding text are as follows : i. Click the Text Tool ii. To add artistic text click anywhere on the page and then start typing. iii. To add paragraph text click and drag. A frame appears and type in it. iv. To add paragraph text to the inside of an object position the pointer at the inside border of the object and then when the pointer changes to an insert cursor begin typing. Q12. How can you create a drawing in corel draw? Explain A12. In Coreldraw we can create a drawing in two ways : i. By using a blank page ii. By template When you create a drawing using New Option a blank drawing page appears. When you use a template, a Drawing page with pre-designed elements and placeholders appears. The steps are as follows :- i. Click on All Program  Corel Draw Graphics Suite  Corel Draw ii. Corel Draw opening dialog window appears. iii. Click on New option to open a new drawing. You can also press CTRL + N or click the New button on the standard toolbar to create a new drawing. Q13. Write steps in starting Corel Draw? A13. When you open Corel Draw the application window opens containing a drawing window. The Corel Draw interface consists of several components including the drawing window, drawing page, toolbox and toolbar. The steps to start Corel Draw are as follows :- i. Click on All Program  Corel Draw Graphics Suite  Corel Draw ii. Corel Draw opening dialog window appears. iii. Click on New option to open a new drawing and open option to open an already existing drawing. iv. Corel draw application window will appear on the screen. The window consists of several components that you will use to create works of art.

Q19. How can you lock and unlock objects? Explain. A19. The steps to lock objects are as follows :- i. Select the object or group of objects using Pick Tool. ii. Click Arrange  Lock Object Option iii. The selected object will be locked. The steps to unlock the object are as follows :- i. Select the locked objects using Pick Tool. ii. Click Arrange UNLock Object Option iii. The locked object will be unlocked. Q20. How can you import files from Corel Draw? A20. The steps to import files in Corel Draw are as follows :- i. Click File  Import ii. Choose the folder where the file is stored. iii. Choose a file format from the files of type list box. iv. Click the filename. v. Click import and do one of the following :- Click the drawing page to maintain original file and position top-left corner where you click. Click and drag on the drawing page to resize the file.

Q21. How can you export file from Corel Draw? A21. The steps are as follows :- i. Click File  Export ii. Choose the folder where you want to save the file. iii. Choose the file format from the Save as type list box.

iv. Type a filename in the File name list box.

v. Click options and enable any of the following active check box : Export this page only. Selected only. Do not show filter dialog. vi. Click Export.

Chapter-6(Elementary Server Side Scripting Using PHP

Q1. What is the difference between HTML and XHTML? Explain. A1. The difference between HTML and XHTML are as follows :- S.No HTML XHTML

  1. All the content can be put under body element.

All the content has to be put in blocks under body element.

  1. An application of SGML An application of XML.
  2. Attributes have quotes as optional e.g.

Attributes have quotes mandatory e.g.

  1. Attributes values not significant e.g.

Attributes values are important e.g. ,

All the unclosed tags must be closed e.g. ,

Q2. What do you mean by XHTML? Explain. A2. XHTML stands for Extensible Hyper Text Markup Language. It was developed by World Wide Web Consortium to help web developers make the transition from HTML to XML. XHTML documents need to be well formed, the website will be compatible with present and future web browsers and rendered more accurately. It also makes website easier to maintain, convert and format in the long run. Q3. What do you mean by CSS? Explain. A3. CSS stands for Cascading Style Sheets. It is the language for describing the presentation of web pages, including colors, layout and fonts. It is a stylesheet language that describes the presentation of an HTML(or XML) document. It describes how elements must be rendered on screen, on paper, or in other media. It allows one to adapt the presentation to different types of devices such as large screens, small screens or printers. Q4. What is the purpose of dreamweaver? Explain. A4. It is a software application that allows you to create and edit HTML and XHTML documents(web pages). Dreamweaver is considered WYSIWYG(What You See Is What You Get) meaning that when you format your webpage, you see the results of the formatting instead of the mark-ups that are used for formatting. Dreamweaver create HTML code that controls everything about how the page looks and acts. Q5. What do you mean by PHP? Explain. A5. PHP stands for Hypertext Preprocessor. It is a server-side programming language for the web. It is a programming language that allows web developer to create dynamic content that interacts with database. It is basically used for developing web based software applications. It is an interpreted language i.e. there is no need for compilation. Q6. Give features of PHP? A6. The features of PHP are as follows : i. It is an open source software. ii. It costs nothing, it is free to download. iii. It is a server-side scripting language and is used for website and web applications. iv. PHP scripts are executed on the server. v. It supports a wide range of databases. vi. It runs on various like Linux, Windows, Unix etc.

Q12. What do you mean by variables? A12. A variable is a name associated with value. A variable stores or contains the value. Variables allow you to store and manipulate data in program. It can hold any value during the execution of the program. It‟s value can be changed during program execution. Q13. What are the rules for declaring variable names? A13. The rule for declaring variables names are as follows : i. A variable starts with $ sign, followed by the name of the variable. ii. A variable name must start with a letter or the underscore character. iii. A variable name cannot start with a number. iv. Variable names can be any length. v. Variable names can include letters, numbers and underscores only. vi. Variable names are case-sensitive e.g. $name and $NAME are two different variable. Q14. What do you mean by scope of variables? Explain. A14. The scope of a variable is the region of program in which it is defined. PHP has three different variable scopes : i. Local : A variable which is declared inside function is called local variable. It is accessible within the function only. ii. Global : It is a variable relevant throughout the entire program. A variable declared outside the function or declared with window object is known as global variable. iii. Static : When a function is completed/executed, all of its variable are deleted. However sometimes we want a local variable NOT to be deleted. We need it for a further job. To do this use the static keyword when you first declare the variable. Q15. What do you mean by data types? A15. Values stored in a variable or a constant are stored as a specific type of data. PHP provides different data types to hold different types of values. Q16. What are various data types in PHP? Explain. A16. The various data types in PHP are as follows : i. Integers : Whole numbers, without a decimal point e.g. 24 , 73 , -33 etc. ii. Floating point number : A numeric value with decimal digits e.g 7. iii. String : A series of characters e.g. “All is well” iv. Boolean : A value that can be either true or false. v. Array : A group of values in one variable. vi. Object : A structure created with a class. vii. Resource : A reference that identifies a connection. viii. NULL : A special type that only has one value NULL Q17. What is the purpose of if statement? Explain. A17. The if statement is used to execute one or more lines of code based on a condition. This statement executes one block of statements if the condition is True. The syntax is : If(condition) { Code to be executed }

Q18. What is the purpose of switch statement? Explain. A18. It is a multi way branching statement. This statement causes a particular group of statements to be chosen from several available groups. The selection is based on the current value of expression that is included within switch statement. The interpreter checks each case against the value of the expression until a match is found. If nothing matches a default will be used. The syntax is : Switch(n) { Case label1: Code to be executed; Break; Case label2: Code to be executed; Break: ……….. ……….. Default: Code to be executed; } Q19. What is the purpose of FOR statement? Explain. A19. The for loop is a block of statements that is used to carry out a looping operation i.e. to execute a sequence of statements fixed number of times. A PHP for loop exectes a block of statements until a specified condition is true. The syntax is : For(init counter; test counter; increment/decrement counter) { Code to be executed; } Where : Initcounter : initialize the loop counter value. Test counter : evaluated for each loop iteration. If it evaluates to TRUE, the loop continues. If it evaluates to FALSE, the loop ends. Increment/decrement counter : Increases/decreases the loop counter value. Q20. What do you mean by functions? Explain. A20. A function is a block of code. Functions can be built-in or user defined. They can require information to be passed to them and usually return a value. A function is a self contained block of statements that perform a specific task. A function accepts values from user, processes them and then perform an action or returns a new value, possibly both. Using function it is possible to reduce the size of program by calling and using them at different places in a program. Q21. Give advantages of using functions? A21. Various advantages of using functions are as follows : i. Easy to write a correct and small function. ii. Easy to read, write and debug a function. iii. Easier to maintain or modify such a function iv. Small functions tend to be self documenting and highly readable. v. It can be called any number of times in any place with different parameters. vi. Reducing duplication of code. vii. Decomposing complex problems into simpler pieces. viii. Improving clarity of the code. ix. Reuse of code. x. Information hiding.