SYBMM ADVANCED COMPUTERS QUESTION BANK 2013

Similar documents
COMPUTER APPLICATIONS IN BUSINESS FYBMS SEM II

CSS CSS how to display to solve a problem External Style Sheets CSS files CSS Syntax

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM Advanced Internet Technology Lab.

CSC 121 Computers and Scientific Thinking

recall: a Web page is a text document that contains additional formatting information in the HyperText Markup Language (HTML)

Html basics Course Outline

HTML TAG SUMMARY HTML REFERENCE 18 TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES TAG/ATTRIBUTE DESCRIPTION PAGE REFERENCES MOST TAGS

Web Technologies - by G. Sreenivasulu Handout - 1 UNIT - I

A Balanced Introduction to Computer Science, 3/E

A HTML document has two sections 1) HEAD section and 2) BODY section A HTML file is saved with.html or.htm extension

HTML What is HTML Hyper Text Markup Language is a computer based language used to create WebPages.

HTML Tags <A></A> <A HREF=" CNN </A> HREF

LAB MANUAL SUBJECT: WEB TECHNOLOGY CLASS : T.E (COMPUTER) SEMESTER: VI

Summary 4/5. (contains info about the html)

Hyper Text Markup Language HTML: A Tutorial

Introduction to using HTML to design webpages

As we design and build out our HTML pages, there are some basics that we may follow for each page, site, and application.

Unit 5 Web Publishing Systems Page 1 of 13 Part 4 HTML Part 4

By Ryan Stevenson. Guidebook #2 HTML

HTML Summary. All of the following are containers. Structure. Italics Bold. Line Break. Horizontal Rule. Non-break (hard) space.

IMY 110 Theme 7 HTML Tables

A Brief Introduction to HTML

Building Web Based Application using HTML

Selected Sections of Applied Informatics

Indian Institute of Technology Kharagpur. HTML Part III. Prof. Indranil Sen Gupta Dept. of Computer Science & Engg. I.I.T.

HTML Hints & Tips. HTML is short for HyperText Markup Language.

INFS 2150 / 7150 Intro to Web Development / HTML Programming

Creating Web Pages Using HTML

COMP1000 Mid-Session Test 2017s1

Web Page Creation Part I. CS27101 Introduction to Web Interface Design Prof. Angela Guercio

Table Basics. The structure of an table

Spring 2014 Interim. HTML forms

HTML Tables and. Chapter Pearson. Fundamentals of Web Development. Randy Connolly and Ricardo Hoar

CMPT 165 INTRODUCTION TO THE INTERNET AND THE WORLD WIDE WEB

Tutorial 2 - HTML basics

HTML. LBSC 690: Jordan Boyd-Graber. October 1, LBSC 690: Jordan Boyd-Graber () HTML October 1, / 29

Programmazione Web a.a. 2017/2018 HTML5

HTML. Asst. Prof. Dr. Kanda Runapongsa Saikaew Department of Computer Engineering Khon Kaen University

CSC Web Technologies, Spring HTML Review

Shatin Tsung Tsin Secondary School S.3 Computer and Technology Web Page Design by HTML Introduction to HTML

Chapter 1 Self Test. LATIHAN BAB 1. tjetjeprb{at}gmail{dot}com. webdesign/favorites.html :// / / / that houses that information. structure?

Title: Jan 29 11:03 AM (1 of 23) Note that I have now added color and some alignment to the middle and to the right on this example.

HTML & XHTML Tag Quick Reference

Web Publishing with HTML

ICT IGCSE Practical Revision Presentation Web Authoring

COPYRIGHTED MATERIAL. Contents. Chapter 1: Creating Structured Documents 1

Make a Website. A complex guide to building a website through continuing the fundamentals of HTML & CSS. Created by Michael Parekh 1

c122jan2714.notebook January 27, 2014

HTML BEGINNING TAGS. HTML Structure <html> <head> <title> </title> </head> <body> Web page content </body> </html>

WEB PAGE DESIGN. Structure

HTML Forms. By Jaroslav Mohapl

Certified HTML Designer VS-1027

Chapter 4 Creating Tables in a Web Site Using an External Style Sheet

1/6/ :28 AM Approved New Course (First Version) CS 50A Course Outline as of Fall 2014

This document provides a concise, introductory lesson in HTML formatting.

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

HTML Element A pair of tags and the content these include are known as an element

Index. CSS directive, # (octothorpe), intrapage links, 26

Overview of Forms. Forms are used all over the Web to: Types of forms: Accept information Provide interactivity

