You are on page 1of 19

KU 5TH SEM PRACTICAL SOLUTIONS

Set 1
//1. Open an Image. And separate background using selection tool. Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select image ->click open Step 4: click on magic wand tool from tool menu Step 5: select on background of the image using magic wand tool Step 6: press delete on keyboard Step 7: go to file menu -> save as Step 8: select JPEG format Step 9: enter file name -> click SAVE //2. Write a JSP page to display the number of hits to this page. (Hint: use application scope of java bean). <%@ page session="false" %> <HTML> <HEAD> <TITLE>Page Counter Using URL Rewriting</TITLE> </HEAD> <BODY> <H3>Page Counter Using URL Rewriting</H3> <% int count = 0; String parm = request.getParameter("count"); if (parm != null) count = Integer.parseInt(parm); if (count == 0) { %> This is the first time you have accessed this page. <% } else if (count == 1) { %> You have accessed the page once before.<% } else { %> You have accessed the page <%= count %> times before.<% } %> <P> Click <A HREF="urlrewriting.jsp?count=<%=count + 1 %>" >here</A> to visit the page again. </BODY> </HTML>

Set 2

jsp" method="post"> Please Enter Your Detials !<br> First Name <input type="text" name="firstname"><br> Last Name <input type="text" name="lastname"><br> <input type="submit" name="submit" value="Submit"> </form> </center> </body> </html> Next. click on preset -> select landscape in size box -> press OK Step 4: click on pencil tool in tool menu Step 5: draw an image in landscape using pencil tool Step 6: right click on pencil tool and select brush tool Step 7: using brush tool. Create a login JSP page with username.//1. charset=UTF-8"> <title>JSP Page</title> </head> <body> <% . b. Create an HTML page containing the following features a. <%@page contentType="text/html"%> <html> <head> <title></title> </head> <body> <center> <form action="next. and color it with Brush tool. c. fill the color in landscape image Step 8: go to file menu -> save as Step 9: select JPEG format Step 10: enter file name -> click SAVE //2.jsp <%@page contentType="text/html"%> <%@page pageEncoding="UTF-8"%> <html> <head> <meta http-equiv="Content-Type" content="text/html. display message „Thank you for logging in‟ also create cookies to store username and password. If the cookie is present the username and password field should be automatically populated with the values from the cookie. Open login JSP page on a new browser. Step 1: run Photoshop Step 2: click file menu -> new -> select size -> press OK Step 3: in dialog box. On submit. password and submit button. Using pencil tool create an image of landscape.

else if(time>17) out.println("\n Good Afternoon !"). create a clone image Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select image -> click open Step 4: select rubberstamp tool from tool menu Step 5: press ALT then left click on image to begin Step 6: click on the image and drag where you want to make clone of that image Step 7: go to file -> save as Step 8: select JPEG format Step 9: enter file name -> click SAVE .getParameter("lastname"). After 5PM display message as „Good evening‟. if(time>5 && time<12) out.getHours().println("\n Good Evening !"). int time=d.println("\n Good Morning !"). If time is between 5AM and 12 PM display welcome message as „Good Morning‟ b.String firstname=request. String lastname=request.Date d=new java. If time is between 12 PM and 5 PM display welcome message as „Good Afternoon‟ c. <%@page language="java"%> <html> <head> <title>Welcome</title> </head> <body> <h1> <% java. a. %> </body> </html> "+firstname+" "+lastname+" Thank you for Set 3 //1.Date().util.getHours()%>:<%=d. Using Rubberstamp tool. out. esle if(time>12 && time<17) out. %> </h1> current time is :<%=d.println("<font color=blue>Welcome</font> loging in!").getParameter("firstname").util.getMinutes()%> </body> </html> //2. Write a JSP program to display current date and time and suitable welcome message.

} if(num==3) { window. Step 1: run Photoshop Step 2: go to file menu -> new -> select size -> press ok Step 3: select gradient tool from tool menu Step 4: choose gradient (linear/ radial/ angle/ diamond) from option toolbar Step 5: press left click on mouse then drag on image to create gradient Step 6: go to file -> save as Step 7: select JPEG format Step 8: enter file name -> click SAVE //2.vibgyor. the message in the status bar of the window must be reflect the value selected in the combo box (hint: on change event of the combo box). Yellow. } if(num==1) { window. A combo box containing the list of 7 colors: Violet.". Indigo. Depending upon the color selected from the above combo box.".frm. Blue.status="You have selected Green.status="You have selected Indigo. Using Gradient tool.status="You have selected Blue. } if(num==2) { window. . create some backgrounds for photos.Set 4 //1.Create an HTML page containing the following features a. if(num==0) { window. Green.".". <html> <head> <title>Showing Message in Status Bar</title> </head> <body> <script language="JavaScript"> functionfn() { num=document. } if(num==4) { . Orange.selectedIndex. Red b.status="You have selected Violet.

Depending upon the color selected from the above combo box. Blue.status="You have selected Orange. An empty 1X1 table with default background color: White c. A combo box containing the list of 7 colors: Violet.status="You have selected Yellow. } if(num==6) { window. } } </script> <form name="frm"> <select name="vibgyor" onChange=fn()><option>Violet</option> <option>Indigo</option> <option>Blue</option> <option>Green</option> <option>Yellow</option> <option>Orang</option> <option>Red</option> </select> </form> </body> </html> Set 5 //1.frm. Create an HTML page containing the following features a.". <html> <head> <title> Changing Table Color by selecting color from the ComboBox </title> </head> <body> <script language= "JavaScript"> functionfn() { num=document.status="You have selected Red. Indigo. } if(num==5) { window. if(num==0) { document. Green. Orange.vibgyor.getElementById("tab").".".selectedIndex. Yellow. the background of the table must be changed accordingly. Red b. (hint: on change event of the combo box).window. .bgColor="Violet".

