Computer Notes For Class 9th 10th.docx

  • Uploaded by: Prince Haider
  • 0
  • 0
  • January 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Computer Notes For Class 9th 10th.docx as PDF for free.

More details

  • Words: 14,478
  • Pages: 33
Loading documents preview...
Guardian Model School System Chapter # 1 Fundamentals of Computer Short Questions i. It was a calculating device invented by John Napier (Scottish Mathematician) in 1614. ii. It consisted of a wooden box containing rotating cylinders having digits from 0-9. iii. It could multiply, divide and find square roots of numbers. Slide Rule: i. It was device developed by William Ought red (English Mathematician) in 1920s. ii. It has 3 parts. Slide, Rule and Sliding Cursor. iii. It was based on the idea of logarithm and used to solve problem of multiplications and divisions. 2. Compare 1st and 3rd generation computers. 1st Generation Computer (1940 – 1956) 3rd Generation Computer (1963 – 1971) Vacuum tubes were used. Integrated circuits were used. Speed was slow. Speed was fast. Memory was very small. Memory was large. They were huge in size. They were small in size. They were very expensive and unreliable. They were cheaper and reliable. Examples were: ENIAC, UNIVAC 1, Mark – 1 etc. Examples were: IBM System/360, System 3 etc. 3. Differentiate between analog and digital computers. Analog computers Digital Computers An analog computer accepts data in continuous form. A digital computer accepts data in the form of digits. These are special purpose computers. These are general purpose computers. These computers have no operational state. These computer have two states On(1) and Off(0). Fast in Processing. Slow in processing. These computers are less accurate. These computers are more accurate. These computers have small memory size. These computers have large memory size. These computers are used in scientific and These computers are used in business, education, mathematical calculations. research, supermarkets etc. Example are: Heath Kit, EC – 1 Examples are: IBM PCs, Apple Macintosh computers. 4. Ahmed, a class IX student is asking his father to replace his home computer CRT monitor with LCD monitor. How will you justify his demand? Ans. Ahmed demands LCD monitor because: i. It is small in size ii. It is cheap in price iii. It requires less energy 5. What will happen if storage devices are removed from a computer? If storage devices are removed from a computer then it will not possible to store the information and information retrieval. 6. Differentiate between systems software and application software. System Software Application Software It is a collection of programs which makes the uses of It is a collection of programs which are used to solve user’s computer easy and efficient. problems. They are general purpose software. They are special purpose software. They are simple software. They are complex software. They are cheaper. They are costly. Examples are: Operating System, Device drivers etc. Examples are: Business, Productivity software etc. 7. How a student can use computer to improve academic performance? Ans. Students can use computers to watch tutorials, solve mathematical problems and read notes. By using this way, students can use computers to improve academic performance. 8. Give any three uses of computers in a school library. Ans. Uses of computer in school library i. Access to large amount of information and books. ii. User friendly interface. iii. Advance search and retrieval.

9. Name few house hold appliances in which microprocessor is used. Ans. It used in the devices including mobile phones, microwave ovens, cameras, washing machines, televisions, etc. 10. What are the tasks performed by operating system? i. It loads programs into memory and executes them. ii. It controls the operation of input/output and storage devices. iii. It manages files and folders. LONG QUESTIONS: 1. Describe the five generations of computers. First Generation Computers (1940 – 1956): i) Vacuum tubes were used. ii) Speed was slow. iii) Memory was very small. iv) They were huge in size. v) They were very expensive and unreliable. vi) Examples were: ENIAC, UNIVAC – 1, Mark – 1 etc. Second Generation Computers (1956 – 1963): i) Transistors were used. ii) They are reliable and cheaper. iii) They used punch card readers, magnetic tapes and printers. iv) High level programming languages were introduced like FORTRAN and COBOL in these computers. v) Examples were UNIVAC-II, IBM 7030, 7780 and 7090, NCR 300 etc. Third Generation Computers (1963 – 1971): i) Integrated Circuits were used. ii) Speed was fast as compared to above generations. iii) Memory was huge. iv) They can run different applications at the same time. v) Examples were IBM System / 360, System 3 etc. Fourth Generation Computers (1971 – Till Now): i) They use LSI (Large Scale Integration) and VLSI (Very Large Scale Integration) chips. ii) Microprocessors were also developed in fourth generation. iii) They are very fast and have large memory capacity. iv) They support multimedia software that combine text, image, sound and videos. v) They use modern languages like C, C++, Java etc. vi) Examples are Pentium Series, Dual Core, Core i3, i5 and i7 etc. Fifth Generation Computers (Upcoming): i) This generation is currently under process. ii) Scientists are trying to design such machine which can think and understand natural languages. iii) They will be based on Artificial Intelligence. iv) Their examples will be robots and expert systems. 2. Write a note on mainframe, minicomputer and microcomputer. Ans. Mainframe Computer: i) Mainframe were developed in early 1940s. ii) They are very large, powerful and expensive. iii) They can execute trillions of instructions per second. iv) They are used in banking, education, government, research etc. v) Examples are IBM zEnterprise EC12, EC196, HP16500 etc. Minicomputer: i) They are introduced in 1960s after development of IC chips. ii) They are less expensive and smaller than mainframe computers. iii) They can execute billions of instructions per second. iv) They are used in PIA, NADRA etc. v) Examples are IBM System/36 and HP 3000.

Microcomputer: i) They are introduced in 1970s after development of micro-processor. ii) They are smallest and low cost computers. iii) They can execute millions of instructions per second. iv) They are used in homes, offices etc. v) Their examples are IBM, HP, Dell etc. 3. Explain the basic operations of a computer. Input Operation: i. A computer works in the light of instructions (input) given to it. ii. Input is given by a user using keyboard or mouse. iii. The input is stored in memory for further processing. Processing Operation: i. Microprocessor processes the data according to instructions (input). ii. Microprocessor fetches the data from memory and Control Unit (CU) decodes the instructions. iii. After decoding, it sends signals to other parts of computer to execute it. Storage Operation: i. The result produced after processing. ii. These are stored in memory before sending to output device or hard disk. Output Operation: i. The Control Unit displays the results on the monitor or print it on paper. ii. Results can also be saved on hard disk for future use. 4. Write short note on the followings. Hardware Engineer: i. He is a person who design and manufacture computer hardware. ii. He also does repairing and maintenance of computers. iii. He has deep knowledge of computers, processors, circuit boards, input & output devices etc. Network Administrator: i. He is a person, who install configure and maintain the computer network. ii. He is incharge of computer hardware and software used at the network. iii. He gives password to network users to access the network. Database Administrator: i. He is a person, who design, implement and maintain the databases. ii. He also ensures the security of database. Web Designer: i. He is a person, who creates and designs the websites. ii. He uses different elements and languages to create websites. Multimedia Designer: i. He is a person, who presents information in attractive manner. ii. He creates digital images and videos using various software. iii. He can edit, split and combine images and videos. 5. Describe the following types of application software. Productivity Software: i. They include word processing, spreadsheet and database management. ii. They are used to speed up daily routine tasks. iii. They help to work in organized and efficient manner. Business Software: i. They help to run any kind of business in efficient way. ii. Some examples are accounting, sales, marketing and inventory softwares etc. Entertainment Software: i. They are used for entertainment purpose. ii. They also help to improve skills such as typing and reading. iii. Video games are most popular entertainment software. Education Software: i. They are used for education purpose. ii. It helps students and teachers in education field. iii. Examples are typing tutor, language learning, driving test etc.

Guardian Model School System Chapter # 2 Fundamentals of Operating System Short Questions 1. Why operating system is important software for a computer? Give any five reasons. Following are the main functions due to which operating system is important software for a computer. i. Process Management ii. Memory Management iii. Input/output Management iv. File Management v. Resource Management vi. User Management 2. Give any three objectives of operating system? i. Convenience and Efficiency. ii. Usage of resources such as CPU, memory, input/output devices and Internet. iii. Resource manager. 3. Mention few disadvantages of using DOS. i. User must know the syntax of the command. ii. DOS commands are difficult to remember. iii. It is a single user and single task operating system. iv. It cannot support graphics. v. It is not GUI based. 4. Name two operating systems which are used in modern mobile phones. i. Android OS (Google Inc.) ii. iPhone OS/iOS (Apple) 5. What difficulties a student may face if he/she is not familiar with the operating system of a computer? i. User must know basics of operating system to give commands to the computer. ii. Without this, he/she cannot run programs and manage files on computer. iii. Without knowledge of operating system, a computer is useless. 6. Define UNIX and Windows operating system. UNIX: i. It was introduced in 1969. ii. It allows multiple users to run different programs at the same time. iii. UNIX is used on large computer system (Mainframe). iv. It uses a command line interface but later on GUI was also introduced. Windows Operating System: i. It is the most popular operating system. ii. It was developed by Microsoft. iii. It has many versions over the period of time like Windows 95, Windows 98, Windows Millennium, Windows XP, Windows Vista, Windows 7, 8 and 10. The latest version is Windows 10. 7. Differentiate between single-user and multi-user operating systems. Single-user Operating System Multi-user Operating System It is used by a single user at a time It is used by many users at a time. It is easy to use. It is difficult to use. Resources are not shared with other computers. Resources are shared with other computers. It is used on microcomputers. It is used on minicomputers and mainframes. It requires less memory and costs less. It require large memory and costs high. Examples are Windows 95, Windows XP, Windows 7, etc. Examples are Windows NT, UNIX and Linux etc.