Chapter4: HTML Table and Script page, HTML5 new forms. Asst. Prof. Dr. Supakit Nootyaskool Information Technology, KMITL

Web Designing HTML5 NOTES

ICT IGCSE Practical Revision Presentation Web Authoring

Advanced Web Programming C2. Basic Web Technologies

(Refer Slide Time: 01:41) (Refer Slide Time: 01:42)

Basic CSS Lecture 17

Tables *Note: Nothing in Volcano!*

HTML Tables and Forms. Outline. Review. Review. Example Demo/ Walkthrough. CS 418/518 Web Programming Spring Tables to Display Data"

FrontPage 2000 Tutorial -- Advanced

1.264 Lecture 12. HTML Introduction to FrontPage

Chapter 4. Introduction to XHTML: Part 1

CSS: The Basics CISC 282 September 20, 2014

CS 350 COMPUTER/HUMAN INTERACTION. Lecture 6

Page Layout Using Tables

Text and Layout. Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 11. This presentation 2004, MacAvon Media Productions

COMSC-030 Web Site Development- Part 1. Part-Time Instructor: Joenil Mistal

Website Development with HTML5, CSS and Bootstrap

UNIT-02 Hyper Text Markup Language (HTML) UNIT-02/LECTURE-01 Introduction to Hyper Text Markup Language (HTML) About HTML: [RGPV/Dec 2013(4)]

Chapter 4 Notes. Creating Tables in a Website

COPYRIGHTED MATERIAL. Contents. Introduction. Chapter 1: Structuring Documents for the Web 1

Dreamweaver Basics Outline

Student, Perfect Final Exam May 25, 2006 ID: Exam No CS-081/Vickery Page 1 of 6

WTAD Text Editors for HTML. Text Editors: Kate HTML. (HyperText Markup Language)

1. The basic building block of an HTML document is called a(n) a. tag. b. element. c. attribute. d. container. Answer: b Page 5

CPSC 481: CREATIVE INQUIRY TO WSBF

HTMLnotesS15.notebook. January 25, 2015

3.1 Introduction. 3.2 Levels of Style Sheets. - HTML is primarily concerned with content, rather than style. - There are three levels of style sheets

WTAD. Unit -1 Introduction to HTML (HyperText Markup Language)

CHAPTER 2 MARKUP LANGUAGES: XHTML 1.0

HTML. HTML Evolution

Layout Manager - Toolbar Reference Guide

ITL Public School Mid Term examination ( )

Certified HTML5 Developer VS-1029

DREAMWEAVER QUICK START TABLE OF CONTENT

Chapter 1 Getting Started with HTML 5 1. Chapter 2 Introduction to New Elements in HTML 5 21

A website is a way to present your content to the world, using HTML to present that content and make it look good

Creating a Web Page with HTML

Downloads: Google Chrome Browser (Free) - Adobe Brackets (Free) -

Chapter 1 Introduction to Dreamweaver CS3 1. About Dreamweaver CS3 Interface...4. Creating New Webpages...10

LING 408/508: Computational Techniques for Linguists. Lecture 14

IT430- E-COMMERCE Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan Arshad

Transcription:

CHAPTER 1: BASIC CONCEPTS OF WEB DESIGNING 1. What is the web? What are the three ways you can build a webpage? The World Wide Web (abbreviated as WWW or W3, commonly known as the web), is a system of interlinked hypertext documents accessed via the Internet. The three ways you can build a webpage: a. Use a pre-made template Website design templates can be found in various formats like Photoshop and HTML. Many times these templates are compatible with HTML editors like GoLive, FrontPage and Dreamweaver. b. Use an HTML editor like FrontPage or Dreamweaver HTML editors make building web pages feel like creating a document in Document Editor but certain amount of control is lost as one has to depend on the program. c. Hard-code your HTML in a text editor like Notepad That means typing HTML code which is the quickest way to learn to build web pages. 2. What is the process of creating a website? 1) Define the purpose of the website 2) Diagram the structure of the website 3) Write out the text for the website 4) Choose a basic layout that will be used on all pages 5) Choose the basic color scheme and fonts for the site 6) Build out the website 7) Choose a domain name 8) Register your domain name 9) Check if the domain is already taken 10) Find a hosting company 11) Find the cause that affects the cost of hosting a website 12) Upload your website to hosting company s server 3. What are the steps to get your website live? 1) Registering Domain Name a. Domain names are official unique addresses on the web. b. Registration costs few bucks (approx. `500 to `3000) each year to own the name depending on the QoS [Quality of Service]. 2) Renting server space to host your website a. Renting space on a server to serve your website to the World Wide Web is often called hosting. Contact hosting company Tell your Domain Be live on the web 1

