CS101 Introduction of computing -...

28
CS101 Introduction of computing www.virtualians.pk Prepared by: Irfan Khan CS101 Introduction of computing Lecture Wise Questions and Answers for Final Term Exam Preparation by Virtualians Social Network Lecture No. 23 to 45 Flow Control & loops Q: What are JavaScript Data Types and Variables? Answer The variable’s data type is the JavaScript scripting engine’s interpretation of the type of data that variable is currently holding. A string variable holds a string; a number variable holds a number value, and so on. However, unlike many other languages, in JavaScript, the same variable can hold different types of data, all within the same application. This is a concept known by the terms loose typing and dynamic typing, both of which mean that a JavaScript variable can hold different data types at different times depending on context. With a loosely typed language, you don’t have to declare ahead of time that a variable will be a string or a number or a Boolean, as the data type is actually determined while the application is being processed. If you start out with a string variable and then want to use it as a number, that’s perfectly fine, as long as the string actually contains something that resembles a number and not something such as an email address. If you later want to treat it as a string again, that’s fine, too. The forgiving nature of loose typing can end up generating problems. If you try to add two numbers together, but the JavaScript engine interprets the variable holding one of them as a string data type, you end up with an odd string, rather than the sum you were expecting. Context is everything when it comes to variables and data types with JavaScript. This chapter covers the JavaScript primitive data types of string, Boolean, and number, as well as the built-in functions for modifying values of these types. In addition, we’ll look at two special data types in JavaScript, null and undefined, toward the end of the chapter. Along the way, we’ll explore escape sequences in strings and take a brief look at Unicode. The chapter also delves into the topic of variables, including what makes valid and meaningful variable identifiers. Q: Explain JavaScript Flow Control and Looping? Answer

Transcript of CS101 Introduction of computing -...

Page 1: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

CS101 Introduction of computing

Lecture Wise Questions and Answers for Final Term Exam Preparation by

Virtualians Social Network

Lecture No. 23 to 45

Flow Control & loops

Q: What are JavaScript Data Types and Variables?

Answer

The variable’s data type is the JavaScript scripting engine’s interpretation of the type of data that variable is currently holding. A string variable holds a string; a number variable holds a number value, and so on. However, unlike many other languages, in JavaScript, the same variable can hold different types of data, all within the same application. This is a concept known by the terms loose typing and dynamic typing, both of which mean that a JavaScript variable can hold different data types at different times depending on context. With a loosely typed language, you don’t have to declare ahead of time that a variable will be a string or a number or a Boolean, as the data type is actually determined while the application is being processed. If you start out with a string variable and then want to use it as a number, that’s perfectly fine, as long as the string actually contains something that resembles a number and not something such as an email address. If you later want to treat it as a string again, that’s fine, too. The forgiving nature of loose typing can end up generating problems. If you try to add two numbers together, but the JavaScript engine interprets the variable holding one of them as a string data type, you end up with an odd string, rather than the sum you were expecting. Context is everything when it comes to variables and data types with JavaScript. This chapter covers the JavaScript primitive data types of string, Boolean, and number, as well as the built-in functions for modifying values of these types. In addition, we’ll look at two special data types in JavaScript, null and undefined, toward the end of the chapter. Along the way, we’ll explore escape sequences in strings and take a brief look at Unicode. The chapter also delves into the topic of variables, including what makes valid and meaningful variable identifiers. Q: Explain JavaScript Flow Control and Looping? Answer

Page 2: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

One of the most powerful features of JavaScript (and every other programming or scripting language for that matter) is the ability to build intelligence and logic into your web pages. It is vital in constructing scripts to be able to have the script make decisions and repeat tasks until specified criteria are met. For example, if you are developing an e-commerce application you may want to repeatedly ask a user to enter a credit card number until a valid credit card number is entered. Alternatively, you may want your script to loop a specific number of times through a task before moving on to the next part of the script. All of this logic and flow control is achieved using some very simple structures These are:

Conditional Statements

Looping Statements

switch Statements

label Statements

with Statements Q : Difference between object oriented and object based language Answer: The major difference between object oriented and object based languages is the inheritance. The object based languages do not support inheritance. For example JavaScript is an object based language Q: What is String Object? Answer: The String object is used to manipulate a stored piece of text. The following example uses the to Uppercase () method of the String object to convert a string to uppercase letters: Example: var txt="Hello world!"; document. Write (txt.toUpperCase ()); The code above will result HELLO WORLD! JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. JavaScript was designed to add interactivity to HTML pages JavaScript is a scripting language A scripting language is a lightweight programming language JavaScript is usually embedded directly into HTML pages JavaScript is an interpreted language (means that scripts execute without preliminary compilation) Everyone can use JavaScript without purchasing a license

Lecture 24 Design Heuristics Q : What is system and its important? Heuristic is a technique based on experience used for problem solving, learning and discovery. Heuristic are used to find approximate solution of the problem where classic methods are failed to find the exact solution.

Page 3: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Heuristics is a rule of thumb learned through trial and error method. Heuristics can be applied to design system architecture. System architecture should be according to the users needs and heuristic should be applied to simplify the system complexity. Time and cost factors must be considered to build a stable and practical system in short time span and low cost. A system can be evolved more rapidly if the design phases are divided into stable intermediate forms and additional features are added gradually. Q : What is hueistic and what is architecture? Heuristic is a technique based on experience used for problem solving, learning and discovery. Heuristic are used to find approximate solution of the problem which cannot be solved by classic methods. System architecture is a conceptual model that represents the structure and behavior of the system. Heuristics can be applied to design system architecture. System architecture should be according to the users needs and heuristic should be applied to simplify the system complexity. Time and cost factors must be considered to build a stable and practical system in short time span and low cost. Q:What is array and how it differ with variables? Array: An indexed list of elements Variables It gives us the ability to manipulate data through reference instead of actual value. Variable contains only one value where as Array can hold multiple values.