8. What is meant by managing data and why is it important? i. Managing data means storing files in secondary storage devices i.e. on hard disk or USB flash. ii. This helps in finding files easily and quickly. 9. What is meant by resources of computer? Ans. The resources of a computer include microprocessor, memory and all the attached devices. 10. What types of problems may a student face if no antivirus is installed in his/her computer system. Ans. If no antivirus is installed in his/her computer then virus can damage data, software, or the computer itself. LONG QUESTIONS: 1. Explain the main functions of operating system. Ans. The following are the main functions of operating system. Process Management: i. A process is a program in execution which needs resources like processing resource, memory and I/O resources. ii. The Operating System must allocate resources to processes the data. Memory Management: i. It is the process of allocating memory space to different programs. ii. When programs are run by users, the operating system allocates portions of free memory these programs. iii. When a program is closed, operating system will free the memory portion used by that program. Input/output Management: i. User communicates with computer through input/output devices such as keyboard, mouse, monitor, printer etc. ii. Operating system uses Input/output controller to manage all the input/output devices. File Management: i. It is the process in which operating system organizes, stores and keeps track of files and folders. ii. Operating System perform various operations on these files/folders like creating, opening, editing, renaming, moving, copying, deleting and searching etc. Resource Management: i. The resources of a computer include microprocessor, memory and all the devices attached to the computer. ii.

Operating system automatically manages the resources of a computer when application programs are executed by user.

User Management: i. User management is an important feature of operating system for a secure computer system. ii. The operating system gives full control to administrator only who can install various programs and can creates new users. iii. Operating system does not allow the users to install programs or create new users. 2. Describe the following computer interfaces. Command Line Interface: i. In CLI, commands are given with keyboard. ii. The user types a command and presses the ENTER key to execute it. iii. Examples of CLI are DOS (Disk Operating System) and UNIX. iv. CLI is difficult to use because users have to remember the commands. Graphical User Interface: i. It is a graphical interface and uses windows, icons, menus and pointer. ii. To perform a task, the user has to select icons or make choices in menus. iii. Examples of GUI are Macintosh, Linux and Windows. Menu-driven Interface: i. It presents a menu, user makes a choice and then the next menu appears the user makes another choice and so on. ii. It is very easy to use. iii. Menus contain the commands to use the operating system. iv. Examples are Novell’s Netware and ProDOS etc. 3. Describe the following types of operating systems. Batch Processing System: i. In this system, jobs are grouped in batches & computer executes them one by one ii. Computer automatically loads the next job when one job terminates. iii. This system is suitable where large amount of data has to be collected and processed on a regular basis. iv. Example is printing of report cards of all students of a school as a batch.

Time-sharing System: i. In this system, multiple users can run different programs at a same time on a large-scale computer. ii. In a timesharing system, the central processing unit is switched rapidly between the programs so that all the user programs are executed simultaneously. iii. The, operating systems used in minicomputers and mainframe computers support timesharing. iv. This system is used in organizations like airline, bank, hotel, university, etc. Where many users need access to the central computer at the same time. v. For example, hundreds of students access the university's mainframe computer at the same time to check their result / date sheet etc. Real-time System: i. This system must process information and produce a response within a specified time. ii. These operating systems are developed for special applications. iii. For example, a measurement of temperature from an oil refinery indicating high temperature might demand quick response to avert an explosion. iv. There are a number of real-time operating systems used in military and space research programs. v. For example, real-time operating system is used to monitor the position of rocket in the space. 4. Write notes on Macintosh and Linux operating systems. Macintosh Operating System: i. Mac OS is a series of operating systems developed by Apple Incorporation. ii. It was introduced in 1984. iii. The latest version is Mac OS X. iv. It is a UNIX based user-friendly operating system. v. There are some specialized versions of Mac OS X used on devices such as iPhone, iPod, iPad and new Apple TV. Linux Operating System: i. Linux is free open-source operating system introduced by Linus Torvalds in 1991. ii. It is faster but difficult to use as compared to Macintosh and Windows operating systems. iii. It is not a popular operating system. iv. Linux OS can be installed on PCs, laptops, netbooks, mobile and tablet devices, video game consoles, servers, supercomputers and more. v. Popular Linux OS distributions include Debian, Ubuntu, Fedora, Red Hat and openSUSE etc. 5. Describe the basic icons of Windows operating system. An icon is a small graphical symbol that represents a file, folder, application or device. There are some special system icons SUCH as Recycle Bin and Computer that are kept on the desktop. Some of them are described below: Recycle Bin Icon: It is temporary folder that keeps the deleted files, so that user can restore it when needed. However, user can delete a file permanently from Recycle Bin also. Computer Icon: It allows user to access all computer’s resources like drives of Hard Disk etc. Folder Icon: It is used to store files. A folder can have another folder inside it which is known as subfolder. Folders are used to keep files in an organized manner on a storage device such as hard disk so that they can be accessed easily. File Icon: In a GUI, files are also represented by icons. A file may contain text, image, music or video. Users recognize a file by its icon. Shortcut Icon: Shortcut ions are created to access a program, file or folder quickly. They have an arrow at the bottom left corner and the name below it.

Guardian Model School System Chapter # 3 Office Automation Short Questions 1. What is a word processor? Write some advantages of it over a typewriter. Ans. Word Processor is commonly used application software for creation of different documents. A common word processing program is Microsoft Word. Advantages: i. We can delete mistakes, check spelling & grammar. ii. We can use different fonts and different size. iii. We can save document and email it. 2. Name any three types of documents, which can be prepared in Word. i. Letters. Ii. Reports iii. Resumes 3. Differentiate between page break and section break. Page Breaks: Page break is inserted in document when user wants to add a new page to the document Section breaks: Section break can be used to break a document into sections having different header and footer for each chapter of a book. 4. Why header and footer are important in a Word document? Header and Footer are important because different type of information appears in the header or footer i.e. book title, chapter number, page number, company name etc. 5.What is the purpose of control buttons in Word window? i. By clicking minimize button we can minimize a window from the view. ii. By clicking maximize button we can enlarge the window to fill the entire screen. iii. By clicking the restore button we can return the window to its original size. iv. By clicking close button, we can close a window. 6. Why hyperlinks are created in Word document? Ans. The hyperlink can be text or graphics. By using it, we can provide information to our readers without repeating the same information on different pages. 7. Name any three areas of application of Excel. Ans. Three areas of application of Excel are Conditional Formatting, Sorting and Filtering and Basic Math. 8. Differentiate between relative and absolute cell addressing in Excel. Relative Cell Addressing: Relative cell address means when a formula is copied to other cells, the cell references in the formula change to reflect the formula’s new location. For example, formula (=C1+C2) present in C3. If you copy it in D3, it will change to (=D1+D2). Absolute Cell Addressing: Absolute cell addressing keeps a cell reference constant when copying a formula or function. Absolute cell addresses begin with a dollar sign in the formula, such as =$C$5 + $D$5. 9. What are the advantages of protecting an Excel worksheet? When a worksheet is protected, other users can only view the information but cannot make changes in it. 10. How graphical representation of spreadsheet data can be helpful in business. The graphical representation adds meaning to data. These can add extra emphasis to business reports and persuasive marketing material. Long Questions 1. Which shortcut keys are used in Word to move cursor to the beginning of line, …… ? Cursor Movement Shortcut Key Beginning of the line Home End of line End Top of the document Ctrl + Home End of document Ctrl + End 2.Write the mouse commands used for selecting various items is a Word Item to Select Mouse Command Single Word Double-click the word Sentence Press and hold down Ctrl key and click anywhere in the sentence Paragraph Move the mouse pointer to the left of the paragraph until it changes to a right-pointing arrow and then double-click

3. Explain text and paragraph formatting in Word. Text Formatting:  Text formatting means changing the font type, size, style, color and effects of text.  To change the Font Type and Size of Text follow these steps: i. Open the Home tab and click the arrow on the right side of the currently selected font type and choose another font type. ii. To change the font size, click the arrow on the right side of the font size and select a font size of existing text, select the text and then make the changes.  i. ii. iii. iv.

    

