sybmm – advanced computers question bank · sybmm – 2013advanced computers question bank 4...

21
SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013 1 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

Upload: others

Post on 03-Aug-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

1

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

Page 2: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

2

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></head>) section contains underlying information about the

page which is not displayed in the webpage.

ii. Body

1. The body (<body></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>

Page 3: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

3

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 :

Page 4: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

4

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 H2O

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

Page 5: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

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.

Page 6: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

6

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> </tr>

</table>

OUTPUT:

Page 7: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

7

8. Explain <OL> tag

<OL> tag is used to create an ordered list. Ordered list contains a list of items having a particular sequence.

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.

Types of ordered list

1, 2, 3, …A, B, C, …. a, b, c, … I, II, III, … i, ii, iii, ..…

Page 8: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

8

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:

<form> .

input elements .

</form>

Page 9: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

9

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:

Page 10: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

10

<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

Page 11: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

11

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:

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

Submit Reset

Page 12: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

12

Typ

es o

f CSS Inline

Internal

External

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" />

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">

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" />

(style attribute)

(style tag)

(link tag)

Page 13: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

13

13. Write a JavaScript program to display “Hello World!” on a webpage.

<html>

<head><title>Prog1</title>

<script language=javascript>

document.write("Hello World!");

</script>

</head>

<body>

</body>

</html>

14. Write a JavaScript program to greet a user according to his/her name.

<html>

<head><title>Prog2</title>

<script language=javascript>

var a;

a=prompt("Enter your name: ");

document.write("Hello "+ a);

</script>

</head>

<body>

</body>

</html>

Page 14: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

14

15. Write a JavaScript program to perform addition of two user-defined numbers.

<html>

<head><title>Prog3</title>

<script language=javascript>

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);

</script>

</head>

<body>

</body>

</html>

16. Write a JavaScript program to perform subtraction of two user-defined numbers.

<html>

<head><title>Prog4</title>

<script language=javascript>

var a, b, sub;

a=prompt("Enter num1: ");

a=parseInt(a);

b=prompt("Enter num2: ");

b=parseInt(b);

sub=a-b;

Page 15: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

15

document.write("Difference of "+ a + " and " + b + " is " +sub);

</script>

</head>

<body>

</body>

</html>

17. Write a JavaScript program to perform multiplication of two user-defined numbers.

<html>

<head><title>Prog5</title>

<script language=javascript>

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);

</script>

</head>

<body>

</body>

</html>

Page 16: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

16

18. Write a JavaScript program to perform division of two user-defined numbers.

<html>

<head><title>Prog6</title>

<script language=javascript>

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);

</script>

</head>

<body>

</body>

</html>

Page 17: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

17

19. Write a JavaScript to perform average of 3 user-defined numbers.

<html>

<head><title>Prog7</title>

<script language=javascript>

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);

</script>

</head>

<body>

</body>

</html>

Page 18: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

18

20. Write a JavaScript function to display “Hello World!” on a webpage.

<html>

<head><title>Prog8</title>

<script language=javascript>

function Disp() {

document.write("Hello World!");

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>

21. Write a JavaScript function to greet a user as per his/her name.

<html>

<head><title>Prog9</title>

<script language=javascript>

function Disp(){

var a;

a=prompt("Enter your name: ");

document.write("Hello "+ a);

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>

Page 19: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

19

22. Write a JavaScript function to perform addition of two user-defined numbers.

<html>

<head><title>Prog10</title>

<script language=javascript>

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);

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>

23. Write a JavaScript function to perform subtraction of two user-defined numbers.

<html>

<head><title>Prog11</title>

<script language=javascript>

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);

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>

24. Write a JavaScript function to perform multiplication of two user-defined numbers.

<html>

<head><title>Prog12</title>

Page 20: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

20

<script language=javascript>

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);

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>

25. Write a JavaScript function to perform division of two user-defined numbers.

<html>

<head><title>Prog13</title>

<script language=javascript>

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);

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>

26. Write a JavaScript function to perform average of 3 user-defined numbers.

<html>

<head><title>Prog14</title>

<script language=javascript>

function Disp() {

var a, b, c, avg;

Page 21: SYBMM – ADVANCED COMPUTERS QUESTION BANK · SYBMM – 2013ADVANCED COMPUTERS QUESTION BANK 4 KANISHKA KHATRI F.Y.B.M.M. S.Y.B.M.M. F.Y.B.M.S. g.  tag The  tag

SYBMM – ADVANCED COMPUTERS QUESTION BANK 2013

21

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);

}

</script>

</head>

<body>

<input type=button value=Result onClick="Disp()">

</body>

</html>