Showing posts with label solved assignment. Show all posts
Showing posts with label solved assignment. Show all posts

Sunday, 10 September 2017




Answer all the questions. Each question carries 40 marks. 20 marks are for viva-voce. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation.

  1. Characterize the architectural operations of SIMD and MIMD computers. Distinguish between Multiprocessors and Multicomputers based on their structures, resource sharing, and interprocessor communications. Also, explain the differences among UMA, NUMA, COMA and NORMA computers.
  2. Explain the differences between string reduction and graph reduction machines.



This assignment has eight questions. Answer all questions. Each question is of 10 marks. Rest 20 marks are for viva voce. You may use illustrations and diagrams to enhance the explanations. Please go through the guidelines regarding assignments given in the Programme Guide for the format of presentation. Answer to each part of the question should be confined to about 300 words.

  1. What is ERP? Explain different components of an ERP system. Compare ERP with other similar software solution.
  2. What is portfolio management? Discuss the uses and significance of various tools used to automate the portfolio management processes.
  3. Discuss why management needs information. Is it possible for the management of an organization to make effective decisions without the aid of an information system? Explain.
  4. How are databases used in e-business? How does e-business fit into different locations within the production chain?
  5. What is the role of OLAP in decision-making? What does the term drill mean down in an executive information system?
  6. Explain different advantages and disadvantages of Knowledge Management in Organisations.
  7. Explain some of the security threats to information systems? How does encryption ensure data security?
  8. What is total cost of ownership (TCO)? What are the different cost factors for computation of the TCO of any system? Explain.

Thursday, 7 September 2017



There are eight questions in this assignment, which carried 80 marks. Rest 20 marks are for viva-voce. Answer all the questions. Please go through the guidelines regarding assignments given in the Program Guide for the format of presentation. Use diagram as part of answer wherever required for better explanation.

1. What is OOAD? Explain concepts of generalization and specialization in OOAD, with the help of examples.

2. What is class diagram ? Draw class diagram for Online Banking System.

3. Explain advantage of use case diagram? Draw use case diagram for Online Banking System.

4. Draw a sequence diagram for Online Movie Ticket Booking System.

5. (a) What is inheritance ? Explain its advantages.
    (b) What is dynamic modeling? Explain its advantages

6. Explain relation of functional model with object model and dynamic model.

7. Draw a DFD for Online Admission System of an University. Make necessary assumptions required.

8. Write short note on followings (minimum in 300 words)
     i) One –way association and two-way association
     ii) Issues in Concurrency Control 

Monday, 1 February 2016

Q.1 Explain any 10 online payment systems and services.

Ans. : 10 Online payment systems and services are given below :

1. Google Wallet
This is essentially Google’s version of PayPal, complete with money transfers and a Google
Wallet Card! Since we’re all addicted to the Big G, it shouldn’t be all that difficult to spend
and receive money. Google also announced last month that it will be releasing a physical
card connected to users’ accounts so they can utilize Google Wallet at retail businesses. For
convenience, and the number of users, Google Wallet tops our list of the top 10 online
payment solutions.

2. PayPal
Obviously PayPal would be included in this list – it’s only one of the world’s most widely
used payment acquirers processing some 8 million payments every day. As of this writing,
PayPal has over 137 million active accounts in 193 markets and 26 currencies around the
world, which makes it easy to transfer and request payments. Other PayPal perks include
accepting checks through a smartphone’s camera, a card swiper, and allowing customers to
make a purchase without leaving your site.

3. Dwolla
Dwolla is a more recent competitor to PayPal with some outstanding benefits. For example,
you can transfer funds through email, phone, Facebook, LinkedIn, or Twitter. But, what
makes Dwolla so appealing is the fact that there are no fees for transactions less than $10
and $0.25 per transaction for transactions over $10.

4. Amazon Payments
Amazon Payments is a safe, easy and convenient method for users to receive money by
using Amazon’s API. Users can also send money via ACH (Automated Clearing House). Since
almost everyone has an Amazon account, all your important information has already been
stored.

5. Authorize.Net
It’s been stated that Authorize.Net is the most widely used payment gateway on the
internet – probably because it’s been around since 1996. Currently, there are over 375,000
merchants handling more than $88 billion in annual transactions safely through credit cards
and e-checks. Something’s going right over there.

6. ACH Payments
ACH Payments has several key features that make it one of the top payment systems
around. Pros include: being able to make global payments, as well as serving as a payment
gateway, merchant account, credit card processor, and mobile payment processor. It can
also handle ACH payments and can be used as a payroll system.

7. WePay
What makes WePay standout isn’t the fact that it’s a payment processor allowing internet
merchants to accept credit cards and bank account payments online, it’s the fact it’s
incredibly simple. In fact, you can begin accepting payments in under a minute. The only
drawback is that it’s only available for U.S. citizens.

8. Stripe
If you’re a developer, you should already be using Stripe. Developers use Stripe to integrate
a payment system into their projects through Stripe’s robust API. This prevents the need for
a merchant account, and also allows you to build your own payment forms that can bypass
PCI requirements.

9. WooCommerce
WooCommerce allows WordPress users to create their very own e-commerce shop. There
are several neat features that make this payment processor worth your time. Besides being
vendor and customer friendly, you can run coupon campaigns, manage your store’s daily
activities, learn about shipping and tax rules, and view your store’s overall performance.

10. 2CheckOut
2CheckOut is a payment processor which is a combination of a merchant account and
payment gateway that doesn’t require PayPal or a Merchant account. Simply register and
verify your account and you can start accepting credit card payments, and even PayPal
payments. The company also offers international payments, shopping cart stores, and a
recurring billing feature.


Q.2. How can e-commerce portals make shopping secure.