To change the Font Style and Effects, follow the following steps: Click the Home tab. Click the dialog box launcher on the lower-right corner of the Font group. This will open the Font dialog box. Now, the user can change font styles and effects of text. Some changes that are available in the Font dialog box can be made directly from the Font group in Home tab.

 Following are the steps to clear the text formatting: i. Select the text you want to clear the formatting. ii. Click the Home tab. iii. Open the Styles dialog box and select Clear all. Paragraph Formatting: Paragraph formatting refers to change of format of text of paragraph such as font size, color, line spacing, alignment etc. Paragraph formatting tools are provided in the Paragraph group of Home tab and Page Layout tab. Paragraph alignment refers to the appearance of lines in a paragraph in relation to left or right margins. Left align is the default setting for paragraph alignment. Paragraph indentation refers to the distance of paragraph from left margin. To increase paragraph indent, click the Increase Indent button. The following are the steps for changing spacing between paragraphs and lines. i. Select the paragraph or paragraphs. ii. Click Home tab. iii. Open the Paragraph dialog box, by clicking the small arrow at the bottom right corner of the Paragraph group. iv. Make the required changes. v. Click OK to apply changes. 4. Describe the Paste Special command used in Excel. a. Excel copies all the information in the selected range of cells when you paste data. b. Excel’s Paste Special command allows many other options while pasting cells such as paste only formats of selected cells without contents or paste contents without formulas. c. The following steps describe the use of Paste Special command. i. Select the cell range to paste. ii. Open the Paste Special. Paste Special dialog box will open. iii. Select an option from the Paste Special dialog box and click OK. 5. Describe how functions are used in Excel with examples. Functions are built-In formulas in Excel that allow user to easily perform common calculations on data. Functions can be entered in a worksheet using keyboard For example, following are the steps to calculate average using the AVERAGE function. i. Select cell E5 where the result will appear. ii. Type =av to display the Formula AutoComplete list. iii. Point to AVERAGE function and Double-click. iv. Select the range B5:D5 to insert it as argument to the AVERAGE function. v. Press Enter key. 6. Describe how formulas are used in Excel with examples. i. All the Excel formulas begin with equal sign (=) just like functions. ii. For example, to multiply two numbers 4 and 7, the formula will be =4*7. iii. User can also use cell addresses in formulas such as =(A4+B4)/5. This formula will first add the contents of cell A4 and B4 and then divide the sum by 5. iv. Whenever the user changes the value in a cell, the result of the formula will be automatically updated. This feature known as Automatic recalculation.

Guardian Model School System Chapter # 4 DATA COMMUNICATIONS Short Questions 1. Differentiate between analog and digital signals. Analog signals Digitals signals It is a continuous wave that changes with time. It is a discrete wave that carries binary information. It is represented by a sine wave. It is represented by square wave. It is described by the amplitude, period or frequency. It is described by bit rate and bit intervals. It has no fixed range. It has a finite range i.e. between 0 and 1. It is more prone to distortion It is less prone to distortion. For example, human voice For example, Signals used for transmission in a computer. 2. Why digital signals are used in computer systems? Ans. Information represented in digital form can be easily transmitted. Digital data can be compressed easily. That is why digital signals are used in computer systems. 3. Name the properties of a good communication system. Ans. (i) Delivery (ii) Accuracy (iii) Timeliness 4. Give any three reason why guided communication medium is more reliable than unguided medium. Ans. Guided communication medium is more reliable than unguided medium because: i. It provides high quality transmission at very fast speed. ii. It is not affected by electromagnetic fields iii. It can transmit both analog and digital signals. 5. What is meant by transmission impairment? The errors that occur during data communication from one point to another are called transmission impairments. Types of impairments are: o Attenuation o Amplification o Distortion o Cross talk 6. Differentiate between attenuation and distortion. It does not change the waveform of the signal. It does change the waveform of the signal. Its effects are easy to remove. Its effects are not easy to remove. Its amplitude reduces over the specific amount. Its amplitude reduces over the different amount. 7. What is cross talk? Cross talk occurs in guided media. It is a disturbance caused by electromagnetic fields in telecommunication signals. 8.What is Dial-up modem? Why is it used? i. Dial-up modem provides internet connection through telephone line. ii. Maximum speed of Dial-up modem is 56 Kbps, which is very slow. Uses of Dial-up Modem: i. A telephone line is used for voice transmission which is analog signal. ii. It is also used for internet access. 9: Define data rate and baud rate. Data Rate: Data rate is the speed with which data can be transmitted from one device to another. It is generally measured in Kilobits (thousand bits) or Megabits (million bits) per second. Baud Rate: Baud is the rate of change of electrical signals per second during data communications. An electrical signal can have two or more than two states to represent binary digits 0 and 1. 10. Define bandwidth. i. Bandwidth describes the overall data transmission capacity of a medium. ii. It represents the amount of data that passes through a network connection per unit of time. iii. Bandwidth is also measured in bits per second. LONG QUESTION 1. Describe the components of communication system with the help of diagram. Communication system consists of the following five basic components: Sender: It is the device, which sends the message. For example, telephone handset etc. Receiver: It is the device, which receives the message that can be a computer, radio, telephone handset, etc. Message: It is the data to be transmitted. It can be text, graphics, image, sound or video. Transmission Medium: It is the physical pathway over which the message is sent from sender to receiver. Examples are coaxial cable, Fiber optic cable, microwaves etc.

Protocol: It is the set of rules between the two communicating devices that governs the process of data communication. Without a protocol, two devices may be connected but they cannot communicate with each other. 2. Explain asynchronous and synchronous transmission modes with examples. Asynchronous Transmission: i. The transmission mode in which time interval between characters is not same is known as asynchronous transmission. ii. Each character is transmitted with additional control information which includes start and stop bits. iii. This transmission is slow. Therefore, it is used for communication in system unit and keyboard, mouse. Synchronous Transmission: i. A transmission mode in which time interval between characters is always same is known as synchronous transmission. ii. There is no control information added with the characters. iii. This transmission is fast. Therefore, it is used in computer networks for communication between computers. 3. Describe the following guided media. a) Twisted pair cable: i. It consists of pairs of copper wires twisted around one another. ii. Its transmission speed is from 2-10 million bits per second. iii. It is the most commonly used cable for data communication. b) Coaxial cable: i. It consists of copper wire surrounded by insulating layer. ii. Its transmission speed is from 200-500 million bits per seconds. iii. It is used for local networks and cable television systems. c) Fiber optic cable: i. It consists of smooth hair-thin strands of transparent material. ii. It can transmit trillions of bits per second. iii. It is used for local and world wide networks 4. Describe types of unguided media. Radio Waves: i. Radio waves are propagated by antennas. ii. These waves are invisible and undetectable to human beings. iii. Radio waves are used to transmit music, conversation, pictures and data. Microwaves: i. Microwaves travel through open space and its antennas are installed on high buildings or towers. ii. Microwaves provide much faster transmission rate than telephone lines. iii. Microwaves are used for satellite communication and other long-distance wireless communications. Infra-red: i. Infra-red waves are light energy that we cannot see. ii. It travels through space at the speed of light. iii. Infra-red waves are usually used in remote controls for television, DVD players and other similar devices. Bluetooth: i. It is a wireless communication technology that connect portable electronic devices over short distance. ii. The most common use of Bluetooth is connecting a mobile phone to a wireless headset or to a laptop computer. Satellite: i. A satellite is an object that is placed in an orbit around the earth and revolves around it for communication. ii. Satellite are launched by rockets or space shuttles iii. It is used for transmitting data over long distance at high speed. 5. Describe the functions of the following communication devices. Router: i. It that is used when two or more networks have to be connected for communication. ii. They send information from one network to another by selecting the best pathway available. iii. There are two types of routers i.e. wired and wireless router. Network Interface Card (NIC): i. It card is used to connect computers together to create computer network. ii. It is a card that is installed on the motherboard. iii. There are two types of network cards i.e. Wired network card and wireless network card. Switch/Access Point: i. Switch is used in wired networks whereas access point is used in wireless networks. ii. It receives information from a computer, inspects it and then transmit it to the destination computer.

Guardian Model School System Chapter # 5 COMPUTER NETWORKS Short Questions i. Describe any three difficulties a company may face in running a business without having computer network. A company may face following difficulties without having computer network: i. Nobody can share their files. ii. No computers can share the same printer. iii. No Security of data. 2. What is meant by data transmission? Data Transmission is the process of sending data from one device to another. It consists of sender, receiver and the medium. There are three modes of data transmission: i) Simplex ii) Half-duplex iii) Full-duplex. 3.Differentiate between Half-duplex and Full-duplex transmission modes. Half-duplex Transmission Mode Full-duplex Transmission Mode It can send and receive data in both directions but not at the same time.

It can send and receive data in both directions at the same time.

Its Speed is slow Its Speed is fast Example: ATM machines for withdrawal of cash. Example: Communication over telephone line. 4.Define network architecture? Network architecture refers to layout of network that consists of computers, communication devices, Software, wired or wireless transmission of data and connectivity between components. A computer network can be as small as two computers linked together by a single cable whereas large networks connect thousands of computers and other devices. Types of Network Architectures: (i) Client/server network (ii) Peer-to-peer network (iii)Point-to-point network 5. Differentiate between a server and a client computer. Server Computer Client Computer It is a powerful computer. It is a normal computer. It costs more. It costs less. It can use and manage network resources It can only use network resources 6. Compare LAN and WAN. Local Area Network (LAN) Wide Area Network (WAN) It covers small area. It covers large area. Its speed is fast Its speed is slow. Computer resources can be shared. Computer resources cannot be shared. 7. Mention any three problems which may occur if PTP network is used for a large number of users in an organization. i. No Admin is assigned to control network resources. ii. It became difficult to manage. iii. It does not provide centralized security. 8.What ISDN? i. ISDN stand for Integrated Services Digital Network. ii. It provides a maximum speed of 128kbps. iii. It can transmit both voice and data at the same time over a single cable. 9. Why star topology is more reliable than bus or ring topology? Due to following reasons star topology is more reliable than bus or ring topologies. i. Provides fast communication between computers. ii. Easy to connect new devices to the network. iii. Easy to detect and fix faults. iv. Failure of one computer does not stop functioning of the entire network. 10. What is CDMA technology? i. CDMA stands for Code Division Multiple Access. ii. It is a wireless cellular communication technology. iii. CDMA services include short messaging, voice, data and video transmission. LONG QUESTIONS What are the advantages of using networks? The following are some common uses of networks. Hardware Sharing: i. Network allows sharing of computers hardware such as hard disk and printer etc. ii. There is no need to purchase many computer hardware.