4. What is the difference between an absolute link & relative link? 1) A link is an absolute link if the URL and file name can be found from anywhere on the Web, not just from a single Web site. 2) E.g. <a href=http://www.lsraheja.org/> Click here to visit L. S. Raheja College online! </a> 3) A relative link specifies the name of the file to be linked to only as it is related to the current document. 4) E.g. <a http://www.lsraheja.org/deptbmm.aspx/> Details of BMM course! </a> CHAPTER 2: HTML 5. What is HTML? Define its structure. a. HTML [Hypertext Markup Language] is the main markup language for creating web pages and other information that can be displayed in a web browser. b. HTML is written in the form of HTML elements consisting tags enclosed in angle-brackets within the web content. c. An HTML page is divided into 2 major sections: i. Head 1. The head (<head>) section contains underlying information about the page which is not displayed in the webpage. ii. Body 1. The body () section contains all the stuff (text, image, flash movie, etc.) that appears on the actual web page when someone happens to come along with their web browser. d. Note: Every page MUST begin and end with the HTML tag. e. E.g.: <HTML> <HEAD> <TITLE> Document s Title </TITLE> </HEAD> <BODY> Actual content of the web page. </BODY> </HTML> 6. Explain the following tags : a. <HTML> <HTML> tag denotes the document is a HTML webpage. Every HTML document should have <HTML> and </HTML> tags at the beginning and the end respectively. All other tags must reside within the <HTML>. </HTML> tag. E.G. : <HTML> <BODY> Demo Paragraph. </BODY> </HTML> 2

3 SYBMM ADVANCED COMPUTERS QUESTION BANK 2013 b. <HEAD> The header of a webpage is denoted by <HEAD> tag. The Header section can be merged with the <TITLE> tag denoting the title for the webpage. </HEAD> denotes the end of the header area. E.G. : <HTML> <HEAD> <TITLE> Title 1 </TTILE> </HEAD> </HTML> c. <TITLE> <TITLE> denotes the start of the title of the webpage which is displayed in the TITLE BAR. The title of a webpage should always be descriptive so as to help the user in searching and indexing the programs to name the webpage. No extra space should be kept between <TITLE> tag and the text of the title so as to make it compact. E.G. : <HTML> <HEAD> <TITLE> Title 1 </TTILE> </HEAD> </HTML> d. <BODY> The text between the <BODY> and </BODY> tags is the actual content of the webpage. The <BODY> tag can be accompanied by several attributes like BACKCOLOR, BACKGROUND, FONT SIZE, etc. E.G. : <HTML> <BODY> This is a demo paragraph. </BODY> </HTML> e. <P> tag A paragraph of a text is indicated by a <P> tag. The </P> tag can be omitted as browsers understand that when they encounter a <P> tag, it implies that there is an end to the previous paragraph. A browser ignores the extra spaces encountered in the text file as it has its own set of rules on spacing that do not depend on the spaces of your source file. Hence it is specifically done with the help of paragraph tag. A <P> tag has one optional attribute align which helps the appearance/alignment of the text. E.G.: <P align=left> Values of align can be Left, Right, Center or Justify. f. <BR> tag The <BR> tag forces a line break with no extra (white) space between lines. The difference between <P> and <BR> tag is <P> tag elements for short lines such as postal addresses results in unwanted additional whitespace. E.G.: KANISHKA KHATRI <BR> F.Y.B.M.M. <BR> S.Y.B.M.M. <BR> F.Y.B.M.S. OUTPUT :

4 SYBMM ADVANCED COMPUTERS QUESTION BANK 2013 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g. <HR> tag The <HR> tag produces a horizontal line with respect to the width of the browser window. A horizontal ruler is useful to separate sections of a document. E.G.: <HR size=3 width=50% noshade> The above statement will produce a ruler of 3 pixel spread around 50% of the browsers screen and will not produce and shade. h. <PRE> tag The <PRE> tag (stands for Pre-formatted ) generates a text in a fixed-width font. This tag also recognizes spaces, new lines, and tabs significant (multiple spaces are displayed as multiple spaces and lines break in the same locations as in the source HTML file). The text appears in mono space form. E.G.: <PRE> * * * * * </PRE> Will be displayed as: * * * * * i. <B> tag The <B> tag specifies text that should appear boldface. E.G.: This morning is so <B> Good. </B> Will be displayed as : This morning is so Good. j. <I> tag The <I> tag specifies text that should appear as italic. E.G.: This morning is so <I> Good. </I> Will be displayed as : This morning is so Good. k. <U> tag The <U> tag underlines text in a document E.G.: This morning is so <U> Good. </U> Will be displayed as : This morning is so Good. l. <SUB> tag The <SUB> tag indicates a subscript text. It is bit lower that the normal text. E.G.: H <SUB> 2 </SUB> O Will be displayed as H 2 O m. <SUP> tag The <SUP> tag indicates a subscript text. It is bit higher than the normal text. E.G.: (a + b) <SUB> 2 </SUB> Will be displayed as