bgColor="Indigo".getElementById("tab"). } if(num==3) { document.getElementById("tab").bgColor="Blue". } if(num==6) { document.getElementById("tab"). } } </script> <form name="frm"> <select name="vibgyor" onChange=fn()> <option>Violet</option> <option>Indigo</option> <option>Blue</option> <option>Green</option> <option>Yellow</option> <option>Orange</option> <option>Red</option> </select><br><br><br><br> <table id="tab" border="1"> <tr> <th>Name</th> <th>Registration Number</th> </tr> <tr> <td>priyanka rani</td> <td>072B5725</td> </tr> </table> </form> . } if(num==2) { document.bgColor="Green".bgColor="Yellow".getElementById("tab"). } if(num==5) { document.bgColor="Orange".getElementById("tab").bgColor="Red". } if(num==4) { document.getElementById("tab").} if(num==1) { document.

Now color the image Using COLOR BALANCE. Write a HTML page containing an HTML form to capture the following properties from the user: a. Name (text box) b. Import a „JPEG‟ format image and save it as a „PSD‟ image. to validate Name to contain only alphabets and of maximum length should be 25 . to validate phone number to contain only numeric data.</body> </html> //2. to validate Address field to contain maximum length of 200 characters. LEVELS and CURVES Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select a portrait JPEG image ->click open Step 4: go to image -> mode -> click on Grayscale Step 5: click “discard” in message box Step 6: go to image -> adjustments -> image -> click on „curves‟ Step 7: adjust curves -> press OK Step 8: go to file -> save as Step 9: select JPEG format Step 10: enter file name -> click SAVE //2. Show appropriate on failure and focus the „Address‟ field text area c. convert it into grayscale. Tips: Ctrl + Shift + S = „save as‟ window Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select a JPEG image -> click open Step 4: go to layer -> new -> click on „layer from background‟ Step 5: enter layer name in dialog box -> press OK Step 6: press F7 then decrease opacity Step 7: go to file -> save as Step 8: select PSD format Step 9: enter file name -> click SAVE Set 6 //1. Phone (text box) Write javascript functions a. Show appropriate messages on failure b. using layer options Decrease the opacity of image. Open a PORTRAIT image. show appropriate messages on failure <html> <head> . Address (text area) c.

} if(address.Name.focus(). } if (!isNaN(name)) { alert("Name field must be filled with only Alphabets").f1. return. name.Address.length> 25) { alert("Name Field cannot contain more than 25 characters"). } if (name.value. var address=document. } if (isNaN(phone)) { alert("Phone Number must be numeric"). } if(phone.focus().<title> HTML form </title> <Script language="javaScript"> function f() { var name=document.Phone.f1.length=="") { alert("Please enter phone numbar"). phone. name. return.length=="") { alert("Please enter name"). return.focus(). return.value.focus().value. name.focus(). . var phone=document.length=="") { alert("Please enter address"). if(name.f1. phone. return.

&nbsp.<input type=textbox name="Name"><br> Phone:&nbsp.&nbsp. Second Name of the user iii.&nbsp.&nbsp. The Second page receives the data submitted by the First Page. <First Name> <html> <head> <title></title> </head> <body> <center><img src="NIITLogo. Create two HTML pages a.length> 200) { alert("Address Field can contain maximum of 200 character").jpg"></center> <center> <form action="ToShowDataToAnotherPage" method="post"> Please Enter Your Detials !<br> First Name <input type="text" name="firstname"><br> Last Name <input type="text" name="lastname"><br> <input type="submit" name="submit" value="Submit"> </form> . A submit button to the submit the data to the next page b. return. An image(logo) with a company name as the heading in the top center ii. } } </script> </head> <body bgcolor="pink"> <marquee><h1 align="center">A Sample FORM </h1></marquee> <form name=f1> Name:&nbsp.address. two text boxes to get First Name. This page containing an HTML form.&nbsp. } if (address. displays the following message Welcome <Last Name>.&nbsp.focus().&nbsp.<input type=textbox name="Phone"><br> Address:&nbsp.&nbsp.&nbsp.&nbsp.<textarea rows="5" cols="50" name="Address"></textarea><BR> <input type=Button name=''Button" value ="Submit" onclick=f()> </form> </body> </html> Set 7 //1. First page with the following features i.&nbsp.

Step 1: run Photoshop Step 2: go to file menu -> new -> select background size -> press OK Step 3: go to filter -> noise -> add noise Step 4: adjust amount in noise dialog box -> press OK Step 5: go to file menu -> open . Open a portrait.servlet. and now change the color of eyes using Hue / saturation. IOException { response. Tips: Ctrl + U = Hue / saturation Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select image ->click open Step 4: click on marquee tool from tool menu Step 5: select eyeball from the image using marquee tool Step 6: press CTRL+U Step 7: adjust HUE AND SATURATION from dialog box -> press OK Step 8: go to file -> save as Step 9: select JPEG format Step 10: enter file name -> click SAVE Set 8 //1. importjavax.io. import java.</center> </body> </html> ToShowDataToAnotherPage servlet import java. Open 3 to 4 images in a same layer.*.*.setContentType("text/html.*.getWriter().println("<font color=blue>Welcome</font> } } "+firstname+" "+lastname). select the eyeballs using marquee tool. importjavax. String firstname=request.charset=UTF-8").http. String lastname=request. out. PrintWriter out = response. Using filter effects create creative backgrounds for book cover page. //2.*.getParameter("lastname").getParameter("firstname").servlet. HttpServletResponse response) throwsServletException.net. public class ToShowDataToAnotherPage extends HttpServlet { protected void doPost(HttpServletRequest request.

The following is the song database available in the library: c. b.No. The name of the songs must be hyper linked to the songs. so that the users must be able to download songs. Library Name: Hariharan Music Site Slno Song Name Film Artiste 1 PATA-PATA Apthamitra Udith Narayan 2 Kana Kanade Apthamitra Madhubalakrishna 3 Anku Donku Apthamitra S P Balasubramanyam 4 Kalavanu Thadeyoru Apthamitra Hariharan 5 Bombe Anayya Unknown <html> <head> <tittle> Hiriharan Songs Site </title> </head> <body> <marquee><font color = blue><b>Welcome to Hariharan's Songs Site</b></font></marquee> <center> <table border=1> <tr> <th>S.html">Patta-Patta</a></td> <td>Apthamitra</td> <td>Udit Narayan</td> </tr> <tr> <td>2. Create a HTML page to display a list of film songs available in the library.</th> <th>Song Name</th> <th>Film</th> <th>Artist</th> <tr> <tr> <td>1.html">Kana Kanede</a></td> <td>Apthamitra</td> <td>Madhubalakirishna</td> </tr> . copy and paste them in background one by one Step 8: go to file -> save as Step 9: select JPEG format Step 10: enter file name -> click SAVE //2.Step 6: select 3-4 images -> click open Step 7: select images.</td> <td><a href="song1.</td> <td><a href="song2. The following are features of the page a.

html">AnkuDonku</a></td> <td>Apthamitra</td> <td>S P Balasupramanniyam</td> </tr> <tr> <td>4.</td> <td><a href="song3.html">Bombay</a></td> <td>Anaya</td> <td>Unknown</td> </tr> </table> </center> </body> </html> Set 9 //1. Create an HTML page to display the following data using <table></table> tags First Name Last Name City Phone Number Shiva Rama Mysore 08212569964 Pratap S Bangalore 08025689754 Sreenivas G Mercara 08965445454 <html> <head> </head> <tittle> Data Table </title> <body> <table border=1> <tr> <th>First Name</th> <th>Last Name</th> <th>City</th> <th>Phone Number</th> <tr> <tr> <td>Shiva</td> <td>Rama</td> <td>Mysore</td> <td>08212569964</td> </tr> <tr> .</td> <td><a href="song4.<tr> <td>3.

<td>Pratap</td> <td>S</td> <td>Bangalore</td> <td>08025689754</td> </tr> <tr> <td>Shrinivas</td> <td>G</td> <td>Mercara</td> <td>08965445454</td> </tr> </table> </body> </html> //2. Put the title as “World of HTML” <html> <head> </head> <title> Welcome to the world of HTML </title> <body> <i>"Hello World</i><b>Welcome to the world of HTML"</b> </body> </html> //2. Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select an image with 22 cm x 29 cm size -> click open Step 4: go to image -> image size . Tips: Ctrl + L = level Step 1: run Photoshop Step 2: go to file menu -> open Step 3: select an image -> click open Step 4: go to image -> adjustments -> click on level or press ctrl + l Step 5: adjust level -> press OK Step 6: go to file -> save as Step 7: select JPEG format Step 8: enter file name -> click SAVE Set 10 //1. Change an image size 22 cm x 29 cm to 44 cm x 58 cm. Welcome to the world of HTML”. Write HTML script to display “Hello World. and resolution 72 to 300. Open an image and adjust a level of image.

Step 1: run Photoshop Step 2: go to file menu -> new -> select size -> click OK Step 3: click on text from tool menu Step 4: type text “GRADATION” Step 5: click on layer from layer property Step 6: right click on selected layer and click on „blending options‟ Step 7: click and check on „gradient overlay‟ Step 8: adjust gradient or change angle to 0o -> then press OK Step 9: go to file menu -> save as Step 10: select JPEG format Step 11: enter file name -> click SAVE //2.Step 5: change image size to 44 cm x 58 cm size with 100 resolutions -> press OK Step 6: go to file -> save as Step 7: select JPEG format Step 8: enter file name -> click SAVE Set 11 //1. Step 1: run Photoshop Step 2: go to file menu -> new -> select size -> press OK Step 3: click on „custom shape tool‟ from tool menu Step 4: click on „custom shape picker‟ in options toolbar Step 5: click on smart tag -> select all then click append Step 6: choose shape from option toolbar Step 7: left click on background and drag mouse to draw shape Step 8: go to file -> save as Step 9: select JPEG format Step 10: enter file name -> click Save Set 12 //1. using shape tool. Create some geometrical shapes. Type text „GRADATION‟ and apply gradient tool on text. Create an HTML page to display the following data using <table></table> tags First Name Last Name City Phone Number Shiva Rama Mysore 08212569964 Pratap S Bangalore 08025689754 Sreenivas G Mercara 08965445454 <html> <head> </head> <tittle> Data Table </title> .

. initgraph(&gdriver.gmode=0. Int x.h> const float PI=3.&gmode.14154.0.y.479). void main() { int gdriver=DETECT.h> #include<conio."c:\\tc\\bgi").h> #include<math. int I.<body> <table border=1> <tr> <th>First Name</th> <th>Last Name</th> <th>City</th> <th>Phone Number</th> <tr> <tr> <td>Shiva</td> <td>Rama</td> <td>Mysore</td> <td>08212569964</td> </tr> <tr> <td>Pratap</td> <td>S</td> <td>Bangalore</td> <td>08025689754</td> </tr> <tr> <td>Shrinivas</td> <td>G</td> <td>Mercara</td> <td>08965445454</td> </tr> </table> </body> </html> Set 13 //1. #include<stdio. rectangle(0.639. cleardevice(). Write C Program to create Indian Flag.h> #include<graphics.

i. y=getmaxy()/2.400.20. } setcolor(CYAN). while(!kbhit()) { .270. settextstyle(TRIPLEX_FONT.q.h> void main() { int gd=DETECT.50). initgraph(&gd. getch(). floodfill(85." JAI HIND!!!" ) .h> #include<stdlib. setfillstyle(SOLID_FILL.215. struct arccoordstype arcinfo. for(I=0. rectangle(80.x. floodfill(85.&gm.k++) putpixel(random(620).560. j=0."INDIAN FLAG"). } //2. circle(320.outtextxy(250."c:\\tc\\bgi"). y=50*sin(I*PI/180).j.random(419).GREEN).160).getmaxcolor()).y. floodfill(85.50.560. p=0.I+=15) { x=50*cos(I*PI/180).h> #include<dos. flag=0.HORIZ_DIR.215-y). for(k=0. i=0.15).6).h> #include<conio.560.215.p.getmaxcolor()).I<=360.getmaxcolor()). Write C Program to create FISH structure using basic geometric Functions.LIGHTRED). line(80. setcolor(BLUE).380).WHITE).k.flag.270).k<500. line(320.60. setfillstyle(SOLID_FILL. #include<graphics. line(80. setfillstyle(SOLID_FILL. setcolor(WHITE).320+x.160.170.gm.280. q=0. outtextxy(200.

20+i.5).y+20.y+8).y-25).y+20. Write Open GL Program to create a Window and display HELLO inside.y-6. line(130+i.y). if(flag==1) p=p-2. line(30+i.y+45+q). if(j<=-10) flag=1.y+25.y-45+j.y.y-20. line(0+i. } getch().line(0+i. if(flag==1) j=j+2.y+8.60.y-20). if(flag==0) p=p+2.y). line(140+i.y+3.100+i.y-5). #include<GL/glut.y-25.20+i.100+i. ellipse(80+i. if(flag==0) j=j-2. if(i>=638) i=0. line(60+i.130+i. cleardevice().140+i.30+i. /*triangle*/ line(0+i. line(60+i.0+i. circle(120+i. delay(10). } Set 14 //1.y+25).y+45+q.q=q+2.25). else if(j>=0) flag=0.350+p.h> void display(void) .y-45+j).10-p. closegraph(). i=i+3. line(30+i.30+i.q=q-2.

{ glClear(GL_COLOR_BUFFER_BIT). glColor3f(1.25.0). background-color:black"> <img src="file:///C:/banner. glutCreateWindow(“HELLO”). background-color:black.0). glLoadIdentity(). } Void init(void) { glClearColor(0. .250).0. init(). } Int main(int argc.0.-1.gif" width=800 height=120></div> <div id="header" style="position:absolute.1. glVertex3f(0. glVertex3f(0.25. glEnd().argv).0.0.0).0.0. glMatrixMode(GL_PROJECTION). glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB).0. Create a simple static web page for a college (assume necessary information) <html> <head> <title>My College Site</title> </head> <body bgcolor="gray" text="white" > <div id="banner" style="width:800px.0.0.1. glVertex3f(0.0. } //2.1. glutInitWindowSize(250.25.0.1. top:135px.0).char**argv) { glutInit(&argc. return 0.0. glutDisplayFunc(display). glutMainLoop().0.0. glBegin(GL_POLYGON). width:350px.25.75. glVertex3f(0. width:200px.100).0).75. glOrtho(0.0.1.25). height:120px.0.0. height:75px"> <div><h1><font color="red" face="Monotype corsiva">My College Site</font></h1></div> </div> <div id="header" style="position:absolute.0).0. top:30px.75. glutInitWindowPosition(100.0.0.0.0. left:100px. glFlush().75.

background-color:black.html">About Us<a></li> </ul> </div> <div id="header" style="position:absolute. height:500px"> <h3><font color="red">Online Admission</font></h3> <form id="frm1"> Enter your name: <input type="text" id="text1" /> <br/><br/> Gender: <input type="radio" id="gender1" name="gend" />Male <input type="radio" id="gender1" name="gend" />Female <br/><br/> Qualification: Matric<input type="checkbox" id="check1" /> Enter<input type="checkbox" id="check1" /><br/><br/> <input type="reset" value="Reset" /> <input type="submit" value="Submit" post="" /><br/><br/> </form> </div> </body> </html> .html">Sitemap<a></li> <li><a href="About.html target="_self">Home</a></li> <li><a href="Sitemap. left:215px. top:135px.height:500px"> <ul id="listitem" type="circle"> <li><a href=abc. width:590px.