Software Sharing: i. Application software can be installed on a server and shared over the network. ii. There is no need to install it on all the computers in network separately. File Sharing: i. A user can place a file in a shared location on one computer and make it available to other users. ii. Users can access, view and modify information stored on another computer in the network. Internet Sharing: i. A single high-speed Internet connection can be shared with all the users over a network. ii. There is no need to provide separate Internet connection to every user on the network. 2.Describe Client/Server and Peer-to-Peer networks. Client/Server Network: i. A Server is a main computer in a network. ii. Clients are computers in a network that access services from a server. iii. In this network, server shares its resources such as hard disk, printers etc. with client computers. iv. It can be as small as two computers and it can have thousands of computers as well. v. In this network, Administrator is responsible for assigning privileges to all the users of the network. Peer-to-Peer Network: i. In this Network every computer is capable of playing the role of client, server or both at the same time. ii. Each computer on the network is known as peer. iii. A peer can share and access resources on the network. iv. This network is suitable for a small number of users ranging between two to ten computers. v. No single person is assigned to administer the resources of network. 3. Describe the types of networks based on area covered. A) Local Area Network (LAN): i. It is a network that covers a limited area, usually ranging from a small office to a campus of nearby buildings. ii. For example, LAN includes networks within a school, collage, business and organization. iii. Data transmission speed over LAN is fast. iv. Data communication problems rarely occur. v. Transmission medium is owned by the user organization. B) Wide Area Network (WAN): i. It is a network that covers a large area, usually ranging across cities, countries and continents. ii. For examples, WAN are used in banks, airlines and NADRA (Pakistan). iii. Data transmission speed over WAN is slow. iv. Data communication problems often occur. v. Transmission medium is leased lines or satellite links. C) Metropolitan Area Network (MAN): i. It is a network that covers a large area, larger than a LAN but smaller than a WAN. ii. For examples MAN are used by telecommunication companies for providing Cable TV and Internet services. iii. Data transmission speed is slower than LAN but faster than WAN. iv. Transmission medium is Fiber optic cable or microwaves. D) Personal Area Network (PAN): i. It is a network organized around an individual person. ii. For example, Bluetooth. iii. This network is used to transfer files including emails, photos and audio/video files. iv. Personal area networks can be wired or wireless. E) Internet (International Network) i. It is a network that covers all over the world. ii. Computers on the internet are connected together using telephone lines, fiber optics or wireless signals. iii. It allows people to send e-mail, chat with friends around the world and obtain information on any topic, pay bills, do shopping, find jobs, work at home and do reservation for trains, flights, and hotels. 4. Explain the types of network topologies. The physical arrangement of network nodes is called network topology. A node represents a computer. Different types of topologies are explained below. A) Bus topology: It is the simplest network topology. It consists of a single central cable known as bus. All the devices are connected to the bus along its length to communicate with each other. At each end of bus, a device called terminator is attached so that the signals do not bounce back on the bus causing errors.

Advantages of Bus Topology: i. Lowest cost topology to implement due to short cable length. ii. Easy to add new computers. iii. Easy to setup as compared to Star or Mesh topology. iv. Suitable for small networks. Limitations of Bus Topology: i. If bus is damaged at any point, the entire network stops working. ii. Difficult to detect and fix faults. B) Ring Topology: The ring network topology is shaped just like a ring. It is like a bus with both ends connected together. All the messages travel in the same direction message from one mode is sent to the next node. It is received by it if it is addressed to it otherwise if is ignored and passed on to the next until the destination is reached. Advantages of Ring Topology: i. High network performance. ii. Server or switch is not required to manage network. iii. All the computers have equal opportunity to transmit data. Limitations of Ring Topology: i. If ring is broken at any point, the entire network stops functioning. ii. Detection of fault is difficult. iii. If any computer in the ring is not working the whole network is affected. iv. Expensive than Star and Bus topologies. C) Star Topology: In star topology, all the nodes are connected to central device called switch or hub. It is a one of the commonly used network topologies. A switch can connect 4, 8, 16, 24 or 32 nodes. A switch can be connected to another switch to expand the network. Advantages of Star Topologies: i. Provides fast communication between computers. ii. Easy to connect new devices to the network. iii. Easy to detect and fix faults. iv. Failure of one computer does not stop functioning of the entire network. Limitations of Star Topology: i. At least one switch/hub is required for connecting two computers. ii. Lengthy cable is required for connecting two computers. iii. Costly to implement. D) Mesh Topology: In mesh network topology, all the network nodes are connected to all other nodes. Message sent on a mesh network, can take any possible path from source to destination, it is not commonly used since it is costly and difficult to implement. Advantages of Mesh Topology: i. It is the most reliable network topology. ii. Alternative paths are available in case a path is broken from source to destination. Limitations of Mesh Topology: i. Most expensive topology to implement since it requires more cable then Bus, Ring or Star topologies. ii. Difficult to implement as compared to other topologies. iii. Difficult to add new computer. 5. Write a note on Dial-up and DSL Internet Connections. Dial-up Line: It uses standard telephone lines for Internet connection. It required a Dial-up modem that provided a maximum Internet connection speed of 56Kbps. The main advantage of using Dial-up line is that it uses complex network of telephone lines that allows data to be transmitted to almost any location in the world. It is becoming outdated due to very slow Internet connection. DSL: DSL (Digital Subscriber Line) provides a very high speed broadband Internet connection. It is called broadband because it has broad range of frequencies for transmitting digital data. Broadband: Any type of Internet speed that is 256Kbps or above is known as broadband. Internet Service Providers (ISPs) have several DSL speeds available with different monthly rates.

Chapter # 6 COMPUTER ETHICS Short Questions i. Define cybercrime. Ans: Any crime done by means of computer and information technology by having unlawful access to others computers is called cybercrime. ii. What is the importance of computer security? Computer security refers to protecting computer hardware, software and information stored on computer from threats. Importance of Computer Security: i. Computer security or safety is important for computer users to protect their computer from different threats. ii. It is necessary to install security software such as firewall, antivirus and spyware on computers. iii. Differentiate between hacker and cracker. Hacker Cracker They break computers by using their knowledge They break computer by using hacking tools. They break computers for financial benefits. They break computers for serious damage. They have in-depth knowledge of network programming They do not have professional computer skills. iv. Describe any five symptoms of malware. i. The computer does not start or it reboots automatically when it is on. ii. Different types of error messages appear on the screen. iii. Programs do not run in a normal way. iv. Computer runs very slow. v. New files or folders are created on the hard disk. v. Differentiate between authentication and authorization. Authentication Authorization It is a process of validating user to gain user access. It is a process of verifying whether access is allowed or not. It requires user name and password. Its required factors are depending on security level. vi. Which authentication methodology provides highly secure identification and verification? Justify your answer. Ans. Biometrics provides highly secure identification and personal verification Justification: (i) It cannot be borrowed, stolen or forgotten. (ii) Forgiving in biometrics is practically impossible. vii. What is meant by information privacy? Information privacy is the privacy of personal information and usually relates to persona data stored on computer system. viii. Give any three drawbacks of software piracy? (i) It spreads viruses in computers. (ii)It slows down the computers. (iii) It can spy the computer users. ix. What types of problems may be faced if computer users do not comply with moral guidelines of computer ethics? Ans. If computer users do not comply with moral guidelines of computer ethics then: (i) They can use computer to harm other people. (ii) They cannot respect the privacy of others (iii) They can use computer to make illegal copies of copyright software. x. Name any three places where authentication of people is required. Ans. Authentication of people is required when: i. Withdrawing cash from ATM (ii) Opening E-mail Account (iii) Opening security gates LONG QUESTIONS i. Define malware and describe its types. Malware: Malware is malicious software. It comprises of a number of harmful software that are threats to all computer users. Malware is created for attack on privacy, spying, destruction and financial benefits. Types of malware: Most common types of malware are Computer viruses, Worms, Spyware and Adware. Computer Viruses: 1. It spreads by inserting a copy of itself into another program or file. 2. Most of the viruses are attached to executable files. 3. Viruses can slow down the computer. 4. For example, MyDoom virus quickly infected the million computers in 2004. Worms: 1. It transmits itself over a network to infect other computers. 2. It spreads automatically in computer networks and replicates itself. 3. It can travel from computer to computer without any human action 4. For example, Code Red and Fizzer