5 (a + b) 2 n. <STRIKE> tag <STRIKE> tag is used to strikethrough a text. The text enclosed within <STRIKE> and </STRIKE> tags will have a line drawn through the middle of the text. E.G. : <STRIKE> Strikethrough text </STRIKE> Output : Strikethrough text o. <BIG> tag The <BIG> tag displays the enclosed text larger than the surrounding text. It has the same effect as <FONT SIZE= +1 >. If the size of the text is maximum, <BIG> tag is ignored. E.G.: <BIG> This is a big text </BIG> Output : This is a big text p. <SMALL> tag The <SMALL> tag displays the enclosed text smaller than the surrounding text. It has the same effect as <FONT SIZE= -1 >. If the size of the text is minimum, <SMALL> tag is ignored. E.G.: <SMALL> This is a small text </SMALL> Output : This is a small text q. <FONT> tag <FONT> tag specifies font characteristics for the text of the document, including color, size and face. Attributes : SIZE =. specifies relative font size on a scale of 1 through 7. You can also specify the relative size by using + or sign, e.g. +2 COLOR =. specifies font color in #RRGGBB numbers or with color names. FACE =. specifies type faces as a list of possible faces, in order of preference, separated by commas for example Times New Roman, Arial, Monotype Corsiva E.G.: <FONT FACE= TIMES NEW ROMAN SIZE= +2 COLOR= BLUE > r. <IMG> tag Images are placed in a HTML file using <IMG> tag. Few attributes of <IMG> tag are : [shortcut : SAHAB W] a. SRC : specifies the source file of the image. b. ALT : specifies an alternate text describing the image in short. c. HEIGHT : specifies the height of the image d. ALIGN : specifies the alignment of the image. For inline images, values are TOP, MIDDLE and BOTTOM. For floating images, values are RIGHT and LEFT. e. BORDER : displays the border of the image. By default the value is set to 0. f. WIDTH : specifies the width of the image. E.g.: <IMG SRC= 1.jpg height=150 width=150 border=1 > 7. Explain <table> tag. A table is a good way to present rows and columns (cells) of data. Table starts with <TABLE> and ends with </TABLE> tag. Note that all the elements of the table will be ignored if they are not enclosed within a <TABLE>. </TABLE> tag.

Designing a table starts by creating a row first (<tr>) proceeded by entering the table data (<td>) from left to right. Inserting the table data will automatically insert columns which complete the designing part of one cell. Table heads (rows/columns/both) are specified by <th> and </th> tags. Attributes of <table> tag are : [shortcut : BW A(BC) 2 ] a. Border : displays the border of the table and the cells. By default the value of border is set to 0. b. Width : specifies the width of the table with respect to the webpage. c. Align : specifies the alignment of the table. By default the align attribute is set to left. d. Bgcolor : specifies the background color of the table. e. Bordercolor : specifies the color of the border. f. Cellspacing : decides the amount of space between the cells. g. Cellpadding : decides the amount of space between each cell border and its actual content/s. Attributes of <TD>, <TH> and <TR> tags : [shortcut : Ali Vali B] a. Align : specifies the horizontal alignment of row or column. By default the value is set to left. b. Valign : specifies the vertical alignment of row or column. By default the value is set to left. c. Bgcolor : specifies the background color of the row/column. Attributes of <td> a. rowspan : merges the number of rows specified. b. colspan : merges the number of cols specified. E.G.: <table border=1 align=center> <tr > <td rowspan=3> 1 </td> <td> 2 </td> <td rowspan=2> 3 </td> </tr> <tr> <td> 5 </tr> <tr> <td colspan=2 align=center> 8 </td> </table> </tr> OUTPUT: 6

