Академический Документы
Профессиональный Документы
Культура Документы
Technologies
Author(s)
Campus Connect
Customization for FP 4.0
Kalpana
Authorized by
Pramod Panda
Creation/Revision Date
Sep 2014
Version
4.0
COPYRIGHT NOTICE
2014 Infosys Limited, Bangalore, India. All Rights Reserved.
Infosys believes the information in this document is accurate as of its publication date; such
information is subject to change without notice. Infosys acknowledges the proprietary rights of
other companies to the trademarks, product names and such other intellectual property rights
mentioned in this document. Except as expressly permitted, neither this documentation nor
any part of it may be reproduced, stored in a retrieval system, or transmitted in any form or by
any means, electronic, mechanical, printing, photocopying, recording or otherwise, without the
prior permission of Infosys Limited and/ or any named intellectual property rights holders
under this document.
Education, Training and Assessment Department
Infosys Limited
Electronics City
Hosur Road
Bangalore - 561 229, India.
Tel: 91 80 852 0261-270
Fax: 91 80 852 0362
www.infosys.com
mailto:ETA@infosys.com
Version
Date
Author(s)
Reviewer(s)
Description
1.0
Jan 2014
Anil Kumar P
Manjunatha Prasanna
Vijay Kumar Dani
2.0
Jun 2014
Anil Kumar P
Malathi M
Suhird Singh
Manjunatha Prasanna
Mohana Krishna B G
Version
Date
Author(s)
Reviewer(s)
Description
4.0
Sep 2014
Kalpana
CONFIDENTIAL
Contents
COPYRIGHT NOTICE .............................................................................................................................................................. i
Contents .................................................................................................................................................................................. iii
Assignments for Introduction to UI Concepts and Web Technologies ...................................................................................... 1
Context................................................................................................................................................................................... 1
Guidelines .............................................................................................................................................................................. 1
Assignment 1: Explore on your social Network .................................................................................................................... 2
Assignment 2: Impact of Web ............................................................................................................................................... 2
Assignment 3: Network Components .................................................................................................................................... 3
Assignment 4: Interconnecting Devices ................................................................................................................................ 4
Assignment 5: IP Addressing and Types of Web Content ..................................................................................................... 5
Assignment 6: Understanding Browsers and HTML ............................................................................................................. 5
Assignment 7: Ways to Apply CSS and its formatting .......................................................................................................... 7
Assignment 8: Chaining of Selectors and Class in CSS ....................................................................................................... 8
Assignment 9: Using div, Span, list, hyperlink and images in CSS....................................................................................... 9
Assignment 10: Creating Tables and Form Elements in HTML ......................................................................................... 12
Assignment 11: Understanding the client side Java Script .................................................................................................. 16
Assignment 12: Understanding functions and scope of variables........................................................................................ 18
Assignment 13: Understanding typeof operator and in-built functions ............................................................................... 21
Assignment 14: Functions and Dialog boxes ....................................................................................................................... 22
Assignment 15: Applying styles to Tables and Form Elements .......................................................................................... 25
Assignment 16: Creating Interactive Webpage and Apply CSS, Form Validation and submission using JavaScript ........ 27
CONFIDENTIAL
Infosys Limited
Guidelines
1. All assignments in this document must be completed in order to complete the
course
2. The assignments need to be completed as instructed by the facilitators and
submitted appropriately
3. In order to complete the course, assignments in this document must be
completed in the sequence mentioned
Page 1 of 30
Infosys Limited
Google
Twitter
Yahoo
You Tube
Amazons Cloud Service
Q1: Active Users for all the above social networks.
Q2: Number of visitors per day
Q3: Data Storage or sharing per day
Q4: Number of Hits per day
Q5: Number of video uploads per minute in you tube.
Q6: Number of page in google index
Social Network 2014
Yahoo
YouTube
Amazons Cloud
Service
Active Users
Visitors (per day)
Data (per day)
No. of Hits (per day)
Page 2 of 30
Infosys Limited
invention of microprocessor (AD 1971). The first Personal computer was rolled out by
IBM in the year 1981. All these inventions have had a great impact on day to day life of
people.
Q1: In the last 40 years, what in your opinion is the significant revolution which has
transformed the life style of people with the use of interconnected computers?
Q2: Can you list few popular online applications/systems which you have used for the
following services?
Q3: Which is your favorite web-browser? What makes it different from the other
browsers? Where is the content displayed in the browser coming from?
Estimated time: 10 minutes
Page 3 of 30
Infosys Limited
One more thing: You cannot perform any operation on the black box. You can't do
anything with black box. You have access to two hosts only.
Identify the network component that can be suitably used for the below criteria.
Scenario 1: The two hosts have IP addresses in different IP networks.
Scenario 2: A broadcast ping (ie: 255.255.255.255) from one host does not increment
traffic counters on the other host.
Scenario 3: Either hosts' ARP table does not have an entry for the other host.
Estimated time: 5 minutes
Summary of this assignment:
You have learnt to identify the different interconnecting devices for the given
scenarios.
Page 4 of 30
Infosys Limited
1. (b) Problem Description: Identify the appropriate web content type for the following
scenarios.
1. LiveFree hospital is a reputed medical organization known for its social activities.
Recently, management organized free medical checkup camp as part of social
responsibility activities. Jane, the coordinator of the medical camp uploaded the photos
and shared the link to other employees for viewing.
Note: To get the above information: Go to the command prompt: Start > Run and type, cmd. At the prompt type, ipconfig -all.
Page 5 of 30
Infosys Limited
Background: HTML file is a text file containing markup tags. HTML file can be created
using a text editor. You can view the pages with a program called a Web browser.
Popular browsers are Internet Explorer (from Microsoft) and Netscape Navigator
(from Netscape Communications) now known as Mozilla Firefox. Opera is a very
popular alternative browser. Lynx is a text browser for the World Wide Web.
Note: You can easily edit HTML files using a WYSIWYG (what you see
is what you get) editor like FrontPage, Visual Interdev etc. However,
these tools do not generate much optimized HTML code. As a
programmer, you should be able to create and edit HTML files using text
editors like Notepad or Textpad. In the entire course you are supposed
to use only a text editor
Step 2: Select menu option, view -> source. You can find the HTML tag that creates the
sparsh home page.
Page 6 of 30
Infosys Limited
Step 3: Select menu option, Help -> About Internet Explorer. This should display the
version of the Internet Explorer browser you are using.
Step 4: What is the version of Internet Explorer you are using?.
Page 7 of 30
Infosys Limited
You have been provided with EasyShop_Ext_CSS folder that contains html_files, css
and images subfolders. You are expected to modify .css file as suggested below and
observe the changes in the HTML pages.
Estimated time: 15 minutes
Step 1: Take a copy of EasyShop_Ext_CSS folder to the desktop. Make the
modifications to style.css as per the following requirements.
Step 2: Modify the text format of EasyShop Manager heading in the banner area as
follows:
font-family to Cursive
color to #FF00FF
font-size to 30px
font-weight to normal
Step 3: Observe the changes to the text EasyShop Manager in the HomeScreen,
AddUser and AddCustomer pages.
Step 4: Modify the text format of Infosys Limited in the footer area as follows:
font-size to 10pt
font-family to Arial
font-weight to normal
font-style to italic
Step 5: Observe the changes to text Infosys Limited in the footer area of all the 3
screens
Summary of this exercise:
You have just learnt
Usage of different font properties in CSS file
Deliverables of the exercise:
1) style.css
Page 8 of 30
Infosys Limited
font-family as Calibri
color as # 58BE6C
font-style as normal
font-size as18px
font-weight as normal
Add a div tag with id as string to the following sentences in HomeScreen.html file:
Page 9 of 30
Infosys Limited
This application automates the retail processing. The application helps in faster
billing and easy maintenance of the stock and customer details.
Step 3: Observe the changes in the HomeScreen page.
Step 4: Add a new span id called RetailWord to the style.css with the following text
formatting values:
font-family as Cursive
color as # D0B173
font-size as 20px
Add a span tag with id as RetailWord to the following words in HomeScreen.html file:
retail chain
Step 5: Observe the changes to the words retail chain in the HomeScreen page.
Step 6: Take a copy of EasyShop_Ext_CSS folder to the desktop. Make the
modifications to HomeScreen.html as per the following requirements.
Step 7: Add a new list item called Working Staff as the last item to the user groups in
HomeScreen.html file as follows:
1.
2.
3.
4.
Administrator
Manager
Billing Staff
Working Staff
Administrator
Manager
Billing Staff
Working Staff
Step 10: Remove Manager list item from the above unordered list. (delete <li> tag for
Manager)
Page 10 of 30
Infosys Limited
Step 11: Modify the text of the items in the unordered list of the previous requirement
with the following properties:
font-family as Tahoma
color as # 76DECB
font-style as italic
Hint: Use li tag in the .CSS file and apply the above mentioned properties to the same.
Step 11: Modify the above unordered list items from disc to square in .CSS file.
Hint: Use ul tag in the .CSS file and specify the appropriate type for list-style-type
property.
Step 12: Observe the changes to the ordered list in the HomeScreen page.
Step 13: Take a copy of EasyShop_Ext_CSS folder to the desktop. Make the
modifications as per the following requirements.
Step 14: Add a new link with the label Contact Us next to home link in AddUser.html
as follows :
Home | Contact Us
Link Contact Us label to ContactUs.html provided in the EasyShop_Ext_CSS folder.
Step 15: Add a new link with the label Contact Us next to home link in
AddCustomer.html as follows :
Home | Contact Us
Link Contact Us label to ContactUs.html provided in the EasyShop_Ext_CSS folder.
Step 16: Change the link properties for Contact Us in style.css as follows:
Change color as # A87648 for unvisited link
Change color as # 48A89E for visited link
Hint: Changes to be made for a:link{} and a:visited{}
Step 17: Add following two properties for the above mentioned links in style.css
Change the color as # 9AC25A for hover link
Change the color as # EEB281 for active link
Hint: a:hover{} and a:active{} is to be added as CSS properties
Page 11 of 30
Infosys Limited
Step 18: Observe the changes in AddUser page and AddCustomer page before visiting
the links and after visiting the links
Step 19: Take a copy of EasyShop_Ext_CSS folder to the desktop. Make the
modifications to HomeScreen.html as per the following requirements.
Step 20: Change the cart image to Cart 1.jpg in style.css
Step 21: Observe the changes in AddUser page, AddCustomer page, HomeScreen
Page and ContactUs Page.
Summary of this exercise:
You have just learnt
Usage <div> and <span> tag
Usage of text formatting in CSS
Ordered List
Unordered List
CSS properties of list
Usage of links in HTML
Applying CSS properties to links in HTML
Adding images to the existing HTML files
Deliverables of the exercise:
1. style.css
2. HomeScreen.html
3. AddUser.html
4. AddCustomer.html
5. style.css
Page 12 of 30
Infosys Limited
Page 13 of 30
Infosys Limited
Step 13: Elite should be selected as the default without changing the above
mentioned sequence.
Note : Refer to the screenshot for the above mentioned requirements
Page 14 of 30
Infosys Limited
Page 15 of 30
Infosys Limited
Page 16 of 30
Infosys Limited
<body>
<h1> First JavaScript Program</h1>
</body>
</html>
Note: To hide the script from the browsers, which are not supporting
JavaScript use HTML comments (<!-- , -->).
Step 2: Modify the FirstJS.html like the following and save as FirstError.html. Open
the page in the browser.
document.write(<h1>"Displaying using JavaScript"</h1>);
Observe the error message. Double click on the status bar, you would be able to see
the below screen.
In case
Step 3: Click on Show details button. The dialog box is showing that the error is at line
number 5 and the message is Syntax error. Let us examine the code at line number 5
document.write(<h1>"Displaying using JavaScript"</h1>)
Page 17 of 30
Infosys Limited
Page 18 of 30
Infosys Limited
Step 6: Open the modified AddSupplier.html in the browser. Input only spaces in the
supplier name field and click Submit button. Verify that the following output is displayed
Supplier Name cannot contain only spaces.
Page 19 of 30
Infosys Limited
Inference: The variable sName is defined as global and hence it is accessible by both
the functions valSupNameForEmpty and valSupNameForOnlySpaces
Step 7: Modify the definition statement of sName in the code by adding the keyword
var.
Step 8: Open the modified AddSupplier.html in the browser. Input only spaces in the
supplier name field and click Submit button. Verify that the following output is displayed
Supplier Name cannot contain only spaces.
Inference: Even though the variable sName is defined with the keyword var, still it is
global as it is defined outside all the functions. Hence sName is accessible by both the
functions, valSupNameForEmpty and valSupNameForOnlySpaces
Step 9: Remove the keyword var associated with sName definition. Place this
modified statement inside the function valSupNameForEmpty as the first statement.
Step 10: Open the modified AddSupplier.html in the browser. Input only spaces in the
supplier name field and click Submit button. Verify that the following output is displayed
Supplier Name cannot contain only spaces.
Inference: Even though the variable sName is defined inside the function
valSupNameForEmpty it is still global as it is NOT associated with var . Hence
accessible by valSupNameForOnlySpaces also.
Step 11: Now, add the keyword var with sName definition.
Step 12: Open the modified AddSupplier.html in the browser. Input only spaces in the
supplier name field and click Submit button. Verify that the following output is displayed
Supplier Name cannot contain only spaces.
Inference: As the variable sName is associated with var inside the function
valSupNameForEmpty , it is local to this function only. It is not accessible by
valSupNameForOnlySpaces. Hence the error message.
Page 20 of 30
Infosys Limited
after
conversion
is
Step 6: Open the modified AddSupplier.html in the browser. Input contact number and
click Submit button. Verify that the following output is displayed
Data type of contactNum is string
Data type of contactNum after conversion is number
Summary of this exercise:
You have learnt the following
There is no explicit data type for variables
Automatic conversion of types would take place in JavaScript
Usage of few in-built functions like 'typeof' , 'Number'
Deliverables of the exercise:
1) AddSupplier.html
Page 21 of 30
Infosys Limited
Step 3: Type the following code into a text editor and save it as funreturn.html.
<html><head>
<script type="text/javascript">
function addFun(num1,num2)
{
/* Comments : Returning value to the calling environment */
return num1+num2;
}
</script>
</head><body>
<h1> Function Demo</h1>
/* Comments : More than one script tag can be used in a document */
<script type="text/javascript">
document.write("<h1>Sum is "+addFun(20,50)+"</h1>");
</script>
Page 22 of 30
Infosys Limited
</body></html>
Step 4: Write a function called power(arg1, arg2) to find the power of the given number
and save it as power.html.
Note: The arguments of a function are maintained in an array. Within a
function, you can address the parameters passed to it as follows:
arguments[i]. The total number of arguments is indicated by
arguments.length.
Step 5: Type the following code and save it as funarg.html.
<html><head>
<script type="text/javascript">
/* Comments : function does not have any arguments, but arguments array will
store the arguments */
function dispStr()
{
for(count=0;count<arguments.length;count++)
{
document.write(arguments[count]+" ");
}
}
/* Comments : Calling function with three arguments */
dispStr("1one","1two","1three");
document.write("<br>");
/* Comments : Calling function with five arguments */
dispStr("2one","2two","2three","2four","2five");
</script>
</head><body></body></html>
Page 23 of 30
Infosys Limited
Step 6: Write a function which takes n number of arguments and return the average of
n numbers and save it as numarg.html
Note: There are three different types of dialog boxes (alert, prompt and
confirm) which are the methods of window object. All these three
dialog boxes are modal i.e. The user must close it before continuing.
Note: Event handlers are very powerful and useful in client side
scripting. They are JavaScript code that are not added inside the
<script> tags, but rather, inside the html tags, that execute JavaScript
when an event happens, such as pressing a button, moving your mouse
over a link, submitting a form ,etc. For Example
<input type="button" value="Close" name="but2" onClick="closeWin()">
Page 24 of 30
Infosys Limited
</script>
</head><body>
<form name="f1">
/* Comments : Event Onclick used with Add button . Hence on clicking the Add button
dispMsg() function is invoked */
<input type="button" value="Add" name="but1" onClick="dispMsg()">
<input type="button" value="Close" name="but2" onClick="closeWin()">
</form>
</body></html>
Page 25 of 30
Infosys Limited
Step 2: Modify the above code by including the above created style classes in a
separate external file cssexternal.css.
Step 3: Type the following code and save the file as cssform1.html.
<html>
<head>
<style>
input{
color:blue;
letter-spacing:3pt;
font-size:14pt;
}
form{
border: thick solid blue;
}
</style>
</head>
<body>
<form>
Name <input type="text" value="style"><br>
<input type="submit">
</form>
</body>
</html>
Step 4: create the following html file and save it as cssform2.html.
Page 26 of 30
Infosys Limited
Page 27 of 30
Infosys Limited
Step 1: Use AddCustomer.html page, which you have designed in Assignment 10.
<body>
<form>
<! Comment: The entire table should be inside the table tag-->
<table border=2>
<tr>
<td>User ID</td>
<td><input type=text name=txtname></td>
</tr>
</table>
</form><!Comment: close the form only after the </table> tag -->
</body>
Note: Some special elements.
<input type=file> : This control is used for file uploading.
<input type=button> : This control used to create a button that has no
predetermined actions(rest (or) submit).
<input type=hidden> : Used to store some temporary data(hidden) that
can be accessed by client side or server side programs.
<input type=image> :This control is used to create a graphical version
of the submit button.
Page 28 of 30
Infosys Limited
Step 2: Write the Scripting code to validate the form and add the values to the
database.
Step 4: Partial JavaScript code for SQL Database connection for adding and retrieving
the data from the database.
<script type="text/javascript">
function DataSubmit()
{
var connection = new ActiveXObject("ADODB.Connection") ;
var connectionstring="Data Source=<server name>;Initial
Catalog=<DatabaseName>;Integrated Security=SSPI;Provider=SQLOLEDB";
connection.Open(connectionstring);
var rs = new ActiveXObject("ADODB.Recordset");
rs.Open("SELECT * FROM TableName", connection);
connection.execute("insert into );
rs.MoveFirst
while(!rs.eof)
{
document.write(rs.fields(column1)+\t+ rs.fields(column2));
rs.movenext;
}
rs.close;
connection.close;
}
</script>
Page 29 of 30
Infosys Limited
Page 30 of 30