Spyware: 1. Spyware are developed to spy computer users by gathering information about their activities on the computer. 2. It infects computers through installation of software from internet. 3. It slows down the performance of infected computer. 4. For example, Flame. Adware: 1. It attaches itself to free software on the internet and infects computer when such software is downloaded. 2. It pops up advertisements during execution of infected program. 3. Some adware may also collect user information without their permission. ii. Explain how malware spreads. The malware spreads by the following ways: Infected Flash Drives/CDs: It is a very major source of spreading malware on computer because these are often infected. Pirated Software: Pirated software on CDs is a very common source of spreading malware on computers because these are often infected. Network and Internet: Computers connected to network get infected with malware when information is exchanged with other computers. Computers are also infected while using Internet when users download something or browse infected Web sites. E-mail Attachments: Opening e-mail attachments from a stranger or from an unknown address can infect computer with malware. iii. Explain how to protect computer systems from virus attacks. We have to install the following software to safeguard computer against viruses, worms, adware and spyware: Antivirus software: i. It is a computer program that detects and removes viruses and other types of malware. ii. Computer user should install it on computer and update it regularly. iii. Whenever a user connects a flash drive or any other type of storage device to computer, he must run it through antivirus software to ensure that it does not contain virus. iv. Some commonly used antivirus programs are Avira, AVG and Avast Antivirus etc. Anti-spyware programs: i. It helps to protect computer against security threats caused by spyware. ii. Computer user should install it on computer and update it regularly. iii. Anti-spyware program runs in the background of computer and continually scans for spyware threats. iv. Some commonly used Anti-spyware programs are Norton Anti-spyware, Spyware Doctor and AVG Anti-spyware. iv. What are the common methodologies used for authentication purpose. Following are common methodologies used for authentication purpose. Username and Password: The username and password combination are known as login information. Username and password are used to authorize users to have access to computer systems, e-mail account, bank account and other services available on computer. Personal Identification Number (PIN): PIN is a confidential numeric password used to authenticate a use to get access to a computer system. PINS are most commonly used with debit and credit cards in retail stores and many other places for payment of bills. Access Cards: Access cards are very similar in appearance to credit cards. They are commonly used to open security gates in offices and many other places. Biometrics: Biometrics refers to authentication methods based on physical characteristics of individuals such as features of face, geometry, retina, voice and fingerprint. Biometrics based systems are used for financial transactions, electronic banking and personal data privacy. v. Define computer ethics and write some important moral guidelines for ethical use of computer technology. Computer ethics means an acceptable behavior for using computer technology. Ethical Use of Computer: i. Computer should not be used to harm other people. ii. Computer users should not read documents and e-mails of others. iii. People should not make illegal copies of copyright software. iv. We should not use bad language while chatting. v. Computer user should be honest, respect the rights of others vi. Computer Programmers should not create malicious software.

Guardian Model School System Chapter # 1 PROGRAMMING TECHNIQUES Short Questions i. Define Computer. A computer is an electronic data processing device. It reads data, process it and produces results accurately at a very high speed. ii. What is algorithm and what is the role of algorithm in problem solving? Algorithm: A set of steps that clearly defines a sequence of operations to solve a problem is called Algorithm. Role of Algorithm in Problem Solving: Formulating an algorithm is the first step for developing a computer program. iii. What is a flowchart? Flowchart is a diagrammatic representation of algorithm. It describes what operations are required to solve a given problem. iv. What are the advantages of using flowcharts? i. It describes what operations are required to solve a given problem. ii. It also helps in finding and removing errors in computer programs. iii. Once, the flowchart is drawn, it becomes very easy to write the program in any high-level language. v. Draw any four graphical symbols used in flowchart and explain them. Flow line: It is a line with arrow head. It indicates the flow of control. Start/Stop Symbol: It is a rounded rectangular shaped. It is used to indicate the start or end of a flowchart. Input/Output Symbol: It is represented by parallelogram. It indicates input or output operations Processing Symbol: It is represented by a rectangular block. It is used for data processing operation. Decision Symbol: A diamond shaped symbol represents decision in flowchart and it contains a condition. LONG QUESTIONS i. Describe the steps involved in problem solving? The following five steps are involved in problem solving on computer. 1) Defining the Problem: Defining the problem is first stage of problem solving. It’s very important to understand the problem before the programmer starts working on its solution. The following are the steps to properly define and understand the problem.  Carefully read the problem to understand what it tells.  Find out what the problem asks to do.  What information can be obtained from the problem?  What is required to be calculated as the solution of the problem? 2) Analyzing the Problem: The programmer investigates the problem and gathers as much information as possible to find a solution. The following questions can be asked to analyze the problem.  Is it possible to solve the problem on a computer?  What is to be done to find the solution of the problem?  What is the proper and what output is required?  How many solutions are possible?  Which solution is the best and why?  How solution will be implemented?

3) Planning The Solution Of The Problem: It refers to dividing the solution of any problem into steps and arranging them into proper order. How to Discuss a Problem:  Talk to the right person.  Focus on talking about the problem only.  Stay calm and reasonable.  Explain the problem in detail and provide any evidence you may have.  Tell them what outcome you want.  Listen to their response.  Does his/her response resolve your issue? 4) Candid Solutions of a Problem: All the possible solutions of a problem that produce correct result are known as candid solutions. To find candid solutions of a problem, programmer has to look for different methods to solve the problem and come up with several solutions. 5) Select The Best Solution: After finding the candid solutions, only one solution can be selected. The selection of final solution of a problem should be based on the following criteria: Speed: It means when the solution is implemented in a programming language, the program should run fast. Cost: The selected solution should be cost-effective. Complexity: The selected solution of the problem should not be complicated. ii. Write an algorithm to calculate the area of a rectangle for given breadth and length. Step 1 Input the breadth (B) and Length (L) of a rectangle Step 2 Calculate the area (A) by multiplying L with B Step 3 Print A iii. Write an algorithm that inputs length in inches and calculate and prints it in centimeters. Step 1 Input the length in inches (LI) Step 2 Calculate the length in cm (LCM) by multiplying LI with 2.54 Step 3 Print LCM iv. Write an algorithm that inputs marks and prints the message “PASS” or “FAIL”. Passing marks are 33. Step 1 Input Marks (M) Step 2 Check if (M<33) then Print “FAIL” GOTO Step 4 Step 3 ELSE Print “PASS” Step 4 Stop v. Write an algorithm to find the sum of given sequence. Step 1 Start Initialize Sum to 0 and K=5 Step 2 Add K to SUM SUM=SUM+K Step 3 Increment K by 5 K=K+5 Step 4 Check if the value of K is less than or equal to 60 IF K≤100 THEN GOTO Step 2 otherwise GOTO Step 5 Step 5 Print SUM Step 6 Stop vi. Write an algorithm to find the product of given numbers. PRODUCT = 1×3×5×7×9×11×13×15 Step 1 Start Initialize variable K to 1 and prod = 1 K=1 Prod= 1

Step 2 Increment K by 2 K=K+2 Step 3 Find the Product Prod=Prod × K Step 4 Check if the value of K is less than 16 IF K<16 THEN GOTO Step 2 otherwise GOTO Step 5 Step 5 Print product Print Prod Step 6 Stop vii. Write an algorithm to print multiplication table of a number in reverse order. Step 1 Enter the number N whose table is to be generated Step 2 Initialize the value of 1 with 10 L = 10 Step 3 Find the product of N and I Prod= N × L Step 4 Print N, L and Prod Print N L and Prod Step 5 Decrease the value of L by 1 L=L–1 Step 5 IF the value of L is > 0 THEN GOTO Step 3 Otherwise GOTO Step 6 Step 6 Stop viii. Write a Flowchart to calculate the Write a Flowchart to that input length in inches area of a rectangle for given breadth and length. and calculate and prints it in centimeters.

Start

Start

Input L, B

Input Length LI • LI = length in inches

Area = L * B

LCM = LI * 2.54

Print Area

Print LCM

Stop

Stop

Write a Flowchart to that inputs marks and prints the message “PASS” or “FAIL” Passing marks are 33.

Start

Input Marks (M)

IF M < 33

Print LCM

Stop

• LCM = length in centimeter

Write a Flowchart to find the sum of given sequence. SUM = 20+25+30+40+45+50+55+60

Start

SUM 20, K = 20

SUM = SUM + K K= K+5

NO

YES

IF K < 60 Print SUM

Stop Write a Flowchart to find the product of given numbers. PRODUCT = 1×3×5×7×9×11×13×15

Start

Prod = 1 , K = 1

Prod = Prod * K K=K+2

YES

NO

IF K < 16 Print Prod

Write a Flowchart to print multiplication table of a number in reverse order. Start

Stop

Enter a Number N J = 10

Prod = N * J

Print N, J, Prod J=J–1

IF J > 0

Stop

Guardian Model School System Chapter # 7 WWW & HTML SHORT QUESTION i. Differentiate between website and Web server. Website A website is a collection of web pages. A URL is typed in Web browser and ENTER button is pressed to view it.

Web server A Web server is a computer that makes Web pages available through the internet Web servers deliver HTML documents when a user types a URL in browser.