Ans. : E-commerce portals make shopping secure many ways and some ways are given
below :
  • Choose a secure ecommerce platform. "Put your ecommerce site on a platform that uses a sophisticated object-orientated programming language," says Shawn Hess, software development manager, VoIP Supply.
  • "We've used plenty of different open source ecommerce platforms in the past and the one we're using now is by far the most secure," Hess says. "Our administration panel is inaccessible to attackers because it's only available on our internal network and completely removed from our public facing servers. Additionally, it has a secondary authentication that authenticates users with our internal Windows network."
  • Use a secure connection for online checkout--and make sure you are PCI compliant. "Use strong SSL [Secure Sockets Layer] authentication for Web and data protection," says Rick Andrews, technical director, Trust Services, Symantec.
  • "It can be a leap of faith for customers to trust that your ecommerce site is safe, particularly when Web-based attacks increased 30 percent last year. So it's important to use SSL certificates "to authenticate the identity of your business and encrypt the data in transit," Andrews says. "This protects your company and your customers from getting their financial or important information stolen." Even better: "Integrate the stronger EV SSL [Extended Validation Secure Sockets Layer], URL green bar and SSL security seal so customers know that your website is safe."
  • "SSL certificates are a must for transactions," Hess agrees. "To validate our credit cards we use a payment gateway that uses live address verification services right on our checkout," he says. "This prevents fraudulent purchases by comparing the address entered online to the address they have on file with their credit card company."
  • Don't store sensitive data. "There is no reason to store thousands of records on your customers, especially credit card numbers, expiration dates and CVV2 [card verification value] codes," says Chris Pogue, director of Digital Forensics and Incident Response at Trustwave.
  • "In fact, it is strictly forbidden by the PCI Standards," Pogue says. He recommends purging old records from your database and keeping a minimal amount of data, just enough for charge-backs and refunds. "The risk of a breach outweighs the convenience for your customers at checkout," he says. "If you have nothing to steal, you won't be robbed."
  • Employ an address and card verification system. "Enable an address verification system (AVS) and require the card verification value (CVV) for credit card transactions to reduce fraudulent charges," says Colin O'Dell, lead Magento developer for Unleashed Technologies.
  • Require strong passwords. "While it is the responsibility of the retailer to keep customer information safe on the back-end, you can help customers help themselves by requiring a minimum number of characters and the use of symbols or numbers," says Sarah Grayson, senior marketing manager for the Web Security Group at McAfee. "Longer, more complex logins will make it harder for criminals to breach your site from the front-end," she says.
  • Set up system alerts for suspicious activity. "Set an alert notice for multiple and suspicious transactions coming through from the same IP address," advises Deric Loh, managing director at digital agency Vault Labs. Similarly, set up system alerts for "multiple orders placed by the same person using different credit cards, phone numbers that are from markedly different areas than the billing address and orders where the recipient name is different than the card holder name."
  • Layer your security. "One of the best ways to keep your business safe from cybercriminals is layering your security," says Grayson. "Start with firewalls, an essential aspect in stopping attackers before they can breach your network and gain access to your critical information." Next, she says, "add extra layers of security to the website and applications such as contact forms, login boxes and search queries." These measures "will ensure that your ecommerce environment is protected from application-level attacks like SQL (Structured Query Language) injections and crosssite scripting (XSS)."
  • Provide security training to employees. Employees "need to know they should never email or text sensitive data or reveal private customer information in chat sessions as none of these communication methods is secure," says Jayne Friedland Holland, chief security officer and associate general counsel at technology firm NIC Inc..
  • "Employees also need to be educated on the laws and policies that affect customer data and be trained on the actions required to keep it safe," Holland says. Finally, "use strict written protocols and policies to reinforce and encourage employees to adhere to mandated security practices."
  • Use tracking numbers for all orders. "To combat chargeback fraud, have tracking numbers for every order you send out," advises Jon West, CEO, AddShoppers, a social commerce platform for retailers. "This is especially important for retailers who drop ship."
  • Monitor your site regularly--and make sure whoever is hosting it is, too. "Always have a real-time analytics tool," says Punit Shah, director of Marketing at online jeweler My Trio Rings. "It's the real-world equivalent of installing security cameras in your shop. Tools like Woopra or Clicky allow you to observe how visitors are navigating and interacting with your website in real time, allowing you to detect fraudulent or suspicious behavior," he says. "With tools like these we even receive alerts on our phones when there is suspicious activity, allowing us to act quickly and prevent suspicious behavior from causing harm." Also, make sure whoever is hosting your ecommerce site "regularly monitors their servers for malware, viruses and other harmful software," says Ian Rogers, SEO and Web developer, Mvestor Media, an SEO and website design company. "Ask your current or potential Web host if they have a plan that includes at least daily scanning, detection and removal of malware and viruses on the website.".
  • Perform regular PCI scans. "Perform regular quarterly PCI scans through services like Trustwave to lessen the risk that your ecommerce platform is vulnerable to hacking attempts," advises West. "If you're using third-party downloaded software like Magento or PrestaShop, stay on top of new versions with security enhancements," he says. "A few hours of development time today can potentially save your entire business in the future."
  • Patch your systems. "Patch everything immediately--literally the day they release a new version," says Kyle Adams, chief software architect for Junos WebApp Secure at Juniper Networks. "That includes the Web server itself, as well as other third-party code like Java, Python, Perl, WordPress and Joomla, which are favorite targets for attackers." "Breached sites are constantly found running a three-year-old version of PHP or ColdFusion from 2007," says Pogue. So it's critical you install patches on all software: "Your Web apps, Xcart, OSCommerce, ZenCart and any of the others all need to be patched regularly."
  • Make sure you have a DDoS protection and mitigation service. "With DDoS [Distributed Denial of Service] attacks increasing in frequency, sophistication and range of targets, ecommerce sites should turn to cloud-based DDoS protection and managed DNS services to provide transactional capacity to handle proactive mitigation and eliminate the need for significant investments in equipment, infrastructure and expertise," says Sean Leach, vice president of Technology, VeriSign. "The cloud approach will help [ecommerce businesses] trim operational costs while hardening their defenses to thwart even the largest and most complex attacks," he argues. "In addition, a managed, cloud-based DNS hosting service can help deliver 100 percent DNS resolution, improving the availability of Internet-based systems that support online transactions and communications."
  • Consider a fraud management service. "Fraud does happen. And for merchants, the best resolution is to make sure you are not holding the bag when it does," says Bob Egner, vice president of Product Management at EPiServer, a .NET content management and ecommerce product company. "Most credit card companies offer fraud management and chargeback management services. This is a practical approach to take because most security experts know there is no such thing as 100 percent safe."
  • Make sure you or whoever is hosting your site is backing it up--and has a disaster recovery plan. "Results from a recent study by Carbonite revealed businesses have big gaps in their data backup plans--putting them at risk for losing valuable information in the instance of power outage, hard drive failure or even a virus," says David Friend, CEO of Carbonite. So to make sure your site is properly protected, back it up regularly--or make sure your hosting service is doing so. 

Wednesday, 30 September 2015

ANSWER-1:-

1(a)(i):
In computing, a fixed-point number representation is a real data type for a number that has a fixed number of digits after (and sometimes also before) the radix point (after the decimal point '.' in English decimal notation). Fixed-point number representation can be compared to the more complicated (and more computationally demanding) floating-point number representation.

Fixed-point numbers are useful for representing fractional values, usually in base 2 or base 10, when the executing processor has no floating point unit (FPU) or if fixed-point provides improved performance or accuracy for the application at hand. Most low-cost embedded microprocessors and microcontrollers do not have an FPU.

1(a)(ii):
Roundoff error occurs because of the computing device's inability to deal with certain numbers. Such numbers need to be rounded off to some near approximation which is dependent on the word size used to represent numbers of the device.

1(a)(iii):
Floating-point number representations allow for the existence of two zeros, often denoted by −0 (negative zero) and +0 (positive zero), regarded as equal by the numerical comparison operations but with possible different behaviors in particular operations.





1(c):
Appox true value is :

3.1415926535897932384626433832795

this is called the level of accuracy or to how many significant digits places

pi appox equal 22/7 or 355/113

Depending on the Level of Accuracy desired

here some other value appox value for it

31 ^ (1/3)

54648/17395 accurate to 7 decimal places

(2143/22)^.25 or (97 9/22)^ (1/4) accurate to 9 decimal places

833009/ 265155 = pi to 10 decimal places

52163/16604 pi is accurate to the true value to six or seven decimal places

144029661/45846065

69305155/22060516

5419351/1725033


52,163/16,604 = 3.1415923873765357745121657431944

312689/99532

312689/99532

3 + 4/28 - 1/(790 + 5/6) appox PI

























Thursday, 3 September 2015

1. Write a TCP client and TCP server program in C language on UNIX operating system. The
client program begins by sending a request, after accepting the client request; server program
sends back a confirmation and its clock time to the client. Client program displays the server
clock time on its screen. The maximum concurrent clients this server can handle are four.
Display necessary messages, wherever necessary.
(20 marks)
Ans:
Header file Explanation 
#include <stdio.h> /* printf() and fprintf() */
#include <sys/types.h /* Socket data types */
#include <sys/socket.h> /* socket(), connect(), send(), recv() */
#include <netinet/in.h> /* IP Socket data types */
#include <arpa/inet.h> /* sockaddr_in, inet_addr() */
#include <stdlib.h> /* atoi() */
#include <string.h> /* memset() */

#include <unistd.h> /* close() */

TCP Client Program 
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

#include <unistd.h>
int main(int argc, char *argv[])
{
 printf("This is the client program\n");

 int sockfd;
 int len, rc ;
 struct sockaddr_in address;
 int result;
 char ch = 'A';

 //Create socket for client.
 sockfd = socket(PF_INET, SOCK_STREAM, 0);
 if (sockfd == -1) {
 perror("Socket create failed.\n") ;
 return -1 ;
 }

 //Name the socket as agreed with server.
 address.sin_family = AF_INET;
 address.sin_addr.s_addr = inet_addr("127.0.0.1");
 address.sin_port = htons(7734);
 len = sizeof(address);

 result = connect(sockfd, (struct sockaddr *)&address, len);
 if(result == -1)
 {
 perror("Error has occurred");
 exit(-1);
 }

 while ( ch < 'Y') {

 //Read and write via sockfd
 rc = write(sockfd, &ch, 1);
 printf("write rc = &#37;d\n", rc ) ;
if (rc == -1) break ;

 read(sockfd, &ch, 1);
 printf("Char from server = %c\n", ch);
 //if (ch == 'A') sleep(5) ; // pause 5 seconds
 }
 close(sockfd);

 exit(0);
}

TCP Server Program
#include <config.h>
 #include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>

/// SERVER