8. Explain <OL> tag <OL> tag is used to create an ordered list. Ordered list contains a list of items having a particular sequence. Types of ordered list 1, 2, 3, A, B, C,. a, b, c, I, II, III, i, ii, iii,.. Ordered lists are preceded by Roman numerals, Arabic numerals (upper and lower case) and alphanumeric (upper and lower case) characters.. <LI> tag is used with <OL> tag to indicate List Index. By default, an ordered list is numbered in Roman fashion. Other attributes: 1. Start : specifies the beginning of list (can be used in case the user needs to start with a number other than 1. E.G.: <center><ol><b>types of Ordered List</b> <li> Type 1 </ol> <ol type=a><li> Type 2 </ol> <ol type=a><li> Type 3 </ol> <ol type=i><li> Type 4 </ol> <ol type=i><li> Type 5 </ol> OUTPUT: 9. Explain <UL> tag Unordered list (also known as bulleted list) are handy and without a sequence number. This list starts with <UL> and ends with </UL> tag. 7

Steps : 1. Open a list using <UL> tag. 2. Enter the list Item using <LI> tag. </LI> is optional. 3. End the entire list with a closing </UL> tag. They can be preceded by several styles like a disc ( ), a hollow circle ( ) or a square ( ). The default appearance for an unordered list is a disc. E.G.: <ul>subjects <li>eng</li> <li>hindi</li> <li>it</li> <ul type="square"> <li>html</li> </ul> <li>bk</li> <li>oc</li> <ul type="circle"> <li>blank</li> </ul> </ul> OUTPUT: 10. Explain different Form Elements. HTML forms are used to pass data to a server. An HTML form can contain input elements like text fields, checkboxes, radio-buttons, submit buttons and more. A form can also contain select lists, textarea, fieldset, legend, and label elements. The <form> tag is used to create an HTML form: 8 <form>. input elements. </form>

HTML Forms - The Input Element The most important form element is the <input> element. The <input> element is used to select user information. An <input> element can vary in many ways, depending on the type attribute. An <input> element can be of type text field, checkbox, password, radio button, submit button, and more. Text Fields <input type="text"> defines a one-line input field that a user can enter text into: <form> First name: <input type="text" name="firstname"><br> Last name: <input type="text" name="lastname"> </form> How the HTML code above looks in a browser: First name: Last name: Note: The form itself is not visible. Also note that the default width of a text field is 20 characters. Password Field <input type="password"> defines a password field: <form> Password: <input type="password" name="pwd"> </form> How the HTML code above looks in a browser: Password: Note: The characters in a password field are masked (shown as asterisks or circles). Radio Buttons <input type="radio"> defines a radio button. Radio buttons let a user select ONLY ONE of a limited number of choices: 9

<form> <input type="radio" name="sex" value="male">male<br> <input type="radio" name="sex" value="female">female </form> How the HTML code above looks in a browser: Male Female Checkboxes <input type="checkbox"> defines a checkbox. Checkboxes let a user select ZERO or MORE options of a limited number of choices. <form> <input type="checkbox" name="vehicle" value="bike">i have a bike<br> <input type="checkbox" name="vehicle" value="car">i have a car </form> How the HTML code above looks in a browser: I have a bike I have a car Submit Button <input type="submit"> defines a submit button. A submit button is used to send form data to a server. The data is sent to the page specified in the form's action attribute. The file defined in the action attribute usually does something with the received input: <form> Username: <input type="text" name="user"> <input type="submit" value="submit"> </form> OUTPUT Username: Submit 10

Reset Button <input type="reset"> defines a reset button. A reset button is used to reset/clear form data. <form> Username: <input type="text" name="user"> <input type="submit" value="submit"> <input type="reset" value="reset"> </form> How the HTML code above looks in a browser: Username: Submit Reset Dropdown List A SELECT menu, or a pulldown menu has 3 attributes - name, size, and multiple. The SELECT item needs the OPTION element to list the values. A SELECT box of SIZE=3<BR> <SELECT SIZE="2"> <OPTION>ONE <OPTION>TWO <OPTION>THREE </SELECT> <br><br> A SELECT box of with no SIZE specified: <BR> <SELECT> <OPTION>ONE <OPTION>TWO <OPTION>THREE </SELECT> OUTPUT 11

Types of CSS SYBMM ADVANCED COMPUTERS QUESTION BANK 2013 Chapter 3: CSS 11. What is CSS? What are its types? CSS stands for Cascading Style Sheets. Styles define how to display HTML elements. If HTML is considered as content, CSS may be considered as presentation of that document. CSS is used to make a dynamic web page. There are 3 types of CSS: inline, internal and external. inline Inline styles are written directly within the tag on the document. Inline styles affect only the tag they are applied to. <a href=http://www.littlevision.com style="text-decoration: bold;"> internal Internal styles are embedded in the head of the document. Embedded styles affect only the tags on the page they are embedded in. <style type="text/css"> p { color: #0000ff; } </style> external External styles are written in a separate document and then attached to various Web documents. External style sheets can affect any document they are attached to. <link rel="stylesheet" type="text/css" href="styles.css" /> Inline Internal External (style attribute) (style tag) (link tag) Chapter 4: JavaScript 12. What is JavaScript? What are its types? JavaScript is a type of programming language that works with HTML to make web pages interactive. Note that it is not a full-featured programming language like Java or C++. It is a client-side programming language. There are two types of JavaScript : Internal and External. internal Internal JavaScripts are embedded in the head/body of the document. <style type="javascript"> 12 external External JavaScripts are written in a separate document and then attached to various Web documents. External JavaScripts can affect any document they are attached to. <link type="text/javascript" href="demo.js" />

13. Write a JavaScript program to display Hello World! on a webpage. <head><title>prog1</title> document.write("hello World!"); 14. Write a JavaScript program to greet a user according to his/her name. <head><title>prog2</title> var a; a=prompt("enter your name: "); document.write("hello "+ a); 13

15. Write a JavaScript program to perform addition of two user-defined numbers. <head><title>prog3</title> var a, b, sum; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); sum=a+b; document.write("sum of "+ a + " and " + b + " is " +sum); 16. Write a JavaScript program to perform subtraction of two user-defined numbers. <head><title>prog4</title> var a, b, sub; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); sub=a-b; 14