ii. Describe how a search engine is used for searching information on the Internet. i. Users type in one or more keywords in a search engine. ii. The search engine will look for matches found from all over the Web. iii. User will see the total number of matches found. iv. Most popular search engines are Yahoo! And Google. iii. Define URL and Web hosting. URL: Uniform Resource Locator (URL) is an Internet address that identifies a website. Web Hosting: Web Hosting is a service that uploads a website on a Web server and makes it available for computer users. iv. Describe HTML. i. HTML stands for Hypertext Mark-up Language. It is called mark-up language because it uses mark-up tags that tell the Web browser how to display the Web page. ii. Websites and Web pages are written in HTML. iii. It is used to create hypertext documents that bring together text, pictures, sounds, video clips and links all in one place. iv. HTML files are plain text files, so they can be created using a simple editor such as Notepad or WordPad. LONG QUESTION ` 1. Describe any four types of websites. a) Web Portals: i. Web portal is a website that offers a large variety of services. ii. These include online shopping malls, news, stock prices, e-mail, search engines, etc. iii. For example, a school Web portal delivers information about the school curriculum, fees structure, student results, etc. b) News Websites: i. News websites provide information about current events and opinions. ii. These sites publish news stories and let their visitor’s voice be heard. iii. For example, www.paktribune.com, www.dailytimes.com etc. c) Information Websites: Information websites provide information on any topic in the form of text, graphics, sounds and videos. It allows users to contribute and edit articles as well. For example, www.wikipedia.org, www.wikihow.com etc. d) Educational Websites: i. Educational websites are created for educational purpose. ii. These sites contain animation, slide presentation and tutorials to educate people on various topics. iii. For example, www.sabaq.com, www.ilmkidunya.com etc. 2. Write the HTML tags for the following? i) Paragraph: The

tags are used to define paragraph. ii) Heading: There are six heading tags,

to
. iii) Bold:

The tags will make the text bold iv) Underline: The tags are used to underline the text. v) Italic: The tags are used to make the text italic. vi) Center text: The
tags will make the text centered. vii) Strike out: The <strike> tags will put a line right through the center of the text. viii) Superscript: The <sup> tags are used to convert the text to superscript. ix) Subscript: The <sub> tags are used to convert the text to subscript. x) Font size, color and typeface: The tags are used to change the font size. Replace the ? symbol with a number in the range 1 to 7. The tags are used to change the color of text. Replace the ? symbol with color such as black, blue, etc. The tags are used to change the font face of text. Replace the ? symbol with font face such as arial, Calibri etc. xi) Inserting Line Breaks: The
tag is line break tag. It is used to end a line wherever it is placed and it does not have a closing tag. xii) Inserting Spaces: If user wants to have many spaces in HTML document then   (non-breaking space) character entity must be used. 3. Describe how background color and image are applied to Web page. To apply a background color in a page, insert the background color attribute and for foreground color, insert text attribute in the tag Applying Background Image: An image can be set as background of a page using the background attribute in the tag. 4. Create an HTML document that contains a graphical hyperlink. Creating a Graphical Hyperlink: The syntax for creating a graphical hyperlink to another Web page is For example: It will display the image.jpg image file in the browser window. When the reader moves the mouse pointer over the image, it will change to a small hand and clicking on the image will open the Federal Board website that has the URL www.fbise.edu.pk. 5.Describe the tags used for creating a table in HTML. Tables are very often used in Web pages to present information in an organized manner which is easy to read and understand by the user. A table consists of rows and columns. The following tags are used for creating a table.
: These tags are used to create a table. : These tags define a row. : These tags define data cell. Column of each row is called data cell. A data cell can contain text, image, paragraph, etc.

Guardian Model School System Chapter # 2 Programming in C SHORT QUESTION 1. Define computer program. A computer program is a set of instructions (statements) written in a programming language to solve a problem. 2. Differentiate between syntax and semantic. Syntax Semantic It refers to the rules of a programming language. It gives meaning to statements of a programming language. Its errors are handled at the compile time. Its errors are difficult to find and encounter at the runtime. It validates the operations to be performed. It describes the sequence of operations to be performed. 3. Write three differences between assembly language and HLLs. High Level Languages (HLLs) Assembly Language These are easily understandable. These are not easily understandable Debugging process is easy. Debugging process is not very easy Written program is not machine dependent Written program is machine dependent 4. Write four characteristics of HLLs. i. They are easy to learn and use. ii. They are not machine dependent. iii. Debugging is easier. iv. Its source codes are easily understandable by another programmer. 5. Define Integrated Development Environment (IDE). i. IDE is computer software that brings all the processes and tools required for program development into one place. ii. Its aim is to make the life of programmers easier. 6. Differentiate between constant and variable. Constants Variable Constants are quantities. Variables are Symbolic names. Its value cannot be changed during program execution. Its value can be changed during program execution. Its value cannot modifies once declared. Its value can be modified once declared. 7. Which of the following are valid C variables? Give the reason if not a valid variable area, 5x, Sum, net pay, float, _age, else, case, size22, My_weight? Valid Variables: My_weight, Area, size22, Sum, _age Not Valid Variables Reasons 5x A variable can’t be start with number Net pay Space can’t be used in variable name Float Data types can’t be used in variable name Else Commands cannot be used as variable name Case Commands cannot be used as variable name 8. What are reserved words? Why they should not be used as variable names. i. The words that are part of programming language and have special purposes in computer programs are called reserved words or keywords. ii. There are 32 reserved words and always written in lowercase. iii. They have predefined use and cannot be used for any other purpose. 9. Why comments are used in programs? Comments are used in programs because: i. It explain what the program intended to achieve. ii. It makes the program understandable for others. 10. What is the use of typecasting in C programs? Typecasting is a method to convert a variable from one data type to another data type during program execution. For example, a variable of type int can act as a variable of type char using typecasting. LONG QUESTION ` 1. Describe the following HLLs. C/C++, Visual Basic, C# and Java C: i. C was developed in early 1970s by Dennis Ritchie at Bell Laboratories. ii. It is a highly structured programming language which is easy to understand and use. iii. It is used for writing all types of application programs. C++: i. C++ was developed by Bjarne Stroustrup also at Bell Laboratories during 1983-1985. ii. It is a superset of C, meaning that any valid C program is also a valid C++ program. iii. Its purpose of developing was to provide more programming facilities.

Visual Basic: i. Visual Basic (VB) is a high-level language which evolved from the earlier version called BASIC. ii. It provides a graphical development environment. iii. VB is commonly used for developing business programs such as payroll system and inventory control program. C#: i. C# (C-sharp) is a language developed in 2000 by Microsoft Corporation. ii. Syntax of C# is very similar to C and C++. iii. All types of programs including games, OS, compilers, business and Web based applications can be developed in C#. Java: i. Java is a high-level language developed by Sun Microsystem. ii. Java is an ideal language for network computing. iii. It is widely used in web applications. 2. Differentiate between compiler and interpreter. Compiler Interpreter It takes an entire program at a time It takes a single instruction at a time. It generates intermediate object code. It does not generate intermediate object code. It is faster. It is slower. It requires more memory. It requires less memory. Error detection is difficult. Error detection is easy. It displays all errors after compilation at the same time. It displays error of each line one by one. Compilation is done before execution. Compilation and execution take place simultaneously. C, C++, C# uses compiler. PHP, Perl, Python uses interpreter. 3. Describe the functions of linker and loader programs. Linker: i. It generates the executable module of source program. ii. It takes as input, the object code generated by an assembler. iii. It combines all the object modules of a source code to generate an executable module. Loader: i. It loads the executable module to the main memory. ii. It takes executable module generated by linker. iii. It allocates the addresses to an executable module in main memory for execution. 4. What are the rules for specifying a variable name in C language? i. Every variable name should start with alphabets or underscore (_). ii. Special characters are not allowed e.g. #, @, $ etc. iii. Reserved words of C language such as int, case, if, etc. cannot be used as variable names. iv. There must be no blank in the name of variable, e.g. (my weight) is incorrect. v. An upper-case letter is considered different from a lower-case letter, e.g. the variable AVG is different from avg. 5. What is the difference between implicit type casting and explicit type casting? Give examples. Typecasting is a method to convert a variable from one data type to another data type during program execution. Implicit type casting is performed by the compiler on its own when it encounters a mixed data type expression in the program. it is also known as automatic conversion as it is done by compiler without programmer’s assistance. implicit casting doesn’t require a casting operator. Example: 1. int a=42; 2. float b=a; here b will contain typecast value of a, because while assigning value to b compiler typecasts the value of a into float then assigns it to b. Explicit type casting is performed by the programmer. In this type casting programmer tells compiler to type cast one data type to another data type using type casting operator. but there is some risk of information loss is there, so one needs to be careful while doing it. Example :1. float a=42.12; 2. int b=(int)a; here we explicitly converted float value of a to int while assigning it to int b. (int) is the type casting operator with the type in which you want to convert.

6. What is a Preprocessor Directive? Give Examples. i. ii. iii. iv. v.