int main(int argc, char *argv[])
{ //Declaring process variables.
 int server_sockfd, client_sockfd;
 int server_len ;
 int rc ;
 unsigned client_len;
 struct sockaddr_in server_address;
 struct sockaddr_in client_address;

 //Remove any old socket and create an unnamed socket for the server.
 server_sockfd = socket(AF_INET, SOCK_STREAM, 0);
 server_address.sin_family = AF_INET;
 server_address.sin_addr.s_addr = htons(INADDR_ANY);
 server_address.sin_port = htons(7734) ;
 server_len = sizeof(server_address);

 rc = bind(server_sockfd, (struct sockaddr *) &server_address, server_len);
 printf("RC from bind = %d\n", rc ) ;

 //Create a connection queue and wait for clients
 rc = listen(server_sockfd, 5);
 printf("RC from listen = %d\n", rc ) ;

 client_len = sizeof(client_address);
 client_sockfd = accept(server_sockfd, (struct sockaddr *) &client_address, &client_len);
 printf("after accept()... client_sockfd = %d\n", client_sockfd) ;

 while(1)
 {
 char ch;
 printf("server waiting\n");

 //Accept a connection
 //client_len = sizeof(client_address);
 //client_sockfd = accept(server_sockfd, (struct sockaddr *) &client_address, &client_len);
 //printf("after accept()... client_sockfd = %d\n", client_sockfd) ;
 //Read write to client on client_sockfd

 rc = read(client_sockfd, &ch, 1);
 printf("RC from read = %d\n", rc ) ;
 if (ch=='X') break ;
 ch++;
 write(client_sockfd, &ch, 1);
 }

 printf("server exiting\n");

 //close(client_sockfd);
 close(client_sockfd);
 return 0;



2.
(a) Write the step by step procedure to configure a remote server and transfer a Directory to
Remote Server in Linux.
(10 marks)
Ans: 
A remote server is a server on another computer (remote host).
To configure access to the server in this set-up, you need to specify the following:
  • Connection settings: server host, port, and user credentials.
  • The server configuration root folder and the URL address to access it.
  • Correspondence between the project root folder, the folder on the server to copy the data from the project root folder to, and the URL address to access the copied data on the server. This correspondence is called mapping. 
Creating a Server Configuration: Specifying Its Name and Type
A. Open the Deployment dialog box. Do one of the following:
  • Open the Settings dialog box by choosing File | Settings or pressing Ctrl+Alt+S and click Deployment under Build, Execution, Deployment.
  • Choose Tools | Deployment | Configuration on the main menu.
B. In the left-hand pane, that shows a list of all the existing server configurations, click the Add
toolbar button . The Add Server dialog box opens.

C. Specify the server configuration name in the Name text box. From the Type drop-down list,
choose the server configuration type depending on the protocol you are going to use to
exchange the data with the server.
  • FTP: choose this option to have PhpStorm access the server via the FTP file transfer protocol.
  • SFTP: choose this option to have PhpStorm access the server via the SFTP file transfer protocol.
  • FTPS: choose this option to have PhpStorm access the server via the FTP file transfer protocol over SSL (the FTPS extension).
  • When editing the server configuration name in the Name text box, use the Up and Down keys on your keyboard to change the preselected server access to type in the Protocol drop-down list.
D. Click OK. The Add Server dialog box closes and you return to the Connection tab of the
Deployment dialog box.
  • Click the Use as Default toolbar button. 
Ftp server is used to transfer files between server and clients. All major operating system supports
ftp. ftp is the most used protocol over internet to transfer files. Like most Internet operations, FTP
works on a client/ server model. FTP client programs can enable users to transfer files to and from a
remote system running an FTP server program.
Configuring the ftp Server
The vsftpd RPM package is required to configure a Red Hat Enterprise Linux system as an ftp server.
If it is not already installed, install it with rpm commands as described in our pervious article. After it
is installed, start the service as root with the command service vsftpd start . The system is now an ftp
server and can accept connections. To configure the server to automatically start the service at boot
time, execute the command chkconfig vsftpd on as root. To stop the server, execute the command
service vsftpd stop. To verify that the server is running, use the command service vsftpd status. 



(b) Write a step by step procedure to create and configure samba Server in Linux. Also,
transfer files from client side.
Ans:
Installing Samba 
1. Use yum to install the Samba package:
  • yum -y install samba
Creating Samba Test Directory and Files
For this part of the procedure, you'll use the su - (switch user) command to work as root. Although it’s
not best practice to do this regularly, there are times where it's much more practical to work directly as
root instead of trying to use sudo to do everything. This is one of those times.
You're going to create a new directory containing three empty files which you'll share using Samba.

2. While logged on as root, create the new directory /smbdemo with the following command:
 mkdir /smbdemo

3. Change the permissions on the new directory to 770 with the following command: 
chmod 770 /smbdemo

4. Navigate to the new directory with the following command:
 cd /smbdemo

5. Add three empty files to the directory with the following command:
 touch file1 file2 file3

Adding the Samba User
You must add users to the Samba database in order for them to have access to their home directory
and other Samba shares.

6. Use the following command to add a new Samba user (the new Samba user must be an existing
Linux user or the command will fail):
 smbpasswd -a <username>
 For example, to add the user don, use the command smbpasswd -a don.

Creating the Samba Group

7. Perform the following steps to create a smbusers group, change ownership of the /smbdemo
directory, and add a user to the smbusers group:
 groupadd smbusers
 chown :smbusers /smbdemo
 usermod -G smbusers don

Configuring Samba
Samba configuration is done in the file /etc/samba/smb.conf. There are two parts to
/etc/samba/smb.conf: 
  • Global Settings: This is where you configure the server. You’ll find things like authentication method, listening ports, interfaces, workgroup names, server names, log file settings, and similar parameters.
  • Share Definitions: This is where you configure each of the shares for the users. By default, there’s a printer share already configured.
Configuring smb.conf

8. In the Global Settings section, at line 74, change the workgroup name to your workgroup name.
1. Create a website for a Bank having the following features (you must use CSS preferably
as a separate file):
Ans:
Html Files

Home.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css">
</head>
<body>
<table width="100%">
<tr>
<td colspan="2" class="top"><span><img src="image\logo1.png"><span> CUSTOMER PAID
BANK LTD.<span style="font-size:20px;padding:5px 45px">[Uttam Nagar]</span></td>
</tr>
<tr>
<td class="left">
<div id="nav">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="service.html">Bank Services</a></li>
<li><a href="branch.html">Bank Branches</a></li>
<li><a href="complain.html">Customer Complain</a></li>
<li><a href="feedback.html">Feedback</a></li>
</ul>
</div>
</td>
<td class="right">
<h1> About Our Bank</h1> <p>Customer Paid Bank(CPB) is a public sector banking company
headquartered in Mangalore, India. The bank has pan-India presence with 8,000 functional units
comprising 3200 branches, 3200+ ATMs and 4,000 branchless banking units as of 30 January
2015.</td>
</tr>

<tr>
<td class="bottom">Don't disclose your PIN/Password to any one. Bank is not responsible for
online transactions going wrong.PLEASE NOTE THAT OUR BANK NEVER ASKS FOR
SUCH DETAILS AT ANY TIME.BEWARE OF FAKE MOBILE CALLS FROM PERSONS
PRETENDING TO BE FROM OUR BANK
<br>[ Last Update on 29th Aug, 2015 ]</td>
</tr>
</table>
</body>

Service.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css">
</head>
<body>
<table width="100%">
<tr>
<td colspan="2" class="top"><span><img src="image\logo1.png"><span> CUSTOMER PAID
BANK LTD.<span style="font-size:20px;padding:5px 45px">[Uttam Nagar]</span></td>
</tr>
<tr>
<td class="left">
<div id="nav">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="service.html">Bank Services</a></li>
<li><a href="branch.html">Bank Branches</a></li>
<li><a href="complain.html">Customer Complain</a></li>
<li><a href="feedback.html">Feedback</a></li>
</ul>
</div>
</td>
<td class="right">
<h1> Our Services</h1> <p>
<ol>
<li>Beti Suraksha Yogna
<li>Fixed deposit
<li>Moneyflex Deposit
<li>Recurring Deposit
<li>Locker Facility
<li>Tax Payments
<li>E-payments
<li>Depositary Services
<li>Bills and Shopping
</td>
</tr>
<tr>
<td class="bottom">Don't disclose your PIN/Password to any one. Bank is not responsible for
online transactions going wrong.PLEASE NOTE THAT OUR BANK NEVER ASKS FOR
SUCH DETAILS AT ANY TIME.BEWARE OF FAKE MOBILE CALLS FROM PERSONS
PRETENDING TO BE FROM OUR BANK
<br>[ Last Update on 29th Aug, 2015 ]</td>
</tr>
</table>
</body>

Branch.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css">
</head>
<body>
<table width="100%">
<tr>
<td colspan="2" class="top"><span><img src="image\logo1.png"><span> CUSTOMER PAID
BANK LTD.<span style="font-size:20px;padding:5px 45px">[Uttam Nagar]</span></td>
</tr>
<tr>
<td class="left">
<div id="nav">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="service.html">Bank Services</a></li>
<li><a href="branch.html">Bank Branches</a></li>
<li><a href="complain.html">Customer Complain</a></li>
<li><a href="feedback.html">Feedback</a></li>
</ul>
</div>
</td>
<td class="right">
<h1> Locate Branch</h1>
<form action="search">
<p>Enter Branch Name:<input type="text" name="bname"/><br/>
<p><input type="submit" value="Search"/>
</form>
</td>
</tr>
<tr>
<td class="bottom">Don't disclose your PIN/Password to any one. Bank is not responsible for
online transactions going wrong.PLEASE NOTE THAT OUR BANK NEVER ASKS FOR
SUCH DETAILS AT ANY TIME.BEWARE OF FAKE MOBILE CALLS FROM PERSONS
PRETENDING TO BE FROM OUR BANK
<br>[ Last Update on 29th Aug, 2015 ]</td>
</tr>
</table>
</body>

Complain.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css">
</head>
<body>
<table width="100%">
<tr>
<td colspan="2" class="top"><span><img src="image\logo1.png"><span> CUSTOMER PAID
BANK LTD.<span style="font-size:20px;padding:5px 45px">[Uttam Nagar]</span></td>
</tr>
<tr>
<td class="left">
<div id="nav">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="service.html">Bank Services</a></li>
<li><a href="branch.html">Bank Branches</a></li>
<li><a href="complain.html">Customer Complain</a></li>
<li><a href="feedback.html">Feedback</a></li>
</ul>
</div>
</td>
<td class="right">
<h1> Register Your Complain</h1>
<form action="cregister" method="post">
<pre>
<p>Account NO : <input type="text" name="acno"/>
<p>Cust Name : <input type="text" name="cname"/>
<p>Branch Name : <input type="text" name="bname"/>
<p>Complain : <textarea name="complain" rows="5"></textarea>
<input type="submit" value="register"/>
</pre>
</td>
</tr>
<tr>
<td class="bottom">Don't disclose your PIN/Password to any one. Bank is not responsible for
online transactions going wrong.PLEASE NOTE THAT OUR BANK NEVER ASKS FOR
SUCH DETAILS AT ANY TIME.BEWARE OF FAKE MOBILE CALLS FROM PERSONS
PRETENDING TO BE FROM OUR BANK
<br>[ Last Update on 29th Aug, 2015 ]</td>
</tr>
</table>
</body>

Feedback.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css">
<script language="javascript">
function validate()
{
var i,y;
var x=f1.acno.value
for(i=0;i<x.length;i++)
{
if(x.charAt(i)>="0" && x.charAt(i)<="9")
y=0
else
y=1;
}
if(y==1)
{
alert("invalid Account");
f1.acno.value=""
f1.acno.focus();
}
}
</script>
</head>
<body>
<table width="100%">
<tr>
<td colspan="2" class="top"><span><img src="image\logo1.png"><span> CUSTOMER PAID
BANK LTD.<span style="font-size:20px;padding:5px 45px">[Uttam Nagar]</span></td>
</tr>
<tr>
<td class="left">
<div id="nav">
<ul>
<li><a href="home.html">Home</a></li>
<li><a href="service.html">Bank Services</a></li>
<li><a href="branch.html">Bank Branches</a></li>
<li><a href="complain.html">Customer Complain</a></li>
<li><a href="feedback.html">Feedback</a></li>
</ul>
</div>
</td>
<td class="right">
<h1> Register Your Complain</h1>
<form action="cregister" method="post" name="f1">
<pre>
<p>Account NO : <input type="text" name="acno"/ onblur="validate()">
<p>Cust Name : <input type="text" name="cname"/>
<p>Branch Name : <input type="text" name="bname"/>
<p>Message : <textarea name="complain" rows="5"></textarea>
<input type="submit" value="register"/>
</pre>
</td>
</tr>
<tr>
<td class="bottom">Don't disclose your PIN/Password to any one. Bank is not responsible for
online transactions going wrong.PLEASE NOTE THAT OUR BANK NEVER ASKS FOR
SUCH DETAILS AT ANY TIME.BEWARE OF FAKE MOBILE CALLS FROM PERSONS
PRETENDING TO BE FROM OUR BANK
<br>[ Last Update on 29th Aug, 2015 ]</td>
</tr>
</table>
</body>
<html>

Database Coding in Servlet
Search.java 
import java.io.*;
import java.sql.*;
import javax.servlet.ServletException;
import javax.servlet.http.*;
public class search extends HttpServlet {
public void doGet(HttpServletRequest request, HttpServletResponse response)
 throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();

String bname=request.getParameter("bname");

try{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection
con=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","yyyy");

PreparedStatement ps=con.prepareStatement("select * from branch where bcode=?");
ps.setString(1,bname);
out.print("<table width=50% border=1>");
ResultSet rs=ps.executeQuery();
while(rs.next())
{
out.print("<tr><td>"+rs.getStrig(1)+"</td><td>"+rs.getString(2)+"
</td><td>"+rs.getString(3)+"</td><td>"+rs.getString(4)+"</td></tr>");
}
out.print("</table>");
}catch (Exception e)
{
e.printStackTrace();
}
finally{out.close();}
}
}

Cregister.java
import java.io.*;
import java.sql.*;

import javax.servlet.ServletException;
import javax.servlet.http.*;
public class cregister extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)
 throws ServletException, IOException {
response.setContentType("text/html");
PrintWriter out = response.getWriter();

String x=request.getParameter("acno");
String y=request.getParameter("cname");
String z=request.getParameter("bname");
String p=request.getParameter("complain");

try
{
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con =
DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","yyyy");
//Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
//Connection con=DriverManager.getConnection("jdbc:odbc:pixdata");

PreparedStatement ps=con.prepareStatement("insert into c_register values(?,?,?,?)");
ps.setString(1,x);
ps.setString(2,y);
ps.setString(3,z);
ps.setString(4,p);
int i=ps.executeUpdate();
if(i>0)
out.print("You are successfully registered your complain...");
}
catch (Exception e2)
{
System.out.println(e2);
}
out.close();
}
}