document.write("difference of "+ a + " and " + b + " is " +sub); 17. Write a JavaScript program to perform multiplication of two user-defined numbers. <head><title>prog5</title> var a, b, mul; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); mul=a*b; document.write("multiplication of "+ a + " and " + b + " is " +mul); 15

18. Write a JavaScript program to perform division of two user-defined numbers. <head><title>prog6</title> var a, b, div; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); div=a/b; document.write("division of "+ a + " by " + b + " gives " +div); 16

19. Write a JavaScript to perform average of 3 user-defined numbers. <head><title>prog7</title> var a, b, c, avg; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); c=prompt("enter num3: "); c=parseint(c); avg=(a+b+c)/3; document.write("average of "+ a + ", " + b + " and " + c + " is " +avg); 17

20. Write a JavaScript function to display Hello World! on a webpage. <head><title>prog8</title> function Disp() { document.write("hello World!"); } <input type=button value=result onclick="disp()"> 21. Write a JavaScript function to greet a user as per his/her name. <head><title>prog9</title> function Disp(){ var a; a=prompt("enter your name: "); document.write("hello "+ a); } <input type=button value=result onclick="disp()"> 18

19 SYBMM ADVANCED COMPUTERS QUESTION BANK 2013 22. Write a JavaScript function to perform addition of two user-defined numbers. <head><title>prog10</title> function Disp() { var a, b, sum; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); sum=a+b; document.write("sum of "+ a + " and " + b + " is " +sum); } <input type=button value=result onclick="disp()"> 23. Write a JavaScript function to perform subtraction of two user-defined numbers. <head><title>prog11</title> function Disp() { var a, b, sub; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); sub=a-b; document.write("difference of "+ a + " and " + b + " is " +sub); } <input type=button value=result onclick="disp()"> 24. Write a JavaScript function to perform multiplication of two user-defined numbers. <head><title>prog12</title>

20 SYBMM ADVANCED COMPUTERS QUESTION BANK 2013 function Disp() { var a, b, mul; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); mul=a*b; document.write("multiplication of "+ a + " and " + b + " is " +mul); } <input type=button value=result onclick="disp()"> 25. Write a JavaScript function to perform division of two user-defined numbers. <head><title>prog13</title> function Disp() { var a, b, div; a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); div=a/b; document.write("division of "+ a + " by " + b + " gives " +div); } <input type=button value=result onclick="disp()"> 26. Write a JavaScript function to perform average of 3 user-defined numbers. <head><title>prog14</title> function Disp() { var a, b, c, avg;

a=prompt("enter num1: "); a=parseint(a); b=prompt("enter num2: "); b=parseint(b); c=prompt("enter num3: "); c=parseint(c); avg=(a+b+c)/3; document.write("average of "+ a + ", " + b + " and " + c + " is " +avg); } <input type=button value=result onclick="disp()"> 21