Preprocessor directive are instructions for the C compiler. Every language program contains certain preprocessor directives at the beginning of the program. Before translating a C language program into machine language, the compiler of C language carries out the processor directives. These directives start with number sign (#) The most commonly used preprocessor directives are include and define.

The include Preprocessor Directive: It has the following syntax. #include
When this preprocessor is carried out by the C compiler, it will search for the header file that is written within the less than (<) and greater than (>) symbols and copy it into the source file. For example, when we include stdio.h in any program, it tells the C compiler to copy the stdio.h header file into the program. The stdio.h header file stand for standard input-output header. It includes the standard prindf() and scanf() function prototypes. In the above program the printf() function is used. Therefore, it is required to include this header file in the include preprocessor directive. The define Preprocessor Directive:  The define preprocessor is used for defining constants (i.e. Symbolic constants) in C programs.  It directs the compiler to replace all the occurrences of using this directive are to give a meaningful name to a constant value that is to be used in the program.  It has the following syntax. #define SYMBOL value/expression  Here, SYMBOL is a valid C variable name and it is by convention written in uppercase. An example of define preprocessor directive is given below. #define HEIGHT 12  This preprocessor directive tells the compiler to replace all the occurrences of the variable HEIGHT with the value 12, in the program during its execution. #define CUBE(a) (a*a*a)  It can be used in a program as given below. volume=CUBE(side);  The volume will be calculated as: volume=(side*side*side);

Guardian Model School System Chapter # 6 SHORT QUESTION 1. What is a logic gate? i. Logic gates are the basic building blocks of digital computer. ii. Logic gates operate on two voltage levels and process digital signals which represent binary digits 0 and 1. 2. Define truth table. i. A truth table represents a digital logic circuit in table form. ii. It shows how a logic circuit’s output responds to all the possible combinations of the inputs using logic ‘1’ for true and logic ‘0’ for false. 3. Define Boolean function. i. A Boolean function is an expression formed with binary variables, the logical operators (OR, AND and NOT), parenthesis and equal sign. ii. All binary variable can take the value of 0 or 1. 4. What is Karnaugh map and why is it used? i. K-map is a pictorial form of a truth table. ii. It consists of square boxes called cells. iii. All the possible combinations of variables involved in a Boolean function are written inside the cells in their respective positions. LONG QUESTIONS 1. Draw the graphical symbols of AND, OR, NOT, NAND and NOR gates and write their functions. There are three basic logic gates used in digital circuits which are AND, OR and NOT gates. AND GATE: i. The AND gate has two or more inputs that can be LOW (0) or HIGH (1), The output is HIGH only when all the inputs are HIGH. ii. It produces a LOW output when at least one of the inputs is LOW. iii. The logic operation of a two-input AND gate is shown in Fig, with all the possible input combinations and the resulting output for each. LOW LOW LOW

LOW

HIGH LOW

HIGH

LOW LOW

HIGH

HIGH HIGH

OR Gate: i. The OR gate has two or more inputs, the output of an OR gate is LOW only when all the inputs are LOW. ii. The output is HIGH when one or more of its inputs are HIGH iii. The logic operation of a two-input OR gate is shown in Fig, with all the possible input combinations and the resulting output for each. LOW LOW LOW

HIGH

HIGH

LOW

HIGH

HIGH LOW

HIGH

HIGH HIGH HIGH

NOT Gate: i. The NOT gate performs the functions of inversion. Therefore, it is also known as inverter. It has a single input. ii. The output of a NOT gate is HIGH when the input is LOW and vice versa. LOW

HIGH

HIGH

LOW

NAND Gate: i. The NAND gate combines the AND and NOT gates, such that the X ̅̅̅̅ XF =𝑋𝑌 output will be 0 only when all the inputs are 1 as shown in Fig. Y ̅̅̅̅ which indicates that inputs x and y ii. Its logic expression is F = 𝑋𝑌 are first ANDed and then the result is inverted. Inversion is indicated by a bar. iii. Thus, a NAND gate always produces an output that is the inverse (opposite) of AND gate. The NOR Gate: i. The NOR gate combines the OR and Not gates, such that the X output will be 0 when any input is 1 as shown in FIG. F = ̅̅̅̅̅̅̅̅ 𝑋+𝑌 Y ii. Its logic expression is F = = ̅̅̅̅̅̅̅̅ 𝑋 + 𝑌, which indicates that x and y are first ORed and then the result inverted. Inversion is indicated by a bar. iii. A NOR gate always gives an output that is the inverse of OR gate.

X 0 0 1 1

Y 0 1 0 1

F 1 1 1 0

X 0 0 1 1

Y 0 1 0 1

F 1 0 0 0

2. Explain how NAND and NOR gates can be created using AND, OR and NOT gates. Creating NAND Gate Using Basic Gates: The NAND gate can be easily created by using an AND gate and a NOT gate as shown in Fig. F = XY

X

̅̅̅̅ F =𝑋𝑌

Y

Creating NOR Gate Using Basic Gates: The NOR gate can also be created in a similar way by using an OR gate and a NOT gate as shown in Fig. X

F = X+Y ̅̅̅̅̅̅̅̅ F =𝑋 +𝑌

Y

3. Draw truth table of the following Boolean functions. F1= 𝑋̅𝑌𝑍̅ + 𝑋̅𝑌𝑍 + 𝑋𝑌𝑍̅ X Y Z 𝑋̅ 𝑍̅ 𝑋̅𝑌𝑍̅ 𝑋̅𝑌𝑍 𝑋𝑌𝑍̅ F1 1 1 1 0 0 0 0 0 0 1 1 0 0 1 0 0 1 1 1 0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 1 1 1 0 0 1 0 1 0 1 0 1 1 1 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 F3= ̅̅̅̅̅̅ 𝑋𝑌𝑍 + ̅̅̅̅ 𝑋𝑌𝑍 + 𝑋̅𝑌𝑍 + 𝑋𝑌𝑍̅ ̅̅̅̅̅̅ X Y Z 𝑋̅ 𝑌̅ 𝑍̅ 𝑋𝑌𝑍 1 1 1 0 0 0 0 1 1 0 0 0 1 0 1 0 1 0 1 0 0 1 0 0 0 1 1 0 0 1 1 1 0 0 0 0 1 0 1 0 1 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1

̅̅̅̅𝑍 𝑋𝑌 0 0 0 0 0 0 1 0

𝑋̅𝑌𝑍 0 0 0 0 1 0 0 0

X 1 1 1 1 0 0 0 0

𝑋𝑌𝑍̅ 0 1 0 0 0 0 0 0

F3 0 1 0 0 1 0 1 1

Y 1 1 0 0 1 1 0 0

Z 1 0 1 0 1 0 1 0

F2= 𝑋̅𝑍 + 𝑌𝑍̅ + 𝑋𝑌𝑍 𝑋̅ 𝑌̅ 𝑍̅ 𝑋̅𝑍 𝑌𝑍̅ 0 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 1 1 0 0 1 0 0 1 0 1 0 1 0 1 1 1 0 1 0 1 1 1 0 0

X 1 1 1 1 0 0 0 0

F4= 𝑋𝑍̅ + ̅̅̅̅ 𝑋𝑌 Y Z 𝑋̅ 𝑌̅ 1 1 0 0 1 0 0 0 0 1 0 1 0 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 0 0 1 1

𝑍̅ 0 1 0 1 0 1 0 1

XYZ 1 0 0 0 0 0 0 0

𝑋𝑍̅ 0 1 0 1 0 0 0 0

̅̅̅̅ 𝑋𝑌 0 0 0 0 0 0 1 1

F2 1 1 0 0 1 1 1 0

F4 0 1 0 1 0 0 1 1

4. Simplify the Boolean functions of Question 5 using Karnaugh map. ̅ 𝒀𝒁 ̅+ 𝑿 ̅ 𝒀𝒁 + 𝑿𝒀𝒁 ̅ ̅ 𝒁 + 𝒀𝒁 ̅ + 𝑿𝒀𝒁 F1= 𝑿 F2= 𝑿 ̅ F2= 𝑋𝑍(𝑌 + 𝑌̅) + 𝑌𝑍̅ (𝑋 + 𝑋̅) + 𝑋𝑌𝑍 𝑌 𝑌̅ ̅̅̅̅𝑍 + 𝑋𝑌𝑍̅ + 𝑋̅𝑌𝑍̅ + 𝑋𝑌𝑍 F2= 𝑋̅𝑌𝑍 + 𝑋𝑌 𝑋̅𝑌𝑍

𝑋̅

𝑋𝑌𝑍̅

𝑋 𝑍̅

𝑍 F1= 𝑋̅𝑌𝑍 + 𝑋̅𝑌𝑍̅ + 𝑋̅𝑌𝑍̅ + 𝑋𝑌𝑍̅ F1= 𝑋̅𝑌(𝑍 + 𝑍̅) + 𝑌𝑍̅(𝑋̅ + 𝑋) F1= 𝑋̅𝑌 + 𝑌𝑍̅

𝑌̅

𝑋̅𝑌𝑍̅

𝑍̅

𝑌 ̅̅̅̅ 𝑋𝑌𝑍

𝑋̅ 𝑋 𝑍̅

𝑋̅𝑌𝑍

𝑋̅𝑌𝑍̅

𝑋𝑌𝑍

𝑋𝑌𝑍̅

𝑍̅ 𝑍 F2 = ̅̅̅̅ 𝑋𝑌𝑍 + 𝑋̅𝑌𝑍 + 𝑋̅𝑌𝑍 + 𝑋̅𝑌𝑍̅ + 𝑋𝑌𝑍 + 𝑋𝑌𝑍̅ F2 = 𝑋̅𝑍(𝑌̅ + 𝑌) + 𝑋̅𝑌(𝑍 + 𝑍̅) + 𝑋𝑌(𝑍 + 𝑍̅) F2 = 𝑋̅𝑍 + 𝑋̅𝑌 + 𝑋𝑌 F2 = 𝑋̅𝑍 + 𝑌(𝑋̅ + 𝑋) F2 = 𝑋̅𝑍 + 𝑌

̅ 𝒀𝒁 + 𝑿𝒀𝒁 ̅ F3= ̅̅̅̅̅̅ 𝑿𝒀𝒁 + ̅̅̅̅ 𝑿𝒀𝒁 + 𝑿 𝑌̅ 𝑋̅

̅̅̅̅̅̅ 𝑋𝑌𝑍

̅̅̅̅𝑍 𝑋𝑌

̅ + ̅̅̅̅ F4= 𝑿𝒁 𝑿𝒀 ̅̅̅̅ (𝑍 + 𝑍̅ ) F4= 𝑋𝑍̅(𝑌 + 𝑌̅) + 𝑋𝑌 ̅ ̅̅̅̅ F4= 𝑋𝑌𝑍 + 𝑋𝑌𝑍 + ̅̅̅̅ 𝑋𝑌𝑍 + ̅̅̅̅̅̅ 𝑋𝑌𝑍 𝑌̅

𝑌 𝑋̅𝑌𝑍

𝑋 𝑍̅

𝑍

𝑍̅

𝑋̅

̅̅̅̅̅̅ 𝑋𝑌𝑍

𝑋

̅̅̅̅ 𝑋𝑌𝑍 𝑍̅

𝑌

̅̅̅̅𝑍 𝑋𝑌 𝑋𝑌𝑍̅ 𝑍

̅̅̅̅ + 𝑋𝑌𝑍̅ + ̅̅̅̅̅̅ F4= 𝑋𝑌𝑍 𝑋𝑌𝑍 + ̅̅̅̅ 𝑋𝑌 𝑍 ̅̅̅̅(𝑍̅ + 𝑍) F4= 𝑋𝑍̅(𝑌̅ + 𝑌) + 𝑋𝑌 F4= 𝑋𝑍̅ + ̅̅̅̅ 𝑋𝑌

𝑍̅

Guardian Model School System Chapter # 3 Input and Output Handling SHORT QUESTION i. Why format specifier is used? Explain with examples. A format specifier is computer code that tells about the data type, field, width and the format according to which a value is to be printed or read from an input device. Following are the commonly used format specifiers: %d = Decimal Integer %i = integer %ld = long decimal integer %f = floating-point (decimal notation) %g = floating-point (exponential notation) %e = floating-point (%f or %g, whichever is shorter) %c = single character %s = string ii. Why escape sequence is used? Explain with examples. The special characters used in C language to control printing on the output device are called escape sequences. These characters are not printed. An escape sequence is a combination of a backslash (\) and a code character. The backslash is called the control character. A list of commonly used escape sequences is given below: Escape Sequence Meaning \a Produces alert (bell) sound \b Moves cursor backward by one position \n Moves cursor to the beginning of next line \r Moves cursor to the beginning of current line \t Moves cursor to the next horizontal tabular position \\ Produces a backslash \’ Produces a single quote \” Produces a double quote \? Produces a question mark iii. What is the purpose of gets() function? The gets() functions is used to read a string from the keyboard and store it in the variable specified inside the parenthesis. iv. Differentiate between getch() and getche() functions. Ans. The only difference between them is: getche() give output without any buffer but the getch() give output with buffer. v. Evaluate the following expressions. 7+5*(3+4) 100/10/4 50%13%3 = 7+5*7 = 10/4 = 11%3 = 7+35 = 2.5 =2 = 42

30/7*3-6 = 4.28*3-6 = 12.8-6 = 6.8

vi. What will be the output of the following program? #include <stdio.h> Void main(void) { int x,y,z1,z2,z4,z4 Y=5; Ans: Output: y=5; Z1 = 3 printf(“\nz1=1=%d”,z1)’ Z2 = 2 z2=x%y’ Z3 = 18 z3=++z’ Z4 = 5 printf(“\nz2=%d”,z2)’ z3=++z’ printf(“\nz4=%d”,z4); } }

vii. What will be the output of the following Program? #include<stdio.h> Void main(void) { int b; floata,c,d,e,f; a=1484; b=7; Ans: Output: c=a-b; C= 7.840000 printf(“\nc=%f”,c); D = 2.120000 d=a/b; E = 6.160000 printf(“\nd=%f”,d); F = 10.920000 e=a-b3; printf(“\ne=%f”,e); f=(a+b)/2; printf(“\nf=%f”,f);

LONG QUESTIONS i. Describe how basic and compound assignment operators are used? Basic Assignment Operator: i. The basic assignment operator is =. ii. This is used to assign value of an expression to a variable. iii. It has the general form: Variable = expression iv. Where expressions may be a constant, another variable to which a value has previously been assigned or a formula to be evaluated. For example: Sum = a + b; Compound Assignment Operators: i. In addition to =, there are a number of assignment operators unique to C. ii. These include +=, -=, *=, /= and %=. iii. Suppose op represents an arithmetic to assign value of an expression to a variable. Variable op = expression iv. This is equivalent to: Variable = variable op expression v. For example, consider the following statement: Sum = sum + n; vi. This assignment statement could be written using a compound assignment operator as: Sum += n; vii. The effect is exactly the same but the expression is more compact. Some more examples are: Sum -= n is equivalent to sum = sum – n Prod*= n is equivalent to prod = prod * n a /= b is equivalent to a = a / b a %= b is equivalent to a = a % b ii. Describe the functions of the following operators? i) Relational ii) Logical iii) Conditional A) Relational Operators: i. These are used to compare two values of the same type. ii. These are used in expressions when a decision is to be based on a condition. iii. After evaluation of a relational expression, the result produced is either True of False. iv. Relational operators are used in programming for decision making. v. There are six types of relational operators in C language. These are described in table below: Operator Definition == Equal to != Not equal to < Less than > Greater than <= Less than or equal to >= Greater than or equal to B) Logical operators: i. Logical operators are used for building compound conditions. ii. A single condition is built using a relational operator in an expression. iii. If we need to build more than one condition for some action to take place programming, then we have to form compound condition. They have following types: Operator Definition && AND || OR ! NOT C) Conditional Operator i. A conditional operator is a decision-making operator. It has the following form. Condition? expression1: expression2: ii. When this statement is executed, the condition is evaluated. If it is true, the entire conditional expression takes on the value of expression1. If it is false, the expression takes on a value and can therefore be used in assignment statements.