Css file

Css1.css
.top{
 padding: 2% 200;
 background:top repeat-x #f0fF00;
 border-bottom: solid 1px #001C32;
 font-size:30pt;
 color:#FF0066;
 font-weight:bold;
}
h1 {
 color: maroon;
 margin-left: 40px;
}
ol li,p {
 color: black;
 margin-left: 60px;
 font-size:15pt;
}
.left
{
padding: 5 5 5 5;
width:200px;
position:relative;
left:3;
background-color:#220F21;
display: block;
float: left;
height:400px;
}
.right
{
padding: 5 5 5 5;
width:70%;
position:relative;
left:3pt;
background-color:#FFFFFF;
display: block;
float: left;
}
.bottom{
 padding: 1% 100;
 background:top repeat-x #f0fF00;
 border-bottom: solid 1px #001C32;
 font-size:15pt;
 color:#FF0066;
 font-weight:bold;
 text-align:center;
}
#nav {
 font-family: verdana;
 font-weight: bold;
 font-size: 12pt;
 text-align:center;
 position:relative;
 left:0px;

}
#myspan {
 font-family: verdana;
 font-weight: bold;
 font-size: 12pt;
 text-align:center;
 position:relative;
 left:0px;

}

#nav ul {
 margin: 0;
 padding: 0;
 list-style: none;
}

#nav a:link
 {
 color: #FFFFFF;
 text-decoration: none;
}
#nav a:activate
{
text-decoration: none;
background:yellow
}
#nav a:visited
 {
 color: #FFFFFF;
 text-decoration: none;
}
#nav a {
 display: block;
 padding: 6px 8px;
}

#nav li {
 float: down;
 background-color:#FF0066;
 margin-bottom:3px;
 position: relative;
 width: 200px;
}


#nav li:hover {
 background-color:#1e6468;
}
1.
(a) What is meant by the term Web Service? Explain with the help of an example. List
various protocols that are used for creating a web service. Also explain the process of
creating a web service. (6 Marks)
ANs:
Web services are a way to communicate between different computers over the World Wide
Web. You already know that the Remote Procedure Call (RPC) allow distributed component
to communicate. Two RPC technologies, Distributed Component Object Model (DCOM) and
Common Object Request Broker Architecture (CORBA) are widely used. But, both the
technologies are too complex to provide interoperability among the computers.
DCOM is supported by Microsoft and uses the Object Remote Procedure Call
(ORPC) to interface components whereas CORBA is designed to be cross-platform
and it requires manual intervention. So, both the technologies are not fulfilling the goal of

universal interoperability.
HTTP
Protocol stands for Hyper Text Transfer Protocol. It is the protocol used to convey
information of World Wide Web (WWW). HTTP protocol is a stateless and connectionless
protocol. HTTP is called as a stateless protocol because each command request is executed
independently and it does not remember anything about previous execution. It is based on a
request/request paradigm. In this protocol the communication generally takes place over a
TCP/IP protocol.

SOAP
SOAP is an XML-based protocol for exchanging information between computers.

  • SOAP is a communication protocol.
  • SOAP is for communication between applications.
  • SOAP is a format for sending messages.
  • SOAP is designed to communicate via Internet.
  • SOAP is platform independent. 
  • SOAP is language independent.
  • SOAP is simple and extensible.
  • SOAP allows you to get around firewalls.
  • SOAP will be developed as a W3C standard. 

WSDL
WSDL is an XML-based language for describing web services and how to access them.
  • WSDL stands for Web Services Description Language.
  • WSDL was developed jointly by Microsoft and IBM.
  • WSDL is an XML based protocol for information exchange in decentralized and distributed environments.
  • WSDL is the standard format for describing a web service.
  • WSDL definition describes how to access a web service and what operations it will perform.
  • WSDL is a language for describing how to interface with XML-based services.
  • WSDL is an integral part of UDDI, an XML-based worldwide business registry.
  • WSDL is the language that UDDI uses.
  • WSDL is pronounced as 'wiz-dull' and spelled out as 'W-S-D-L'. 
UDDI
  • UDDI is an XML-based standard for describing, publishing, and finding web services.
  • UDDI stands for Universal Description, Discovery, and Integration.
  • UDDI is a specification for a distributed registry of web services.
  • UDDI is platform independent, open framework.
  • UDDI can communicate via SOAP, CORBA, and Java RMI Protocol.
  • UDDI uses WSDL to describe interfaces to web services.
  • UDDI is seen with SOAP and WSDL as one of the three foundation standards of web services.
  • UDDI is an open industry initiative enabling businesses to discover each other and definev how they interact over the Internet. 