Lecture 26 Array What are JavaScript functions? A function consists of the function keyword, the name of the function followed by a pair of parenthesis and lastly, the JavaScript statement/s enclosed by curly braces. You can give any name to the function as long as it is not a JavaScript reserved keyword. Remember, function names are case sensitive, thus, alert_box is not the same as Alert_box. The function block can contain several JavaScript statements enclosed between the curly braces. The function in itself does not do anything till we call it.

Page 4: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Calling functions Calling a function is simple. You have to specify its name followed by the pair of parenthesis. <SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"> <!-- alert_box(); //--> </SCRIPT> It's good programming practice to place all functions in the HEAD section of the HTML document between the <SCRIPT> - </SCRIPT> tags. Function calls, on the other hand, can occur in any part of the document (where ever they are need Q: How to write Array?and use of it with “for” loop? Answer It is used write multiple values as under: Student=new array(4) Student *0+ =”Waqas”; Student *1+ =”Asad” Student *2+ =”Amna”; Student *3+ =”Saqlain”; For (x=0; x<4; x=x+1) { document. write (student[x]; } Q: How Array is treated in java Scrip? Answer In java it treated as “object” It key property is “Length” Q: What are the “Methods of Array”? There are two key methods for Array: Sort() Reverse()

Page 5: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Q: What are Array Identifiers? They are same as in variables. Number e.g=a[1]=5; String e.g=name=*5+=”bhola” Boolean JavaScript array are heterogeneous Unlike many other languages, java Script Array can hold elements of multiple data type. E.g= like C++ and java How to sort an Array ? To sort an Array use following steps: X=new Array (4); x *0+ =”Waqas”; x *1+ =”Wasem”; x *2+ =Saqlain”; x *3+ =”Shoaib”; x.sort(); for(a=0; a<x.length; a=a+1) , document .write(x*k++”<BR>”); }

Q: Differentiate among HTML, DHTML, and JavaScript Answer: HTML (Hypertext Markup Language) is the set of markup symbols or codes inserted in a file intended for display on a World Wide Web browser page. The markup tells the Web browser how to display a Web page's words and images for the user. Each individual markup code is referred to as an element (but many people also refer to it as a tag). Some elements come in pairs that indicate when some display effect is to begin and when it is to end. Dynamic HTML is a collective term for a combination of new Hypertext Markup Language (HTML) tags and options that will let you create Web pages more animated and more responsive to user interaction than previous versions of HTML. Much of dynamic HTML is

Page 6: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

specified in HTML 4.0. Simple examples of dynamic HTML pages would include (1) having the color of a text heading change when a user passes a mouse over it or (2) allowing a user to "drag and drop" an image to another place on a Web page. Dynamic HTML can allow Web documents to look and act like desktop applications or multimedia productions. JavaScript is an interpreted programming or script language from Netscape. JavaScript is used in Web site development to do such things as: 1) Automatically change a formatted date on a Web page 2) Cause a linked-to page to appear in a popup window 3) Cause text or a graphic image to change during a mouse rollover

Lecture No 27 Computer Network Q : Server that is use in internet its only one or more than one and where its located ? Answer A : Multiple servers are used in Internet and it is physically located on different locations. For example yahoo server exists in UK, and USA. Q : What type of protocol does a network have are what type of protocol use in a network explain ? Answer A : Different types of protocols are used in a network. Such as the following protocols can be used in a network: TCP/IP, FTP File Transfer, Telnet Telephone Network, HTTP Hyper Text Transfer, HTTPS Secure Hyper Text Transfer, SFTP Secure File Transfer, SSL Secure Socket Layer etc Q: Define man metropolitan area network? Answer A : Metropolitan Area Network (MAN) is a network that is typically spans a city or a large campus. MAN is geographically falls between Wide Area Network (WAN) and Local Area Network (LAN), and it provides Internet connectivity for LAN in the region (e.g. in a city)and connects them(LAN) to Internet. Cable television is an example of MAN. Q: What is the Difference between LAN, WAN and MAN ? LAN (local area network) is a group of computers and network devices connected together. Used in small area, MAN (metropolitan area network) is a larger network that usually spans several buildings in the same city or town. WAN (wide area network), in comparison to a MAN, is not restricted to a geographical location. Used for state or country etc Q: what is the function of pop up? Answer

Page 7: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

A pop-up is a graphical user interface (GUI) display area, usually a small window that suddenly appears ("pops up") in the foreground of the visual interface. Pop-ups can be initiated by a single or double mouse click or rollover (sometimes called a mouse over), and also possibly by voice command or can simply be timed to occur. A pop-up window must be smaller than the background window or interface; otherwise, it's a replacement interface. Q: What is IMAP? Answer Short for Internet Message Access Protocol, a protocol for retrieving mail messages. The latest version, IMAP4, is similar to POP3 but supports some additional features. For example, with IMAP4, you can search through your e-mail messages for Keywords while the messages are still on mail server. You can then choose which messages to download to your machine. On the World Wide Web, JavaScript (and less commonly Java applet s) are used to create interactive effects including pop-up and full overlay windows. Q: Define SMTP, POP3 and IMAP SMTP, POP3 and IMAP are TCP/IP protocols used for mail delivery. If you plan to set up an email server such as hMailServer, you must know what they are used for. Each protocol is just a specific set of communication rules between computers. SMTP SMTP stands for Simple Mail Transfer Protocol. SMTP is used when email is delivered from an email client, such as Outlook Express, to an email server or when email is delivered from one email server to another. SMTP uses port 25. POP3 POP3 stands for Post Office Protocol. POP3 allows an email client to download an email from an email server. The POP3 protocol is simple and does not offer many features except for download. Its design assumes that the email client downloads all available email from the server, deletes them from the server and then disconnects. POP3 normally uses port 110. IMAP IMAP stands for Internet Message Access Protocol. IMAP shares many similar features with POP3. It, too, is a protocol that an email client can use to download email from an email server. However, IMAP includes many more features than POP3. The IMAP protocol is designed to let users keep their email on the server. IMAP requires more disk space on the server and more CPU resources than POP3, as all emails are stored on the server. IMAP normally uses port 143. Here is more information about IMAP. Examples Suppose you use hMailServer as your email server to send an email to [email protected]. You click Send in your email client, say, Outlook Express. Outlook Express delivers the email to hMailServer using the SMTP protocol. HMailServer delivers the email to Microsoft's mail server, mail.microsoft.com, using SMTP. Bill's Mozilla Mail client downloads the email from mail.microsoft.com to his laptop using the POP3 protocol (or IMAP). Q: Define FTP (File Transfer Protocol)

