USN: 2VX13MCA14 SUBJECT CODE:13MCA18 1. Create an XHTML page to demonstrate the usage of a. Text formatting tags b. Links c. Images d. Tables SOURCE CODE <? xml version="1.0" encoding="utf-8" ?> <! DOCOTYPE html PUBLIC "-//f2z//DTD XHTML 1.1//EN" "http://www.wwe.com/TR/xhtml 111/DTD/xhtml 11.dtd"> <html xmlns="http://www.wwe.com/1999/xhtml"> <head> <title>Text formatting, links, image, table</title> </head> <a href="6a.html"> click here for link </a> <body> <image src="Koala.jpg" height="80" width="80"> <p><h2>Formatting tags</h2><br> <h2>Italic: <i>This is in italic</i></h2><br> <h3>Bold: <b>This is in Bold</b></h3><br> <h4>Underline: <u>This is in underlined</u></h4><br></p> <table border="border"> <caption>Department of PG studies</caption> <tr> <th></th> <th>MBA</th> <th>MCA</th> MCA Department of P.G Studies, VTU, Belgaum Page no.
69
Embed
USN: 2VX13MCA14 SUBJECT CODE:13MCA18 ...hanumanthareddygn.weebly.com/.../wp_formatted_pgms.docx · Web viewUSN: 2VX13MCA14 SUBJECT CODE:13MCA18 MCA Department of P.G Studies, VTU,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
1. Create an XHTML page to demonstrate the usage ofa. Text formatting tagsb. Linksc. Imagesd. Tables
SOURCE CODE<? xml version="1.0" encoding="utf-8" ?><! DOCOTYPE html PUBLIC "-//f2z//DTD XHTML 1.1//EN""http://www.wwe.com/TR/xhtml 111/DTD/xhtml 11.dtd"><html xmlns="http://www.wwe.com/1999/xhtml"><head><title>Text formatting, links, image, table</title></head><a href="6a.html"> click here for link </a><body><image src="Koala.jpg" height="80" width="80"><p><h2>Formatting tags</h2><br><h2>Italic: <i>This is in italic</i></h2><br><h3>Bold: <b>This is in Bold</b></h3><br><h4>Underline: <u>This is in underlined</u></h4><br></p><table border="border"><caption>Department of PG studies</caption><tr><th></th><th>MBA</th><th>MCA</th><th>M.Tech</th></tr><tr><th>Boys</th><td>30</td><td>25</td><td>35</td></tr><tr>
MCA Department of P.G Studies, VTU, Belgaum Page no.
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
2. Develop and demonstrate the usage of inline and external style sheet using css
SOURCE CODE<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//w3c//DTD XHTML 1.1//EN" "http://www.wwe.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http:wwe.org/1999/xhtml">
<link rel="stylesheet" type="text/css" href="vt1313.css"/><head><title>Usages of Inline & External style sheet using CSS</title></head><body><h1 class="major"> Welcome to VTU JnanaSangama</h1><p class="minor"> VTU is one of the top and best university. It has three departments, ie MCA, M-tech, MBA.</p>
<p class="minor", style="color:red"> Nearly 192 colleges are affiliated to VTU university. It has fast growing process
all over the colleges. It can be said that, VTU university is one of the best reputed university.</p>
<p class="minor"> Nearly 192 colleges are affiliated to VTU university. It has fast growing process all over the
colleges. It can be said that, VTU university is one of the best reputed university.</p>
<h3 class="pree"><u> Department of MCA </u></h3><ul style="color:red"><li> MCA </li><li> M-tech </li><li> MBA </li></ul></body></html><style> .pree
MCA Department of P.G Studies, VTU, Belgaum Page no.
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
3. Develop and demonstrate a XHTML that includes JavaScript for the followingproblems:a. Input: A number n obtained using promptOutput:The first n fibonacci series
SOURCE CODE<?xml version="1.0" encoding="utf-8"?><?DOCTYPE html PUBLIC "=//ww.w3.org//1999/TR/xhtml 11/DTD/xhtml11.dtd"><html xmlns="http://w3.org/1999/xhtml"><head><title>fiboncci series</title></head><body><h1> calculating Fibonacci numbers </h1><script type="text/javascript">n=prompt("Enter a number")
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
3 b. Input: A number n obtained using promptOutput: A table of numbers from 1 to n and their squares using alert
SOURCE CODE<?xml version="1.0" encoding="utf-8"?><?DOCTYPE html PUBLIC "=//ww.w3.org//1999/TR/xhtml 11/DTD/xhtml11.dtd"><html xmlns="http://w3.org/1999/xhtml"><head><title>squre of a number</title></head><body><h1> calculating square of numbers </h1><script type="text/javascript">varn,i,b;n=prompt("Enter a number")if(n<=0) alert("Invalid number")else{
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
4. Develop and demonstrate using JavaScript, a XHTML document that displays random numbers (integers).
SOURCE CODE<?sxml version="1.0" encoding="utf-8" ?><! DOCOTYPE html PUBLIC "-//f2z//DTD XHTML 1.1//EN""http://www.wwe.com/TR/xhtml 111/DTD/xhtml 11.dtd"><html xmlns="http://www.wwe.com/1999/xhtml"><head><title>Random numbers </title></head><body><p id="demo">Click the button to display the random number between 1 to 10</p>
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
5 a. Develop and demonstrate , using javascript a XHTML document that collects the USN (The valid format is: A digit from 1 to 4 followed by two upper case characters followed by two digits followed by two upper-case characters followed by three digits; no embedded spaces are allowed) of the user. Event handler must be included for the form element that collects this information to validate the input.Messages must be produced when errors are detected.
SOURCE CODE<?xml version="1.0" encoding="utf-8"?><?DOCTYPE html PUBLIC "=//ww.w3.org//1999/TR/xhtml 11/DTD/xhtml11.dtd"><html xmlns="http://w3.org/1999/xhtml"><head><title> Student USN</title></head><h1> Validating student USN</h1><body><center><script type="text/javascript">functionfunc(usn){
var pattern1=/^[1-4][A-Z]{2}[0-9]{2}[A-Z]{2}[0-9]{3}$/ if (!usn.value.match(pattern1)||usn.value.length==0) {
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
5 b. Modify the 5a program to get the current semester also(restricted to be a number from 1 to 6)
SOURCE CODE<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>USN and Semester Validation</title></head><body><center><script type="text/javascript">functionfunc(usn,sem){
var pattern1=/^[1-4][A-Z]{2}[0-9]{2}[A-Z]{2}[0-9]{3}$/if(!usn.value.match(pattern1)||usn.value.length==0){
alert ("Invalid USN!\nEnter a valid USN")return false
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
</center></body></html>
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
6 a. Develop and demonstrate using javascript script, a XHTML document that contains three images, stacked on top of each other, with only enough of each showing so that the mouse cursor can be placed over a sime part of them . When the cursor is placed over the exposed part of any paragraph, it should rise to the top to become completely visible
SOURCE CODE<?xml version="1.0" encoding="utf-8"?><!DOCTYPE html PUBLIC"-//w3c//DTD xhtml 1.1//EN""http://www.w3.org/tr/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>Stack Layers</title><style>p{
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT:
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
6 b. Modify the above (6a) document so that when an image is moved from the top stacking position it returns to its original position rather then to the bottom
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
OUTPUT 2:
8a. Design an XML document to store information about a student in an engineering college affiliatd to vtu the information must include usn name
MCA Department of P.G Studies, VTU, Belgaum Page no.
USN: 2VX13MCA14 SUBJECT CODE:13MCA18
name of the college branch year of joining and e-mail id. Make up sample data data for 3 students .Create a css style sheet and use it to display the document.