Steps to create our simple Web Service:
  • Create the Web Service business logic. First we need to write a Java class that implements the Web Service business logic. In this case, our business logic will be a simple Java class that simulates a stock quote service.
  • Deploy the Java class to the SOAP server. Next we need to turn the Java class into a Web Service. We'll show how to deploy the Java class to a SOAP server using the WASP deployment tool.
  • Generate client access classes. A client application uses a proxy object to access a Web Service. At request time, the proxy accepts a Java method call from the application and translates it into an XML message. At response time, the proxy receives the SOAP reply message, translates it into Java objects, and returns the results to the client application.
  • Client application development. The client application treats the proxy as a standard Java object that facilitates the communication with a Web Service. 


(b) Create a simple form that may be used for appearing in the entrance test of a
University. The form should include details like name, mother/father name,
qualifications with degree name, year of passing the degree, percentage,
University/Board name; address (permanent and postal both), contact phone, email
Id, the programme in which admission is desired and related information. The form
should have relevant drop down lists such as List of Universities or Boards, list of
programmes etc. You must use CSS. Explain the advantages of using CSS.
(6 Marks)
Ans: 
<html>
<head>
<title>Online Admission</title>
<link rel="stylesheet" type="text/css" href="css2.css">
</head>
<body>
<form name="f1">
<table>
<tr>
<td colspan="2"><h1><u>Admission of Entrance</u></h1></td>
</tr>
<tr>
<td>Name </td>
 <td><input type="text"></td>
</tr>
<tr>
<td>Father's Name </td>
 <td><input type="text"></td>
</tr>
<tr>
<td>Mother'S Name </td>
 <td><input type="text"></td>
</tr> 
<tr>
<td>Qualification</td>
<td><input type="text" name="Min. Qualification" value=""></td>
</tr>
<tr>
<td>Pass out year </td>
<td> <input type="text"></td>
</tr>
<tr>
<td>Marks(%)</td>
<td><input type="text"></td>
</tr>
<tr>
<td>Programme</td>
<td>
<select name="tt">
<option>BCA</option>
<option>MCA</option>
<option>B.Tech</option>
<option>BSc</option>
</td>
</tr>
<tr>
<td>University/Board</td>
<td>
<select name="t">
<option>IGNOU</option>
<option>Jamia</option>
<option>JNU</option>
<option>DU</option>
</td>
</tr>
<tr>
<td>Address </td>
<td> <input type="text"></td>
</tr>
<tr>
<td>Contact No. </td>
<td> <input type="text"></td>
</tr>
<tr>
<td>Email Id</td>
<td> <input type="text"></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Submit"></td>
</tr>
</table>
</body>
</form>
</html>

CSS:-
table{
 padding: 1% 200;
 background:top repeat-x #FAFAFF ;
 font-size:25pt;
 color:#FF0066;
 font-weight:bold;
 font-align:left;
}
input[type="text"], input[type="email"], textarea, select,button[type="submit"] { 
color: #555;
 height: 30px;
 line-height:15px;
 width: 100%;
 padding: 0px 0px 0px 10px;
 margin-top: 2px;
 border: 1px solid #E5E5E5;
 background: #FBFBFB;
 outline: 0;
 } 