Write a program that reads three numbers and prints their sum, product and average. #include <stdio.h> int maint() { int num1, num2, num3, sum, prod, avg; printf(“Enter the three numbers separated by ‘,’\n”); scanf(“%d, %d, %d, &num1, &num2, &num3); sum = num1 + num2 + num3; prod = num1 * num2 * num3; avg = sum/3; prinf(“the sum of the three numbers is : %d\n”,sum); printf(“the prod of the three numbers is : %d\n”,prod); printf(“the average of the three numbers is : %d\n”, avg); } Write a program that reads the length and width of a rectangle and prints its area. #include <stdio.h> main() { float length, width, area; printf(“Enter length of rectangle:”); scanf(“%f”, &length); printf(“Enter width of rectangle:”); scanf(“%f”, &width); area= length*width; printf(“Area of rectangle - %f sq. units “,area); } Write a program that reads the length of one side of a cube and prints its volume. #include <stdio.h> #include main() { float side, volume; printf(“Enter length of any side of cube\n”); scanf(“%f”, &side); printf(“Volume of Cube: %0.4f\n, volume); } Write a program that reads temperature in Celsius, Converts it into Fahrenheit and prints on the screen. #include <stdio.h> #include main() { float fahren, celsius; printf(“Enter the temperature in celsius\n”); scanf(“%f”, &celsius); fahren =(9.0/5.0)*celsius + 32; prinft(“%.2fC is equal to %.2fF\n:, celsius, fahren); } Write a program that reads name and address of a person and prints it on

the screen using gets() and puts() functions. #include <stdio.h> #include <string.h> int main() { char name[50], add[50]; printf(“Enter your name:”); gets(name); printf(“Enter your address:”); gets(add); printf(“Your name is:”); puts(name); printf(“Your address is:”); puts(add); }

Guardian Model School System

Chapter # 4 Hazrat Asma (RA)

Q-1. What happened when Abu Jehl asked about Hazrat Abu Bakar (RA)? Ans. Hazrat Asma (RA) simply posed a counter question. She politely replied, “How would I know”? Q-2. Why was Abu Quaffa (RA) worried? Ans. He was worried about the gold, jewels and money that had taken away by Hazrat Abu Bakar (RA). Q-3. How did Hazrat Asma (RA) console her grandfather? Ans. She put some pebbles at the place of money and jewels and covered them with a piece of cloth. She made her grandfather touch them and said that Hazrat Abu Bakar (RA) had left all his wealth at home. In this way, she wisely consoled her grandfather. Q-4. Who was Hazrat Abdullah Bin Zubair (RA)? Ans. He was the son of Hazrat Asma (RA). Q-5. Which incident in the story showed Hazrat Asma’s (RA) love and respect for the Holy Prophet (SAW)? Ans. Every night, without taken any care for her life, she would quietly venture towards the cave of Thaur to supply food to the Prophet of Allah (SAWW). It shows her love and respect for the Holy Prophet (SAWW). Q-6. Which incident in the story tells about the generosity of Hazrat Asma (RA)? Ans. When she inherited a garden after the death of her sister Hazrat Ayesha (RA), She instantly sold it and gave away all the money to the poor and needy people, and felt more pleasure than receivers. Q-7. What message do you get from the life of Hazrat Asma (RA)? Ans. We get the message, that we should bravely face every calamity of life for the cause of right path. We should keep walking on the right path that lead us to Allah and his Prophet (SAW). Q-8. “Her life would always be a beacon of light for all of us” How? Ans. She was brave, wise, courageous and generous. She did not care for her life but she served the Prophet of Allah (SAWW) through thick and thin. She faced every calamity of life with patience and valor. So, we can say that her life would be a beacon of light for all of us.

Related Documents


More Documents from "Ali"