Page 8: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Answer This was one of the first Internet services developed and it allows users to move files from one computer to another. Using the FTP program, a user can logon to a remote computer, browse through its files, and either download or upload files (if the remote computer allows). These can be any type of file, but the user is only allowed to see the file name; no description of the file content is included. You might encounter the FTP protocol if you try to download any software applications from the World Wide Web. Many sites that offer downloadable applications use the FTP protocol.

Lecture No 28 Introduction to the Internet Q What is Cyber Crime? Answer: Crimes committed with the use of computers or relating to computers, especially through the Internet. Universally, Cyber Crime is understood as "an unlawful act where in the computer is either a tool or a target or both". Cyber Crimes are different from conventional crimes as in cyber crimes; the crime is committed in an electronic medium and here means area is not a requirement but is rather a general rule under the penal provisions of the Information Technology Act. The element of means area in Internet crimes is that the offender must have been aware at the time of causing the computer to perform the function that the access thus intended to be secured was unauthorized. Q: Explain “ARPANET-1969" how he connected all the networks. Answer: The Advanced Research Projects Agency was formed with an emphasis towards research, and thus was not oriented only to a military product. The formation of this agency was part of the U.S. reaction to the then Soviet Union's launch of Sputnik in 1957. (ARPA draft, III-6). ARPA was assigned to research how to utilize their investment in computers via Command and Control Research (CCR). Dr. J.C.R. Licklider was chosen to head this effort. • Developed for the US DOD Advanced Research Projects Agency • 60,000 computers connected for communication among research organizations and universities by Neil Gershenfeld and Isaac L. Chuang Q: What is the concept of semantic web? What is meant by the following statement "the human can understand but computer cannot yet"? Answer: The Semantic Web is an idea of World Wide Web inventor Tim Berners-Lee that the Web as a whole can be made more intelligent and perhaps even intuitive about how to serve a user's needs. Berners-Lee observes that although search engines index much of the Web's content, they have little ability to select

Page 9: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

the pages that a user really wants or needs. He foresees a number of ways in which developers and authors, singly or in collaborations, can use self-descriptions and other techniques so that context-understanding programs can selectively find what users want.

Q: What is the difference between "Internet & Intranet"? Answer: An intranet is a private network that is contained within an enterprise. It may consist of many interlinked local area networks and also use leased lines in the wide area network. The main purpose of an intranet is to share company information and computing resources among employees. An intranet can also be used to facilitate working in groups and for teleconferences. The vast collection of inter-connected networks that all use the TCP/IP protocols - a network of networks in which users at any one computer can, if they have permission, get information from any other computer (and sometimes talk directly to users at other computers) Q: What is the use of Java applets in World Wide Web? Answer: Java Applets are objects which are developed in Java and then embedded in HTML page and they are downloaded on Client machine. Applets can be used to some animation or some other processing to avoid congestion in network traffic. Q What is the difference between the application & system software’s? Answer: System software is program that generally performs the background tasks in a computer. These programs, many times, talk directly to the Hardware e.g. Operating system software, Device drivers while Application software are programs that generally interact with the user to perform work that is useful to the user. These programs generally talk to the hardware through the assistance of system software e.g., scientific, business application.

Lecture No 29 Function and Variable scope Q: What is Array? Answer Array is an arrangement of items at equally spaced and continues addresses in computer memory while a loop is a sequence of instruction s that is continually repeated until a certain condition is reached. Typically, a certain process is done, such as getting an item of data and changing it. Loop can be used to access the items stored in an array Q: what is function? Answer

Page 10: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Function is a code snippet or a piece of code defined to be reused anywhere in the program. Once a function is defined, it can be used repeatedly any number of times in the program. Usually a function is defined in the <head> portion and used in the body of web page. Invoking or using the function from body is called Calling function. Example <head> <script> function add(){ a=5; b=7; return a+b; } </script> </head> <body> document.write("Calling the function in the head portion" +, add()); x = add(); in the above example, function add() is called two times in the body. in first statement, it is displayed in the message and in second statement, its returned value i.e. 12 is assigned to variable x.

Lecture No 30 Internet Services Q : What change take place in 1960’s? Answer In 1969 DoD ARPA creators an experimental network called “ARPANET” IT contains 4 Universities and enables Scientists to share information and resource across long distance. Q:What happened in 1980’s? Answer In 1983 the TCP/IP become the only set of protocol use on the ARPANET. Q:WHAT changes take place in 1990’s? Answer In 1993 CERN produces a WWW developed by TIN Berners-Lee IT use http and hyper text for showing info on internet. 1993-1994: Web browsers were developed.

Page 11: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Q: How many Internet services are there? Answer There are six internet services.

FTP

Telnet

Web

EMail

Instant messaging