(c) Create a simple HTML based web page showing services offered in a Bank. The web page
should consist of three sections. All these three sections should be in separate divisions (using
<div> tags). The first section should show list of services offered by Bank, second section should
show the site plan and the third section should be a login area for the customers. Also create two
CSS files for this page that demonstrates how CSS can change the display format without affecting
the content. (6 Marks)
Ans:
Css1.css
.header{
 padding: 2% 200;
 background:top repeat-x #006F00;
 border-bottom: solid 1px #001C32;
 font-size:30pt;
 color:#FF0066;
 font-weight:bold;
}
.banner{
 position:relative;
 left:250px;
 font-size:20pt;
 color:#00FF66;
}
h1 {
 color: maroon;
 margin-left: 40px;
}
.div1
{
padding: 5 5 5 5;
width:30%;
position:relative;
left:0; 
background-color:#FF7791;
display: block;
float: left;
}
.div2
{
padding: 5 5 5 5;
width:30%;
position:relative;
left:3pt;
background-color:#11FF91;
display: block;
float: left;
}
.div3
{
padding: 5 5 5 5;
width:37.5%;
position:relative;
left:3pt;
background-color:#FF3391;
display: block;
float: right;

CSS2.css:-
.header{
 padding: 1% 200;
 background:top repeat-x #FF0066;
 border-bottom: solid 1px #001C32;
 font-size:25pt;
 color:#FFFFFF;
 font-weight:bold;
}
.banner{
 position:relative;
 left:250px;
 font-size:18pt;
 color:#00FFFF;
}
.div1
{
padding: 5 5 5 5;
width:30%;
position:relative;
left:0;
background-color:#FFFF91;
display: block; 
float: left;
}
.div2
{
padding: 5 5 5 5;
width:30%;
position:relative;
left:3pt;
background-color:#FFFF91;
display: block;
float: left;
}
.div3
{
padding: 5 5 5 5;
width:37.5%;
position:relative;
left:3pt;
background-color:#FFFF91;
display: block;
float: right;
}

INDEX.html
<html>
<head>
<link rel="stylesheet" type="text/css" href="css1.css">
</head>
<body>
<div class="header">ABC BANK<span class="banner"> A Bank for All..............</span></div>
<br>
<div class="div1"><h1>Put here services offered by Bank<br>...............<br>...............<br></div>
<div class="div2">show the site plan.............. </div>
<div class="div3">
<form name="f1">
User ID :<input type="text"><br><br>
Password :<input type="text"><br>
<input type="submit" value="Login">
<input type="submit" value="Cancel">
</form>
</div>
</body>
</html>



(d) Explain the document structure of an XML document. A University programme contains
information like programme code, programme name, duration, credits etc. A programme consists
of a number of semesters. Every semester a number of courses are offered. Some of these courses
are compulsory and some optional. Create an XML documents containing information of five such
programmes. Also create the DTD for the XML document you have created.(8 Marks)
Ans: 
An XML document has three parts:
A. The XML processing Instruction(s), also called the XML declaration;
B. The Document Type Declaration;
C. The document instance.

A. XML Declaration The XML processing instruction declares the document to be an
XML document for an application or parser this declaration is important. It may also
include: the version of XML, encoding type; whether the document is stand-alone;
The encoding attribute is used to inform the XML processor of the type of character
encoding in the document. For example: - UTF-8 and UTF-16 and ISO-10646-UCS-
2 are common encoding type.
<?xml version = “1.0” encoding = “UTF-8” ?> 

B. Document Type Declaration (DTD)
A DTD is used to define the syntax and grammar of a document, that is, it defines the
meaning of the document elements. A Document Type Definition (DTD) sets all the
rules for the document regarding elements, attributes, and other components. This
DTD may be either an external DTD or Internal DTD.
  • Internal DTD - An internal DTD document is contained completely within the XML document.
  • External DTD - An external DTD document is a seperate document, referenced from within the XML document 
C. Document Instance:-The instance contains the remaining parts of the XML
document, including the actual contents of the document, such as characters,
paragraphs, pages and graphics.
Elements are the most important part of an XML document. An element consists of
content enclosed in an opening tag and a closing tag. An element can contain
several different types of content: root element, child element and attributes. 

DTD
<!DOCTYPE university [
<!ELEMENT university ( (pcode | pname | duration | credit)+)>
<!ELEMENT pname(semester, courses)>
<!ELEMENT pcode( #PCDATA )>
<!ELEMENT semester( #PCDATA )>
<!ELEMENT course( #PCDATA )>
<!ELEMENT duration ( #PCDATA )>
<!ELEMENT credit ( #PCDATA )>
<!ELEMENT salary( #PCDATA )>
]>
Documents
<university> 
<pcode>C001</pcode>
<pname>BCA<pname>
 <semester>2</semester>
 <course>c-language,CO,math</course>
</pname>
<duration>3 years</duration>
<credit>45</credit>
</university>
[Note: input four record similarly.] 



(e) List at least 5 commands of JavaScript and explain them. Write a program using JavaScript that
changes the text colour and background colour of a division after every 5 seconds. (8 Marks)
Ans: 
5 Commands in JavaScript
  • break Terminates a switch or a loop
  • continue Jumps out of a loop and starts at the top
  • if ... else Marks a block of statements to be executed, depending on a condition
  • switch Marks a block of statements to be executed, depending on different cases
  • var Declares a variable
<!DOCTYPE html>
<html>
<head>
<style>
#mydiv1 {
 width: 200px;
 height: 300px;
 background-color:cyan;
 color: #000000;
 text-align:center;
}
</style>
</head>
<body onload="mypix()">
<script>
var col =new Array("red","green","blue");
var a=0
function mypix()
{
 document.getElementById("mydiv1").style.backgroundColor =col[a];
a=a+1;
if(a>=3)
a=0;
setTimeout("mypix()", 5000);
mypix()
</script>
<div id="mydiv1">
 <h1>Classes for BCA</h1>
</div>
</body>
</html>



 (f) Explain the input options used in WML with the help of an example each. Create a simple
WML program that should display an image and a table.(6 Marks)
Ans:
Input example:-
<p>PIXELES Classes<br/>
“tudeŶt’s Naŵe: <iŶput Ŷaŵe="Ŷaŵe" size="ϮϬ"/>
 Enrol : <input name="enrol" size="20" />
 Course: <input name="cc" size="20"/>
</p>
</card>
</wml> 
Example Image and table 
<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.2//EN"
"http://www.wapforum.org/DTD/wml12.dtd">
<wml>
 <card id="page1" title="Table and image in WML">
 <p>
 <table columns="3">
 <tr>
 <td>Cell A</td>
 <td>Cell B</td>
 <td>Cell C</td>
 </tr>
 <tr>
 <td><img src="path" alt="myImage"/></td>
 <td><img src="path" alt="myImage"/></td>>
 <td><img src="path" alt="myImage"/></td>
 </tr>
 </table>
 </p>
 </card>
</wml>


2. 
(a) Explain the MVC Architecture with the help of a diagram. Also explain HTTP methods and their
use. (10 Marks)
Ans: 
This architecture is known as Model-View-Controller (MVC). This architecture can also be used for
the development of a web application.
Model: In the context of MVC a Model defines the data model and its access controls. The main role
of this component is to represent data and perform updates on it as per the defined rules. The main
responsibility of this component is to accept user requests and the data entered by the user and
perform the necessary data related function.
View: The function of the view will be to accept the data from the Model and convert it to form that
can be seen be a user in a user friendly way. Thus, view is responsible for displaying web pages for
the user.
Controller: A user may be allowed to interact with the web pages created by the Viewer component.
This interaction may be in the form of selection of options of Menu, pull down lists, check boxes etc., 

HTTP METHODS
  • GET Method: The Get method is used to getting the data from the server.
  • POST Method: The post method is used for sending data to the server.
  • HEAD Method: When a user wants to know about the headers, like MIME types, charset, Content- Length then we use Head method.
  • TRACE Method: Trace the request message that is being received on the other side.
  • DELETE Method: It is used for delete the resources, files at the requested URL
  • OPTIONS Method: It lists the Http methods to which the thing at the requested URL can respond.
  • PUT Method: It put the enclosed information at the requested URL.
  • CONNECT Method: It connects for the purpose of tunnelling. 



(b) Explain the uses of JSP elements with the help of examples. Also explain any five JSP implicit
objects.
(10 Marks)
ANs:
Elements of JSP:-
Directives 
Directives are used as guiding the JSP container for translating and compilation of JSP page. It
appears at the top of the page.
Directives have the following syntax: 
<%@ directive attribute="value"%>
You can write XML equivalent of the above syntax as follows:
<jsp:directive. directivename attribute="value" />

page Directive
The page Directive is used to specify the attributes of JSP page such as declaration of other resources
i.e. classes and packages,
<%@ page attribute = "value͟" %>
 <%@ page import=͟"java.io.*, java.util.Date" buffer="16k" autoFlush="false" % >
include Directive
Include directive is an important JSP directive. This is used to insert text and code in the form of file
such as html, JSP into a current JSP document at the translation time.

<%@ include file = "relative URL͟" %>
JSP Implicit Object
JSP supports implicit objects which are listed below:-
Request Object
The request object is an instance of HttpServletRequest interface. This object is used to retrieves the
values that the client browser passed to the server during HTTP request such as cookies, headers or
parameters associated with the request.
For example: 
<html><body><h2>Example of request Object</h2>
<% // Get the Programme Name from the request Query
 String name=request.getQueryString();
 out.println("Hello: "+name); %>
</body></html> 

response Object
As you know, response is a process to responding against it request. Using response object, reply is
sent back to the client browser.
<% response.sendRedirect("http://www.ignou.org");%>

session Object
The session object is represented by the javax.servlet.http.HttpSession interface. This object is
behaves in same way as under the java servlet. For each user, servlet can create an HttpSession
object that is associated with a particular single user.
application Object
The application object is an instance of javax.servlet.ServletContext. This object has application
scope which means that it is available to all JSP pages until the JSP engine shut down. The
ServletContext is the environment where the servlet run.
page Object
It represents the javax.servlet.jsp.HttpJspPage interface. This object is reference to the current
instance of the JSP page. The page object is a synonym for this object and is not useful for
programming language.

(c) Differentiate between cookies and sessions with the help of an example. Create a simple HTML
login page and write suitable JSP program that checks the user ID and password entered by the
user in the HTML page, with a defined value (you need not use database for this problem). If the
username and ID is incorrect user is returned to HTML login page, else u is shown a message
"Welcome to JSP world". 
Ans
Cookies – Cookies are small piece of information that is sent by web server in response header and
gets stored in the browser cookies. When client make further request, it adds the cookie to the
request header and we can utilize it to keep track of the session. We can maintain a session with
cookies but if the client disables the cookies,then it won't work.
Session is a conversional state between client and server and it can consists of multiple request
and response between client and server. Since HTTP and Web Server both are stateless, the only
way to maintain a session is when some unique information about the session (session id) is passed
between server and client in every request and response.

Login.html
< html> <head>
<title>JSP Page</title>
 </head>
<body>
<h1>Login Page</h1>
<center> <h2>Signup Details</h2>
<form action="LoginCheck.jsp" method="post"> <br/>
Username:<input type="text" name="username"> <br/>
Password:<input type="password" name="password"> <br/>
<input type="submit" value="Submit">
</form>
 </center>
</body>
< /html>

Logincheck.jsp 
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<% String username=request.getParameter("username");
String password=request.getParameter("password");
 if((username.equals("anurag") && password.equals("jain")))
{
session.setAttribute("username",username);
 response.sendRedirect("Home.jsp"); }
else
response.sendRedirect("Error.jsp");
%>
 </body>

< /html>

home.html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
 <title>JSP Page</title>
</head>
 <body>
<br/><br/><br/><br/><br/> <center> <h2>
<%
String a=session.getAttribute("username").toString();
 out.println("Welcome to JSP World"+a);
%>
</center> </body>< /html>



(d) Explain different types of JDBC drivers. Create a database of username and passwords. Use the
same HTML login form as you created for part (c) above, but check the values from the database
using JSP. Explain all the steps that you have performed. Make suitable assumptions, if any.
Ans:
Type 1 JDBC Driver 
A type 1 JDBC driver consists of a Java part that translates the JDBC interface calls to
ODBC calls. An ODBC bridge then calls the ODBC driver of the given database. Type 1
drivers are (were) mostly intended to be used in the beginning, when there were no type 4

drivers (all Java drivers).

Type 2 JDBC Driver
A type 2 JDBC driver is like a type 1 driver, except the ODBC part is replaced with a native
code part instead. The native code part is targeted at a specific database product. Here is an
illustration of a type 2 JDBC driver:

Type 3 JDBC Driver
A type 3 JDBC driver is an all Java driver that sends the JDBC interface calls to an
intermediate server. The intermediate server then connects to the database on behalf of the
JDBC driver.

Type 4 JDBC Driver
A type 4 JDBC driver is an all Java driver which connects directly to the database. It is
implemented for a specific database product. Today, most JDBC drivers are type 4 drivers.

<%@page import ="java.io.*"%>
 <%@page import ="javax.servlet.*"%>
 <%@page import ="javax.servlet.http.*"%>
 <%@page import ="java.sql.*"%>
<%
String uid = request.getParameter("username");
String pass = request.getParameter("password");
try {
 // Step 1. Load the JDBC driver
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
 // Step 2. Create a Connection object
Connection con=DriverManager.getConnection("jdbc:odbc:pixdata");
System.out.println("got connection");
 // Step 3. Create a Statement object and call its executeUpdate
 // method to insert a record
 Statement s = con.createStatement();
"select * from Login where userID='"+loginid+"'";
 // Step 4. Use the same Statement object to obtain a ResultSet object
 sql = "SELECT userid, pass FROM Users where username=" ‘+uid+’;
 ResultSet rs = s.executeQuery(sql);
 while (rs.next())
{
u=rs.getString(1);
p= rs.getString(2);
 }
if(uid.equals(u) && pass .equals(p))
{
out.println("Login successful");
 }
else
{
out.println("incorrect username/password͟Í¿;
 rs.close();
 s.close();
 con.close();
}
catch (ClassNotFoundException e1)
 {
 // JDBC driver class not found, print error message to the console
 System.out.println(e1.toString());
}
%>
</body>
</html> 
1. (a) Why would an application use UDP instead of TCP? Discuss. (6 Marks) 
Ans: UDP provides an unreliable service and datagram may arrive out of order, appear duplicated, or go missing without notice. UDP assumes that error checking and correction is either not necessary or performed in the application, avoiding the overhead of such processing at the network interface level. Time-sensitive applications often use UDP because dropping packets is preferable to wait for delayed packets, which may not be an option in a real-time system. The User Datagram Protocol (UDP) is a transport layer protocol for use with the IP network layer protocol. It provides a best-effort datagram service to an end system (IP host). UDP provides no guarantee for delivery and no protection from duplication, but the simplicity of UDP reduces overhead from the protocol and can be adequate for some applications. A computer may send UDP packets without first establishing a connection to a recipient. The computer completes the appropriate fields in the UDP header (PCI) and forwards the data together with the header for transmission by the IP network layer. Typically, use UDP in applications where speed is more critical than reliability. For example, it may be better to use UDP in an application sending data from a fast acquisition where it is acceptable to lose some data points. You can also use UDP to broadcast to any machine(s) listening to the server.

(b) What is the purpose of VPNs and what are the main features they provide? (4 Marks)
Ans: 
Virtual private network is a network that is constructed by using public wires usually the Internet to connect to a private network, such as a company's internal network. There are a number of systems that enable you to create networks using the Internet as the medium for transporting data. These systems use encryption and other security mechanisms to ensure that only authorized users can access the network and that the data cannot be intercepted.
A key feature of a VPN is its ability to work over both private networks as well as public networks like the Internet. Using a method called tunneling, a VPN runs over the same hardware infrastructure as existing Internet or intranet links. VPN technologies include various security mechanisms to protect the virtual, private connections.

2. (a) Draw the IP datagram header format. ―IP datagram has a checksum field still and it’s called an unreliable protocol. Justify. (6 Marks)
Ans:- 

A checksum of the IP header (excluding data). The IP checksum is computed as follows: 1. Treat the data as a stream of 16-bit words (appending a 0 byte if needed). 2. Compute the 1's complement sum of the 16-bit words. 3. Take the 1's complement of the computed sum. The IP service is connectionless because each packet is treated independently from all others. The service is unreliable because delivery is not guaranteed, and packets may well be lost, duplicated, delayed, or delivered out of order. Finally, the service is best-effort delivery because the software makes an earnest attempt to deliver packets; unreliability arises only when the resources are exhausted or the underlying networks fail. The key idea in IP is to keep the network relatively simple and put any necessary intelligence in the end hosts. The IP layer resembles the postal system.

(b) What is a ―internetworking? State and compare internetworking devices used to connect different LAN segments. (4 Marks) 
Ans: 
Internetworking is the practice of connecting a computer network with other networks through the use of gateways that provide a common method of routing information packets between the networks. The resulting system of interconnected networks is called an internetwork.
Repeater:-

  • A repeater connects different segments of a LAN. 
  • A repeater forwards every frame it receives.
  • A repeater is a regenerator, not an amplifier.
  • It can be used to create a single extended LAN. 
Bridge:-
A bridge is a device that separates two or more network segments within one logical network. A bridge is used for linking two networks that work with the same protocol (similar type network). It can filter frames to transmit it to destination address corresponds to a machine located on the other side of the bridge. It connects two or more local area networks (LANs) together.
  • A bridge operates both in physical and data-link layer 
  • A bridge uses a table for filtering/routing 
  • A bridge does not change the physical (MAC) addresses in a frame.
3. (a) Describe the activities to be performed at every layer in the TCP model when information flows from layer to another layer.(6 Marks) 
Ans: 
Application Layer:
The application layer provides format and configuration for the user to access information on the network through an application. This layer is the main interface for users to interact with the application and therefore the network.
Services:
  • Resource sharing and device redirection
  • Remote file access
  • Remote printer access
  • Network management
  • Directory services
  • Electronic messaging (such as mail) etc 
Presentation Layer:
The presentation layer transforms data to provide a standard interface for the application layer. Encoding, data compression, data encryption and similar manipulation of the presentation is done at this layer to present the data as a service or protocol developer sees fit.
Services:
  • Data representation
  • Data security
  • Data compression
Session Layer:
The session layer controls the connections (sessions) between computers. It establishes, manages and terminates the connections between the local and remote application. 
Services:
  • Simplex
  • Half Duplex
  • Full Duplex 
Transport Layer
The transport layer provides transparent transfer of data between end users, thus relieving the upper layers from transfer concerns while providing reliable data transfer. The transport layer controls the reliability of a given link through flow control, segmentation/ desegmentation, and error control. 
Services:-
  • Resource Utilization (multiplexing):
  • Connection Management (establishing & terminating
  • Flow Control (Buffering / Windowing):
Network Layer
The network layer provides the means of transferring data sequences from a source to a destination by using one or more networks while maintaining the quality of service requested by the Transport layer. The Network layer performs network routing functions, and might also perform segmentation/de-segmentation, and report delivery errors. 
Services:-
  • Connection setup
  • Addressing
  • Routing
  • Security
  • Quality of Service
  • Fragmentation 
Data Link Layer
The data link layer provides the means to transfer data between network entities and to detect and possibly correct errors that may occur in the Physical layer. It arranges bits from the physical layer into logical chunks of data, known as frames. 
Services:- 
  • Frame Traffic Control:
  • Frame Sequencing:
  • Frame Acknowledgment:
  • Frame Delimiting:
  • Link Establishment and Termination:
  • Frame Error Checking:
  • Media access management: 
Physical Layer
The physical layer defines all the electrical and physical specifications for devices. This includes the Layout of pins, voltages, and cable specifications. 
Services:-
  • Data encoding:
  • Transmission technique:
  • Physical medium transmission:

(b) Classify the problems faced by network administrator. Make a chart to explain the available solutions for each problem.(4 Marks) 
Ans: 
Flexibility vs. Security
Network security has had to adapt increasingly quickly, in order to keep up with the new ways those users and back-end systems work. Mobility and variety are currently on the increase at both sides of the enterprise network. At the outer edge, users are operating a growing range of hand-held computing devices. 
Cost vs. Capability 
New applications drive requirements for new capabilities within the network infrastructure:
  • Multimedia applications require enhancements to network QoS, and the introduction of multicasting protocols.
  • High-performance applications, for example high-definition video, high-end CAD and graphics applications, require enhancements to network bandwidth.
  • Migration to IPv6 requires the introduction of new protocols into the network.
Reliability vs. Growth 
Networks are growing not just in complexity, but also in size. As more and more functions converge onto data networks, the number of devices attached to the network grows, and therefore the number of switching and routing nodes in the network must also grow. Organizations need to attach more and more of their operations onto the data network – remote locations need connections into central sites; even locations with no staff need network links for surveillance cameras and/or environmental monitoring, and/or control of automated devices.
Solution
  • Efficient configuration change management
  • Automated recovery of failed units
  • Automatic provisioning of new units
  • Automated software upgrade 

4. (a) Explain the connection oriented & connection less services using bind, connect, listen & accept system calls. (6 Marks) 
Ans: 
Connection oriented service is implemented by Transmission Control Protocol (TCP). There are various characteristics of this protocol.
  • It is a connection-oriented.
  • A client must connect a socket to a server.
  • TCP socket provides bidirectional channel between client and server.
  • Lost data is re-transmitted.
  • Data is delivered in-order.
  • Data is delivered as a stream of bytes.
  • TCP uses flow control.
Connection less communication is implemented by User Datagram Protocol (UDP). Characteristics of this protocol:-
  • It is a connectionless.
  • A single socket can send and receive packets from many different computers.
  • Best effort delivery.
  • Some packets may be lost some packets may arrive out of order.

(b) List and explain the features of any four popular enterprise security solutions.(4 Marks) 
Ans: 
Enterprises security solution and its features:-
End Point Data Protection Features
  • Minimize risk of losing sensitive data.
  • Improve incident response time.
  • Identify security threads quickly with comprehensive correlations.
  • Reduce security operations costs with standardized process.
  • Leverage security intelligence to improve security posture
  • Security log data and detailed reports support your IT policy and regulatory compliance requirements
Disaster Recovery Features
  • Simple and easy to deploy
  • Pay per use business model
  • Best in class TCO for DR solutions
  • Continuous Data Protection technology with multi-site replication
  • DR protection from multiple geographic Data centers, 100% scalable to meet your production workloads
  • 24 X 7 support
Enterprise Data Protection
  • Protect your data wherever it goes — on devices, external media and in public cloud storage.
  • Implement encryption options ranging from simplified to full disk encryption.
  • Help your organization meet regulatory requirements and avoid costly fines with onetouch preset compliance templates.
  • Easily implement encryption with optional and customized factory installation.
  • Remotely manage encryption and authentication policies with a single console designed to work seamlessly.
  • Enable end users to securely access and share data on any device and in the cloud with non-disruptive, data-centric encryption.
End Use security Solution
  • Reduce cost and complexity of risk management
  • ITighter control and visibility of regulatory compliance
  • Provision appropriate network access for non employee
  • Mitigate the risk of end point vulnerabilities 

5.
(a) What is a mail server? Briefly explain specifying the protocols involved how a
sender can send a mail to the server and the recipient retrieves it from the server? (6
Marks)
ANs: 
An e-mail server is a computer within your network that works as your virtual post office. A
mail server usually consists of a storage area where e-mail is stored for local users, a set of
user definable rules which determine how the mail server should react to the destination of a
specific message
Simple Mail Transfer Protocol (SMTP) is an Internet standard for electronic mail (e-mail)
transmission across Internet Protocol (IP) networks. SMTP is generally used to send
messages from a mail client to a mail server. This is why you need to specify both the POP
or IMAP server and the SMTP server when you configure your e-mail application.

  • After composing a message and hitting send, your email client - whether it's Outlook Express or Gmail - connects to your domain's SMTP server. This server can be named many things;
  • Your email client communicates with the SMTP server, giving it your email address, the recipient's email address, the message body and any attachments.
  • The SMTP server processes the recipient's email address - especially its domain. If the domain name is the same as the sender's, the message is routed directly over to the domain's POP3 or IMAP server - no routing between servers is needed. If the domain is different, though, the SMTP server will have to communicate with the other domain's server.
  • In order to find the recipient's server, the sender's SMTP server has to communicate with the DNS, or Domain Name Server. The DNS takes the recipient's email domain name and translates it into an IP address. The sender's SMTP server cannot route an email properly with a domain name alone; an IP address is a unique number that is assigned to every computer that is connected to the Internet. By knowing this information, an outgoing mail server can perform its work more efficiently.
  • Now that the SMTP server has the recipient's IP address, it can connect to its SMTP server. This isn't usually done directly, though; instead, the message is routed along a series of unrelated SMTP servers until it arrives at its destination.
  • The recipient's SMTP server scans the incoming message. If it recognizes the domain and the user name, it forwards the message along to the domain's POP3 or IMAP server. From there, it is placed in a send mail queue until the recipient's email client allows it to be downloaded. At that point, the message can be read by the recipient.

(b) Explain the importance of three-way handshake method for connection
establishment in TCP/IP with the help of suitable diagram.(4 Marks)
Ans: 
To establish a connection, TCP uses a three-way handshake. Before a client attempts to
connect with a server, the server must first bind to and listen at a port to open it up for
connections: this is called a passive open. Once the passive open is established, a client
may initiate an active open. To establish a connection, the three-way (or 3-step) handshake
occurs: 
1. SYN: A client sending a SYN to the server. The client sets the segment's sequence
number to a random value X.
2. SYN-ACK: In response, the server replies with a SYN-ACK. The acknowledgment
number is set to one more than the received sequence number (X + 1), and the
sequence number that the server chooses for the packet is another random number,Y.
3. ACK: Finally, the client sends an ACK back to the server. The sequence number is
set to the received acknowledgement value i.e. X + 1, and the acknowledgement
number is set to one more than the received sequence number i.e. Y + 1.

6.
(a) Draw the TCP header and list its components. Also, explain how can TCP handle urgent
data?
(6 Marks)
Ans: 
TCP provides a mechanism to handle urgent data
• Urgent data is received before octets already in the stream
• Sender:
– Sets urgent bit in segment header
– Puts urgent data at the beginning of the data field
– Sets urgent pointer to the end of the urgent data
• Receiver:
– Notified of the urgent data as soon as it arrives
– Enters “urgent mode” until all urgent data has been consumed
– Returns to “normal mode” 


(b) What do you understand by a domain name? How is a domain name translated to
an equivalent IP address?(4 Marks)
Ans: 
The Domain Name System (DNS) is a standard technology for managing the names of
Web sites and other Internet domains. DNS technology maps IP address with names like
“www.pixelesindia.com” and a computer automatically find that address on the Internet.
A DNS server is any computer registered to join the Domain Name System. A DNS
server runs special-purpose networking software, features a public IP address, and
contains a database of network names and addresses for other Internet hosts. There are
two types of DNS servers:-primary (master) and secondary DNS server.

  • It can supply the IP address because it knows it from its zone file.
  • It can contact another DNS server and try to locate the IP address for the name requested. Every DNS server has an entry called alternate DNS server, which is the DNS server it should get in touch with for unresolved domains. If this server is in authority, it responds, otherwise sends the query to another server. When the query is finally resolved, it travels back until it finally reaches the resolver. 

7.
(a) List the protocols presently supported by Intranet and explain the use of each
protocol in Intranet administration. (6 Marks)
Ans: 
HTTPd
It stands for HTTP daemon. A daemon is a UNIX background process that implements the
server side of a protocol. For example, FTPd is the File Transfer Protocol daemon. HTTP
daemon, a software program that runs in the background of a Web server and waits for
incoming server requests. The daemon answers the requests automatically and serves the
hypertext and multimedia documents over the Internet using HTTP. HTTPd is the program you would run on a UNIX platform to establish a web server. Daemons are unique to UNIX
on other platforms, such as Microsoft Windows NT, the web server is a background process
implemented as a system service.
SOCKS
SOCKS is an Intranet protocol that facilitates the routing of network packets between client–
server applications via a proxy server. SOCKS perform at Layer 5 of the OSI model—the
Session Layer Port 1080 is the well-known port designated for the SOCKS server.
The SOCKS5 protocol was originally a security protocol that made firewalls and other
security products easier to administer. It was approved by the IETF in 1996. The protocol
was developed in collaboration with Aventail Corporation, which markets the technology
outside of Asia. 
#ARP / RARP (Address resolution protocol & Reverse Address resolution
Protocol):- 
 It is a basic communication protocol that is used to identify IP address if physical
address is known. It is used by networking equipment.
It obtains the MAC address for requesting device. It is also used to translate MAC address to
IP address & vice-versa.
The Address Resolution Protocol uses a simple message format that contains one
address resolution request or response. The size of the ARP message depends on the
upper layer and lower layer address sizes, which are given by the type of networking
protocol (usually IPv4) in use and the type of hardware or virtual link layer that the upper
layer protocol is running on. The message header specifies these types, as well as the size
of addresses of each. The message header is completed with the operation code for request
(1) and reply (2). The payload of the packet consists of four addresses, the hardware and
protocol address of the sender and receiver hosts. 
#SSL Secure Socket Layer (SSL)
SSL are cryptographic protocols that provide security for
communications over networks such as the Internet. TLS and SSL encrypt the segments of
network connections at the Transport Layer end-to-end.
Several versions of the protocols are in widespread use in applications like web browsing,
electronic mail, Internet faxing, instant messaging and voice-over-IP (VoIP). 
# SSH
Secure Shell or SSH is a network protocol that allows data to be exchanged using
a secure channel between two networked devices. Used primarily on GNU/Linux and Unix
based systems to access shell accounts, SSH was designed as a replacement for Telnet
and other insecure remote shells, which send information, notably passwords, in plaintext,
rendering them susceptible to packet analysis. The encryption used by SSH provides
confidentiality and integrity of data over an insecure network, such as the Internet.
#RSH
The remote shell (rsh) is a command line computer program that can execute shell
commands as another user, and on another computer across a computer network.
The remote system to which rsh connects runs the rshd daemon. The rshd daemon typically
uses the well-known Transmission Control Protocol (TCP) port number 514.


(b) How many networks can each IP address class (A, B and C) can have? Calculate and
justify your answer using a suitable example for each. (4 Marks)
Ans: 



8.
(a) What is the purpose of DNS? What is the function of a secondary or tertiary DNS
server? In which case will the lookups be transferred to additional DNS servers?(6
Marks)
ANs: 
A DNS server is any computer registered to join the Domain Name System. A DNS
server runs special-purpose networking software, features a public IP address, and
contains a database of network names and addresses for other Internet hosts. There are
two types of DNS servers:-primary (master) and secondary DNS server. 
  • Primary server: - it is responsible creating, maintaining and updating zone file and it is stored in its local disk.
  • Secondary server: - Secondary server stores the latest zone file from the primary server only.
  • A primary DNS server holds the "master copy" of the data for a zone, and secondary servers have copies of this data which they synchronize with the primary through zone transfers at intervals or when prompted by the primary.
  • Only one DNS server should be configured as primary for a zone, but you can have any number of secondary servers for redundancy.
  • Both primary and secondary servers for a zone serve exactly the same data to clients.
  • Once a zone is configured on both primary and secondary servers, zone transfers should automatically occur when needed. 


(b) What are the NTFS, FAT, HPFS file systems?
Ans: 
NT File System, one of the file systems for the Windows NT operating system (Windows NT
also supports the FAT file system). NTFS has features to improve reliability, such as
transaction logs to help recover from disk failures. To control access to files, you can set
permissions for directories and/or individual files. NTFS files are not accessible from other
operating systems such as DOS. For large applications, NTFS supports spanning volumes,
which means files and directories can be spread out across several physical disks. 
The HPFS file system was first introduced with OS/2 1.2 to allow for greater access to the
larger hard drives that were then appearing on the market. Additionally, it was necessary for
a new file system to extend the naming system, organization, and security for the growing
demands of the network server market. HPFS maintains the directory organization of FAT,
but adds automatic sorting of the directory based on filenames. Filenames are extended to
up to 254 double byte characters. HPFS also allows a file to be composed of "data" and
special attributes to allow for increased flexibility in terms of supporting other naming
conventions and security. In addition, the unit of allocation is changed from clusters to
physical sectors (512 bytes), which reduces lost disk space.