VoIP Q:What is IP address? Answer A unique identifier for the computer on a TCP/IP network It is a numeric value of four 8 bit separated by periods. Q:What is Domain Names? Answer IP address are much difficult for the humans to learn so the IP address are converted in to “Labels” Q:What is DNS system ? Answer It is the way that Internet domain name are located & translated into IP address. Q:For what FTP stands for? Answer It stands for File Transfer Protocol. Used to transfer file between computer on a TCP/IP. Q:What is the use of Telnet Protocol? Answer By using it the user can remotely log on to a computer and have control over it. Use; Configuring and testing of a remote web server. The Web: It is the humankind first great creation. How does it works? 1)Firstly the user launches the browser 2)User type the URL 3)The browser breaks it into three parts: For example. http://www.virtualaians.pk Protocol Identifier (http) Server Address (:// www.virtualians.pk)

Page 12: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Directory & File name (/index.html) 4)Browser sent it to the DN and it develop a connection between the server 5)Browser send a “GET” request 6)Server send the request file to the browser 7)And at the end the browser display the file Q:What is email? Answer Computer to computer messaging is called e mail. But now a days it is replaced by instant messaging Q:For what VOIP is being used ? It is used to deliver voice from device to another using internet protocol. Working: It first convert the voice into digital form , then broke them into packets and then transfer them by using TCP/IP network Q :Explain server and hub Answer Server is a computer or a device especially used on a network that manages the resources of the network. It fulfills the requirements / requests of clients. Hub is a device that is used to connect multiple computers with each other to form a network. Q: write a note on Telnet Answer Telnet is a network protocol used on the Internet or local area networks to provide a bidirectional interactive text-oriented communications facility using a virtual terminal connection. User data is interspersed in-band with Telnet control information in an 8-bit byte oriented data connection over the Transmission Control Protocol (TCP). In the very earliest days of internetworking, one of the most important problems that computer scientists needed to solve was how to allow someone operating one computer to access and use another as if he or she were connected to it locally. The protocol created to meet this need was called Telnet, and the effort to develop it was tied closely to that of the Internet and TCP/IP as a whole. Even though most Internet users today never invoke the Telnet protocol directly, they use some of its underlying principles indirectly all the time. Every time you send a piece of e-mail, use FTP to transfer a file, or load a Web page, you are using technology based on Telnet. For this reason, the Telnet protocol can make a valid claim to the title of the most historically important application protocol in TCP/IP. Q What is NET WORK TOPOLOGY? Answer

Page 13: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Think of a topology as a network's virtual shape or structure that is designed by some specialists. It is not a piece of material that is owned by some one. This shape does not necessarily correspond to the actual physical layout of the devices on the network. For example, the computers on a home LAN may be arranged in a circle in a family room, but it would be highly unlikely to find a ring topology there. Ring Topology: If we establish a network using Ring Topology it will stop entire network in case of a single node or computer failure. So, it is not so reliable to use in such an office. Bus Topology: If we install a Bus Topology for such a network it will be more reliable but it will be very slow in performance. Star Topology: If we use a “Star Topology” it will reduce all such problems and the network performance will be faster and reliable and in case of fault of a computer or node the entire network will not affected and we can easily replace or can add more computers in this network using central hub. Q: Difference between the digital and analog signals Answer Analog signal is a continuous signal which transmits information as a response to changes in physical phenomenon. Whereas, digital signals are discrete time signals generated by digital modulation Analog systems are those systems that have a value that changes steadily over time and can have one of an infinite set of values in a range.

Lecture 31 Developing Presentations Q :what is spreadsheet? Answer A spreadsheet is a document that stores data in a grid of horizontal rows and vertical columns. Rows are typically labeled using numbers (1, 2, 3, etc.), while columns are labeled with letters (A, B, C, etc). Individual row/column locations, such as C3 or B12, are referred to as cells. Each cell can each store a unique instance of data. By entering data into a spreadsheet, information can be stored in a more

Page 14: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

structured way than using plain text the row/column structure also allows the data to be analyzed using formulas and calculations. For example, each row of a spreadsheet may store information about a person who has an account with a certain company. Each column may store a different aspect of the person's information, such as the first name, last name, address, phone number, favorite food, etc. The spreadsheet program can analyze this data by counting the number of people who live in a certain zip code, listing all the people who's favorite food is fried veal, or performing other calculations. In this way, a spreadsheet is similar to a database.

Lecture 32 Event handling Q: Define Event driven program Answer The programs which can capture and respond to the events called Event driven programs. Specifically JavaScript is designed for writing such programs. All programs written in JavaScript are event driven. Event driven can also be defined as an application architecture technique in which application has a main loop which is clearly divided into two sections. The first is Event Selection and the second is Event Handling. Q: What is event handling in java script? Answer Event handling is when an action from the user triggers a JavaScript function. An event handler is defined as the following: <div onclick="alert ('You clicked me!');">Click me!</div> This will open an alert box with the message You clicked me! Displayed in it when the user clicks the div element. There are many event handlers in JavaScript. Some common ones include: onclick (triggered when user clicks the element) onload (triggered when page, image, etc. loads) onfocus (triggered when element gains focus (becomes active)) onblur (triggered when element loses focus) onmouseover (triggered when user's mouse pointer enters the element) onmouseout (triggered when user's mouse pointer leaves the element) onmousemove (triggered when user's mouse pointer is moved while it is on top of the element) onkeydown (triggered when user presses a key on the keyboard) onkeyup (triggered when user releases a key on the keyboard) onkeypress (triggered when user presses, then releases a key on the keyboard)

Lecture No 33

Page 15: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Graphics and Animation

Q: what is Pixel color? Answer The idea behind pixel is very easy. Each display device is divided into smaller portions that are assigned addresses. Each addressable element in a display device is called pixel, the intensity of each pixel is variable. Colors are normally represented in three basic colors called red, green and blue. Q: Define Color mapping Answer In order to display an image on screen every pixel of image is given a color. Color scheme used mostly to represent an image is RGB (red, green, blue).Each of this color is store on a byte (256*256*256) so total of 16million color combination can be generated from these three colors that will give a high resolution picture and take a lot of memory. So to reduce memory limit for storage of an image different techniques are used. some of these are “Color mapping” and "color dithering”. In this scheme re-mapping the image values is done that would be suitable for display purposes. It means transform the source image to target image by using some algorithm of transformation. In Color dithering to show color that is not present in “selected platelet of colors” we use some colors present in “Platelet” by changing their some property. For example Red and green pixels can be alternated to give the impression of bright yellow Q: Explain Tweening Answer An interpolation technique where an animation program generates extra frames between the key frames that the user has created. This gives smoother animation without the user having to draw every frame. A scene is described by a mathematical model - a set of two- or three-dimensional objects whose positions in are given by sets of coordinates. Tweening uses mathematical formulae to generate these coordinates at a sequence of discrete times. The simplest system would move each point at a constant rate in a straight line between its initial and final positions, though other kinds of path are possible. The coordinates at each time step are used to generate (or "render") a two-dimensional image of the scene which forms one "frame" of the animation. Tweening is similar to morphing except that morphing is usually performed by interpolating between corresponding points marked by the user on two images, rather than between two configurations of a model. (1995-04-04)

Lecture 34 Intelligent System

Page 16: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Q:What is Dithering and Aliasing? Answer Dithering is the attempt by a computer program to approximate a color from a mixture of other colors when the required color is not available. For example, dithering occurs when a color is specified for a Web page that a browser on a particular operating system can't support. The browser will then attempt to replace the requested color with an approximation composed of two or more other colors it can produce. Aliasing The term "aliasing", when applied to the field of digital imaging is an unwanted effect that results in the degradation of picture quality. Q:Explain Artificial intelligent systems Answer The branch of computer science concerned with making computers behave like humans. The term was coined in 1956 by John McCarthy at the Massachusetts Institute of Technology. Artificial intelligence includes Games playing: programming computers to play games such as chess and checkers Expert systems: programming computers to make decisions in real-life situations (for example, some expert systems help doctors diagnose diseases based on symptoms) Natural language: programming computers to understand natural human languages Neural networks: Systems that simulate intelligence by attempting to reproduce the types of physical connections that occur in animal brains Robotics: programming computers to see and hear and react to other sensory stimuli Currently, no computers exhibit full artificial intelligence (that is, are able to simulate human behavior). The greatest advances have occurred in the field of games playing. The best computer chess programs are now capable of beating humans. In May, 1997, an IBM super-computer called Deep Blue defeated world chess champion Gary Kasparov in a chess match. In the area of robotics, computers are now widely used in assembly plants, but they are capable only of very limited tasks. Robots have great difficulty identifying objects based on appearance or feel, and they still move and handle objects clumsily. Natural-language processing offers the greatest potential rewards because it would allow people to interact with computers without needing any specialized knowledge. You could simply walk up to a computer and talk to it. Unfortunately, programming computers to understand natural languages has proved to be more difficult than originally thought. Some rudimentary translation systems that translate from one human language to another are in existence, but they are not nearly as good as human translators. There are also voice recognition systems that can convert spoken sounds into written words, but they do not understand what they are writing; they simply take dictation. Even these systems are quite limited -- you must speak slowly and distinctly.

Lecture No 35 Intelligence system

Page 17: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Q:What is Event Handling? Answer Almost all programs must respond to commands from the user in order to be useful. Java's AWT uses event driven programming to achieve processing of user actins: one that underlies all modern window systems programming. Within the AWT, all user actions belong to an abstract set of things called events. An event describes, in sufficient detail, a particular user action. Rather than the program actively collecting user-generated events, the Java run time notifies the program when an interesting event occurs. Programs that handle user interaction in this fashion are said to be event driven. There are three parts to the event model in Java: Event object - this is an instance of a Java class that contains the characteristics of the event. For example, if the event is generated from clicking a mouse button, the event object would contain information such as the coordinates of the mouse cursor, which button was clicked, how many times it was clicked, etc. Dispatching class/method - this is an object, which detects that an event has occurred and is then responsible for notifying other objects of the event, passing the appropriate event object to those objects. These other objects are "listeners" for the event. Most AWT components, such as Button, List, Text field, etc. are Q: When to use Math in JavaScript, and why? Answer As you move along with JavaScript, you are going to find that using Math in JavaScript may be a good place to start. It's nice and simple, but still gives you some pretty big challenges, if that's what you want. With Math, you may start with those sweet functions, that give you a random number (pseudo-random that is). You could use this to do a random function, display a random image and much more. Random numbers Enough said about limitations, precision, and the cross-browser issue, let's move on to a example, they'll show you how to get a pseudo-random number between 0 and 1. The random number generator is seeded from the current time, as in Java. //Returns a random number between 0 and 1 function get Random() { return Math.random(); } In this examples and others we have create out own get Random() function to make it easier to use the required method. That way we don't have to keep including 'Math'. To use the above get Random() function is simplicity itself: alert(get Random()); var a = get Random(); You can read more on random numbers and their limitations in Selecting Random Number by Martin Web. Q Explain Defuzzification Fuzzy Logic and Approximate reasoning Answer

Page 18: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Defuzzification is the process of producing a quantifiable result in fuzzy logic, given fuzzy sets and corresponding membership. Approximate reasoning Approximate reasoning for the Semantic Web is based on the idea of sacrificing soundness or completeness for a significant speedup of reasoning. Fuzzy logic Fuzzy logic is a form of many-valued logic; it deals with reasoning that is approximate rather than fixed and exact.

Lecture No 36 Data Management

Q: What is data, database (DB), DBMS and DBS? Answer In computer science, data is anything in a form suitable for use with a computer. Data is often distinguished from programs. A program is a set of instructions that detail a task for the computer to perform. In this sense, data is thus everything that is not program code. A database is a collection of information that is organized so that it can easily be accessed, managed, and updated. In one view, databases can be classified according to types of content: bibliographic, full-text, numeric, and images. In computing, databases are sometimes classified according to their organizational approaches. The most prevalent approach is the relational database, a tabular database in which data is defined so that it can be reorganized and accessed in a number of different ways. A distributed database is one that can be dispersed or replicated among different points in a network. An object-oriented programming database is one that is congruent with the data defined in object classes and subclasses. As one of the oldest components associated with computers, the database management system (DBMS), is a computer software program that is designed as the means of managing all databases that are currently installed on a system hard drive or network. Different types of database management systems exist, with some of them designed for the oversight and proper control of databases that are configured for specific purposes. Here are some examples of the various incarnations of DBMS technology that are currently in use, and some of the basic elements that are parts of DBMS software applications. In database management system (DBMS), data files are the files that store the database information, whereas other files, such as index files and data dictionaries, store administrative information, known as metadata. Database system is a system to achieve an organized, store a large number of dynamical associated data, facilitate for multi-user accessing to computer hardware, software and data, that it is a computer system with database technology. Q:What is Data Security?

Page 19: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Answer Data security: Data security refers to protecting data against destruction and misuse. It involves both protecting database access by user name and password .although access cards or a biometric system can be used instead, when warranted. The data base administrator assigns specific access privileges to specific individuals or groups of individuals---this access can typically be specified down to the individual column level of database table. Q:What is Data integrity? Answer Data integrity refers to the accuracy of data. The longstanding computer saying “garbage in “garbage out” or “GIGO”is very appropriate for database system. The quality of the information generated from a database is only as good the accuracy of the data contained in database. Although it is possible to generate poor information from quality data by making poor assumptions or using poor data analysis, it is virtually impossible to generate quality information from inaccurate data. Because so many important decision are made based on information generated by information system Data is so essential to organization, data integrity and security have always been high priority database issues, after the recent attacks of hacker and threats there have been increased attention paid to both these issues. The total destruction of the computer housing a crucial database, as well as the threat of unauthorized access and data alternation of vital system is being viewed as much more realistic then just a few years ago .consequently ,many business and government organization are evaluating their data integrity and security method and improving them day by day. Q:What is Encryption? Answer The translation of data into a secret code. Encryption is the most effective way to achieve data security. To read an encrypted file, you must have access to a secret key or password that enables you to decrypt it. Unencrypted data is called plain text ; encrypted data is referred to as cipher text. There are two main types of encryption: asymmetric encryption (also called public-key encryption) and symmetric encryption. Q:What is Public key ? Answer In cryptography, a public key is a value provided by some designated authority as an encryption key that, combined with a private key derived from the public key, can be used to effectively encrypt messages and digital signatures. The use of combined public and private keys is known as asymmetric cryptography. A system for using public keys is called a public key infrastructure (PKI)

Page 20: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Lecture No 37 Data Base Software Q: what object- relational database? Answer An object-relational database (ORD), or object-relational database management system (ORDBMS), is a database management system (DBMS) similar to a relational database, but with an object-oriented database model: objects, classes and inheritance are directly supported in database schemas and in the query language. In addition, just as with proper relational systems, it supports extension of the data model with custom data-types and methods. Example of an object-oriented database model An object-relational database can be said to provide a middle ground between relational databases and object-oriented databases (OODBMS). In object-relational databases, the approach is essentially that of relational databases: the data resides in the database and is manipulated collectively with queries in a query language; at the other extreme are (OODBMS) in which the database is essentially a persistent object store for software written in an object-oriented programming language, with a programming API for storing and retrieving objects, and little or no specific support for querying Q: Explain Database software Answer Database software is the phrase used to describe any software that is designed for creating databases and managing the information stored in them. Sometimes referred to as database management systems (DBMS), database software tools are primarily used for storing, modifying, extracting, and searching for information within a database. Database software is used for a number of reasons in any industry - from keeping your bookkeeping on task, compiling client lists to running your online Web site. Because they have so many uses, there are dozens of database software programs available. The options have gone beyond Oracle or Microsoft Access to encompass File Maker, Avan quest and Delicious Monster Software for options tailored to a variety of needs. Some of the more popular database software applications include desktop solutions like Microsoft Access and File Maker Pro and server solutions like MySQL, Microsoft SQL Server and Oracle.

Lecture no 38 String Manipulation Q:Define Manipulating strings with JavaScript Answer While JavaScript has many applications, working with string values is one of the most popular. Strings are objects within the JavaScript language. They are not stored as character arrays, so built-in functions

Page 21: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

must be used to manipulate their values. The functions provide various ways to access the contents of a string variable. Let's take a closer look at these functions. Q: Difference between Java and Html Answer HTML stands for Hypertext Mark-up Language and is an Internet World Wide Web description language that tells your web browser how a page is going to look. JavaScript is a scripting language developed by Sun Microsystems. JavaScript has been used to customize web pages. You can customize your web page to check out who's browsing (by reading the viewer's cookies) figure out where else they've been or where they're located and start putting advertisements for your local area or for other interests that you have shown by your past viewing. You can learn simple HTML tags to create your own web pages. The commands are located on the

Internet. JavaScript is a lot more involved. Lecture 39 Cyber crime What is Cyber Crime? Answer: Crimes committed with the use of computers or relating to computers, especially through the Internet. Universally, Cyber Crime is understood as "an unlawful act where in the computer is either a tool or a target or both". Cyber Crimes are different from conventional crimes as in cyber crimes; the crime is committed in an electronic medium and here mens rea is not a requirement but is rather a general rule under the penal provisions of the Information Technology Act. The element of mens rea in Internet crimes is that the offender must have been aware at the time of causing the computer to perform the function that the access thus intended to be secured was unauthorized. What is Denial of Service: (DoS) Answer A denial of service attack is a form of computer hacking which sends a massive number of automated requests to a web server with the intent of overloading it's capacity, and causing a service interruption or outage for legitimate users. A denial of service (DoS) attack is an incident in which a user or organization is deprived of the services of a resource they would normally expect to have. In a distributed denial-of-service, large numbers of compromised systems (sometimes called a bot net) attack a single target. Write a note on Trojan Answer Trojan are designed to allow a hacker remote access to a target computer system. Once a Trojan horse has been installed on a target computer system, it is possible for a hacker to access it remotely and perform various operations. The operations that a hacker can perform are limited by user privileges on the target computer system and the design of the Trojan horse. Operations that could be performed by a hacker on a target computer system that could be the part of cyber crime: What are the classifications of Cyber Crime?

Page 22: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Answer: Tampering with computer source documents: Hacking: Publishing of information, which is obscene in electronic form accessing protected system Breach of confidentiality and privacy Explain FTP & SMTP? Answer: FTP, a client-server protocol which allows a user on one computer to transfer files to and from another computer over a TCP/IP network. Also the client program the user executes to transfer files. One of the most useful services of the Internet is FTP. The Simple Mail Transfer Protocol (SMTP) delivers mail. The Distinct SMTP combined with the MIME component allows you to automate the encoding and sending of e-mail attachments. The SMTP component provides an interface to the mail delivery service, including the option of connecting via a firewall proxy server. An application may use SMTP to send notification, such as a report detailing logins to a secure system or information about hits on the company's web site, to a user via e-mail. What is VPN? Answer: A virtual private network (VPN) is a way to use a public telecommunication infrastructure, such as the Internet, to provide remote offices or individual users with secure access to their organization's network. A virtual private network can be contrasted with an expensive system of owned or leased lines that can only be used by one organization. The goal of a VPN is to provide the organization with the same capabilities, but at a much lower cost. A VPN works by using the shared public infrastructure while maintaining privacy through security procedures and tunneling protocols such as the Layer Two Tunneling Protocol (L2TP). In effect, the protocols, by encrypting data at the sending end and decrypting it at the receiving end, send the data through a "tunnel" that cannot be "entered" by data that is not properly encrypted. An additional level of security involves encrypting not only the data, but also the originating and receiving network addresses.

Lecture No 40 Social Impact of Computing Write Positive Impact of Computer Answer

The work can be done in very less time.

Page 23: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

More information can be stored in small space.

Multitasking and multiprocessing capabilities of data.

Easy to access data.

Impartiality.

Documents can be kept secret.

Error free result.

It can be used for various purposes. i.e. It can be used in any type of work Write Negative Impact of Computer Answer Highly expensive. Accidents. Data piracy. Increased Unemployment. Huge data and information can be lost sometimes. Fast changing computer technology. Service distribution. Illiteracy of computing and computers. As mentioned on the above list, computers have both positive and negative impact in our society. But the use of computer is increasing day-by-day. Explain Impact of computer on Society answer Everyone knows that this is the age of computer and vast majority of people are using computer. Development of science and technology has direct effect on our daily life as well as in our social life. Computer technology has made communication possible from one part of the world to the other in seconds. They can see the transactions in one part of the world while staying in the other part. Computer development is one of the greatest scientific achievements of the 20 th century. Computers are used in various fields as well as in teaching and learning. Some of the major computer application fields are listed below.

An aid to management: The computer can also be used as a management tool to assist in solving business problems.

Banking: Branches are equipped with terminals giving them an online accounting facility and enabling them to information as such things as current balances, deposits, overdrafts and interest charges.

Industrial Application: In industry, production may be planned, coordinated and controlled with the aid of a computer.

Engineering Design: Computer help in calculating that all the parts of a proposed design are satisfactory and also assist in the designing.

Lecture no 41 Image & Animation What difference between analogue and digital form.

Page 24: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Answer An analog representation displays information in a continuous way, for example... the presentation of a wall clock shows the time in as a continuous variable, taking on any value within its constituent resolution. Digital representation, also called discrete representation, displays information in terms of discrete, symbolic values, normally in terms of codes. In keeping with the same example, a digital representation would be a digital clock, whose representation of time is in terms of discrete variables (numbers) Explain Image pre loading answer Preloading images is a technique often used in other image scripts which work more quickly when the images for them are loaded as soon as possible. What java script does is allow you to start loading the images in the HEAD section of your page, which means that with this technique (unless the images are large or great in number) your viewers will have the necessary images in their browser's cache before the script starts to run. This way, an image rollover will be less likely to make the viewers wait for the browser to download the second image, because it is in their browser's cache. What is strings manipulation? Answer String manipulation is very useful and very widely used in every language. Often, programmers are required to break down strings and examine them closely. The most basic way to manipulate strings is through the methods that are build into them. We can perform a limited number of tasks to strings through these methods. For example The len macro returns the length of the string (number of characters) in its argument. len(abcdef) is 6, and Secondly, Notation means Mathematical Representation of an Expression/Statement.

Lecture 42 The Computing Profession Important aspects of computer ethics? answer Three aspects of computing ethics are explored, each to arrive at an imperative for the computing profession. The first argues that a distinction must be made between people and machinery and urges that the profession’s vocabulary must be used to bring that distinction out into the public view. The second observes that digital technology has swiftly gone far beyond its early focus on computation and text processing and argues that the computing profession is in urgent need of reform. The third looks at the role of digital technology in our changing society and urges that the technology be used in early education to empower children to make their own rational choices about their culture. Who is a computing professional? Answer

Page 25: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Professionals involved in the development and/or maintenance of SW and/or computer HW Computer scientists, software engineers, computer engineers, and some of the telecom engineers are generally classified as computing professionals How does Rule Based system work ? Answer: Rule based Systems are based on the principles of the logical reasoning and ability of human. Components of an RBS: –Rule base –Working memory –Rule interpreter Robotics What is the classification of Cyber Crime? Answer: Tampering with computer source documents: Hacking: Publishing of information, which is obscene in electronic form accessing protected system Breach of confidentiality and privacy What is difference between Design and Architecture? The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships among them. By "externally visible" properties, we are referring to those assumptions other components can make of a component, such as its provided services, performance characteristics, fault handling, shared resource usage, and so on. The intent of this definition is that a software architecture must abstract away some information from the system (otherwise there is no point looking at the architecture, we are simply viewing the entire system) and yet provide enough information to be a basis for analysis, decision making, and hence risk reduction. First, architecture defines components. The architecture embodies information about how the components interact with each other. This means that architecture specifically omits content information about components that does not pertain to their interaction.

Lecture No 43 The Future of computing What is point 2 point topology? Answer: The P2P acronym technically stands for "peer-to-peer" computer networking. Web podia defines P2P as "A type of network in which each workstation has equivalent capabilities and responsibilities. This differs from client/server architectures, in which some computers are dedicated to serving the others. " What is the difference between "Compiler" and "Interpreter"? Answer: A compiler is a special program that processes statements written in a particular programming language (source code) and turns them into machine language or "code" that a computer's processor uses. Compiler converts the source code into object code only once. It doesn’t need every time this conversion while execution. Interpreter does the same thing but it converts the code line by line each time while executing the program. What is the purpose of switch statement as we have IF conditional statement.

Page 26: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

Answer: If and switch statements are used to perform particular tasks against one or more conditions. We use switch statement, If the action to be taken of the value of a single variable (or a single expression). In this case, we normally know the expected values of variable or expression. We use the ‘if...else’ structure, when the action depends on the values of multiple variables (or expressions). What is WYSIWYG and WIMP interface? Answer: A WYSIWYG (pronounced "wiz-ee-wig") editor or program is one that allows a developer to see what the end result will look like while the interface or document is being created. WYSIWYG is an acronym for "what you see is what you get". A WYSIWYG editor can be contrasted with more traditional editors that require the developer to enter descriptive codes (or markup) and do not permit an immediate way to see the results of the markup. The first true WYSIWYG editor was a word processing program called Bravo. Invented by Charles Simonyi at the Xerox Palo Alto Research Center in the 1970s, it became the basis for Simonyi's work at Microsoft and evolved into two other WYSIWYG applications called Word and Excel. The acronym WIMP stands for Windows, Icons, Menus and Pointing device

Lecture 44 Programming Define Types of Errors Answer There are three types of errors

Syntax errors

Semantic errors

Run-time errors Explain Syntax and semantic errors Answer Syntax and semantic errors typically occur in the source program. They identify actual programming errors. When one of these errors is encountered, the compiler attempts to recover from the error and continue processing the source file. As more errors are encountered, the compiler outputs additional error messages. However, no object file is produced. Syntax and semantic errors produce a message in the list file. What is Html? HTML is the language a computer uses to view websites, a programmer uses the language to write the website so that the computer can read it and make it viewable to someone looking at a site via the internet

Page 27: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

what is the possible error if you cannot exactly say please send me a mail copy of Answer Die roll function because given book exaple gives error <HTML> <HEAD> <TITLE>Electronic Die</TITLE> <SCRIPT> function rollDie( ) , … - </SCRIPT> </HEAD> <BODY> <FORM … > … </FORM> </BODY> </HTML> <FORM name="form1" method="post" action=""> <INPUT type="submit" name="Submit" value="Roll Die" onMouseOver="rollDie( )"> <INPUT type="text" name="die" size="12"> </FORM> function rollDie( ) { var dieN, dieDots, dots ; dieDots = "* " ;

Page 28: CS101 Introduction of computing - api.ning.comapi.ning.com/files/PHKC1AOWfhyVhVzZ*jV4i5jaNJTge2pTr1xE9yOPm73... · including what makes valid and meaningful variable identifiers.

CS101 Introduction of computing

www.virtualians.pk Prepared by: Irfan Khan

dieN = Math.round( 6 * Math.random( ) ) ; for( dots = 2; dots <= dieN; dots = dots + 1 ) { dieDots = dieDots + "* " ; } document.form1.die.value = dieDots ;

Lecture No 45 Course review and Warm up What is the use of charAt(n) function? Answer: CharAt(n) function returns the character at n+1 location in the string on which this method is applied. For example, Let Name is a string variable that contains value saad,then Name.CharAt(3) will return character d . What is the use of MsAcess? Answer: MS Access is a Data Base Management System(DBMS) by Microsoft. A DBMS is a software package by which you can develop a database. You can insert, delete and update data into that database. You can develop reports and forms too. What is the function of array and also describe the compound statement. Answer: Array is an indexed list of element and used to store multiple values. Compound statements contain (groups of) other statements; they affect or control the execution of other statements in some way. Why we use algorithm and what is its practical use? Answer: Once we find an algorithm for solving a problem, we do not need to re-discover it the next time we are faced with that problem •Once an algorithm is known, the task of solving the problem reduces to following (almost blindly and without thinking) the instructions precisely •All the knowledge required for solving the problem is present in the