Solutions

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

1.

Expand the following


WWW- World Wide Web
NAT- Network Address Translation
NIS- Network Information System
POP- Point Of Presence
SNMP- Simple Network Management Protocol
TCP- Transmission Control Protocol
IP- Internet Protocol
CGI- Common Gateway Interface
UPS- Uninterruptible Power Supply
HTML- HyperText Markup language
HTTP- HyperText Transmission Protocol
XML- Extensible markup language
SQL- Structured Query language
SSL- Secure Sockets Layer
TLS- Transport Layer Security
RAM- Random Access Memory
ROM- Read Only Memory
CD- Compact Disk
FTP- File Transfer Protocol
GNU- GNU’s not Unix
LAN- Local Area Network
WAN- Wide Area Network
MAN- Metropolitian Area Network
ASCII- American Standard Code for Information Interchange
DVD- Digital Versatile Disk
DOS- Disk Operating System
RDBMS- Relational DataBase Management System
DHCP- Dynamic Host Configuration Protocol
DNS- Domain Name System
SCSI- Small Computer System interface
RAID- Redundant Array of Independent Disks
RPM- RPM Package Manager
JPEG- Joint PhotoGraphic Experts Group
GIF- Graphical Interchange Format
BMP- BitMap Image File
MMU- Memory Management Unit
DTD- Document Type Definition
WYSIWYG- What You See Is What You Get
SGML- Standard Generalized Markup Language
VPN- Virtual private Network
USB- Universal Serial Bus
UNIX- UNIplexed Information Computing System
CPU- Central Processing Unit
SMS- Short Message service
GML- Generalized Markup Language
VRML- Virtual Reality Modeling Language
POP3- Post Office Protocol 3

2. Explain the following:


a. E-mail: Electronic mail (e-mail) is a computer-based application for the exchange of
messages between users. A worldwide e-mail network allows people to exchange e-mail
messages very quickly. E-mail is the electronic equivalent of a letter, but with advantages in
timeliness and flexibility.
b. E-commerce: E-commerce is the buying and selling of goods or services via the internet,
and the transfer of money and data to complete the sales. It’s also known as electronic
commerce or internet commerce.
c. E-cash: It refers to the currency electronically stored on electronic systems and digital
databases as opposed to physical paper and coin money, and is used to make it easier for
users to transact electronically.
d. E-banking: electronic banking, Use of computers and telecommunications to enable
banking transactions to be done by telephone or computer rather than through human
interaction. Its features include electronic funds transfer for retail purchases, automatic teller
machines (ATMs), and automatic payroll deposits and bill payments.
e. E-police: Internet police is a generic term for police and government agencies,
departments and other organizations in charge of policing Internet in a number of countries
f. Mobile Computing: Mobile Computing is a technical field that covers the design,
development and evaluation of mobile applications using appropriate solutions that meet
user requirements. This includes learning the technology that is used to perform a wide
variety of tasks on devices that are portable
g. WAP: Wireless Application Protocol (WAP) is a specification for a set of
communication protocols to standardize the way wireless devices, such as mobile
phones and radio transceivers, can be used for internet access, including email, the
web, newsgroups and instant messaging.
h. Short message Service: Short Message Service (SMS) is the most basic
communications technology for mobile data transfer and is characterized by the
exchange of short alphanumeric text messages between digital line and mobile
devices.
i. IP Services: IP Services means communications services using internet protocol
(IP) in their delivery, including session initiation protocol (SIP), voice over internet
protocol (VoIP), hosted IP voice or similar IP-based technologies or applications.
j. VoIP: Voice over Internet Protocol (VoIP), is a technology that allows you to make
voice calls using a broadband Internet connection instead of a regular (or analog)
phone line.
k. Cookies: A cookie is a piece of data from a website that is stored within a web
browser that the website can retrieve at a later time. Cookies are used to tell the
server that users have returned to a particular website.

3. Write a note on Cyber Law.


Cyber Law also called IT Law is the law regarding Information-technology including
computers and the internet. It is related to legal informatics and supervises the digital
circulation of information, software, information security, and e-commerce.
Importance of cyber law:
It covers all transactions over the internet.
It keeps eye on all activities over the internet.
It touches every action and every reaction in cyberspace.
4. Design your personal HTML Web page.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>

<h1>This is a Heading</h1>
<p>This is a paragraph.</p>

</body>
</html>

5. Design a HTML Page for Your Department.


6. Design a HTML form to reserve a Railway ticket.
<html>

<body>

<form>

<h1>RESERVATION FORM</h1>

<p>NAME<input type="TEXT" size="20" maxlength="99" /></p>

<p>AGE<input type="TEXT" size="12" maxlength="99" /></p>

<p>ADDRESS<input type="TEXT" size="42" maxlength="99" /></p>

<p>EMAIL<input type="TEXT" size="30" maxlength="99" /></p>

<p>TELEPHONE<input type="TEXT" size="10" maxlength="99" /></p>

<p>SELECT YOUR BERTH </p>

<select name="CHOICES" size="3">

<option>TATKAL</option>

<option>LADIES</option>

<option>GENRAL</option>

</select>

<p>CITY</p> <select name="CITY">

<option selected="selected">DELHI</option>

<option>MUMBAI</option>
<option>KOLKATA</option>

<option>CHENNAI</option> <br /><br />

<input type="submit" value="click here to submit" />

<input type="reset" value="clear this form" />

</form>

</body>

7. What is CGI and why is it important to the World Wide Web?


The Common Gateway Interface (CGI) provides the middleware between WWW servers and
external databases and information sources. The World Wide Web Consortium (W3C)
defined the Common Gateway Interface (CGI) and also defined how a program interacts
with a Hyper Text Transfer Protocol (HTTP) server. The Web server typically passes the form
information to a small application program that processes the data and may send back a
confirmation message. This process or convention for passing data back and forth between
the server and the application is called the common gateway interface (CGI).

Features of CGI:
● It is a very well defined and supported standard.
● CGI scripts are generally written in either Perl, C, or maybe just a simple shell script.
● CGI is a technology that interfaces with HTML.
● CGI is the best method to create a counter because it is currently the quickest
● CGI standard is generally the most compatible with today’s browsers
Advantages of CGI:
● The advanced tasks are currently a lot easier to perform in CGI than in Java.
● It is always easier to use the code already written than to write your own.
● CGI specifies that the programs can be written in any language, and on any platform,
as long as they conform to the specification.
● CGI-based counters and CGI code to perform simple tasks are available in plenty.
Disadvantages of CGI:
There are some disadvantages of CGI which are given below:
● In Common Gateway Interface each page load incurs overhead by having to load the
programs into memory.
● Generally, data cannot be easily cached in memory between page loads.
● There is a huge existing code base, much of it in Perl.
● CGI uses up a lot of processing time.

8. What are the important uses of Cookies? Give five examples.
A cookie is a piece of data from a website that is stored within a web browser that
the website can retrieve at a later time. Cookies are used to tell the server that users
have returned to a particular website.
cookie are intended to be used:
1. Session management. For example, cookies let websites recognize users
and recall their individual login information and preferences, such as sports
news versus politics.
2. Personalization. Customized advertising is the main way cookies are used to
personalize your sessions. You may view certain items or parts of a site, and
cookies use this data to help build targeted ads that you might enjoy.
3. Tracking. Shopping sites use cookies to track items users previously viewed,
allowing the sites to suggest other goods they might like and keep items in
shopping carts while they continue shopping.

Types of cookies
● Session cookies.
● Permanent cookies. ...
● First-party cookies. ...
● Third-party cookies. ...
● Flash cookies. ...
● Zombie cookies.

9. List the steps needed for processing the form using CGI.

This section expands on that to show how scripts are used to process web forms.

Seeing All the CGI Data

When the web server runs your CGI script, it passes information to the script within a
standard CGI environment. By providing the -c (or --CGI) option to REBOL, you are asking
REBOL to get the CGI environment information.

Showing CGI Form Results

The CGI object contains a lot of information. Some of this may be useful to your script, but
what you want most is to get the results that were submitted in the web form (as shown
earlier).

Decoding Web Form Data

When you see the results of the script above, you will notice that the web form data is
specially encoded to allow it to be passed back to the CGI script.

REBOL provides the DECODE-CGI function to make it easy to decode CGI form data.

10. What are the variables that an HTTP request provides to the server of a web page?

HTTP_USER_AGENT An identification string sent by the client


making the request.
REMOTE_ADDR The IP address of the client making the
request.

DOCUMENT_ROOT The server’s document root directory

REQUEST_METHOD The method used to make the URL


request. For example

GET, POST or PUT.

QUERY_STRING The list of variable-value pairs that follow the


“?” in the requested URL.

11. Write a JavaScript program that finds the greatest common divisor of two
numbers.
function gcd_two_numbers(x, y)
{
if ((typeof x !== 'number') || (typeof y !== 'number'))
return false;
x = Math.abs(x);
y = Math.abs(y);
while(y)
{
var t = y;
y = x % y;
x = t;
}
return x;
}

console.log(gcd_two_numbers(12, 13));
console.log(gcd_two_numbers(9, 3));

12. Write a JavaScript function that finds the maximum of three given numbers.
function max_of_three(x, y, z)
{
max_val = 0;
if (x > y) max_val = x;
else max_val = y;
if (z > max_val) max_val = z;
return max_val;
}

console.log(max_of_three(1,0,1));
console.log(max_of_three(0,-10,-20));

13. In the form to reserve the railway ticket add the following data validations using
JavaScript:
a. From City and To City are two different cities
b. Age of passenger should not be greater than 100
c. Name of the Passenger should be string (no numeric digits) of maximum length 20.
<body>
<h1 style="text-align: center;">REGISTRATION FORM</h1>
<form name="RegForm" onsubmit="return GEEKFORGEEKS()" method="post">

<p>Name: <input type="text"


size="65" name="Name" /></p>

<br />

<p>Address: <input type="text"


size="65" name="Address" />
</p>

<br />

<p>E-mail Address: <input type="text"


size="65" name="EMail" /></p>

<br />

<p>Password: <input type="text"


size="65" name="Password" /></p>

<br />

<p>Telephone: <input type="text"


size="65" name="Telephone" /></p>
<br />

<p>
SELECT YOUR COURSE
<select type="text" value="" name="Subject">
<option>BTECH</option>
<option>BBA</option>
<option>BCA</option>
<option>B.COM</option>
<option>GEEKFORGEEKS</option>
</select>
</p>

<br />
<br />

<p>Comments: <textarea cols="55"


name="Comment"> </textarea></p>

<p>
<input type="submit"
value="send" name="Submit" />
<input type="reset"
value="Reset" name="Reset" />
</p>

</form>
</body>

<script>
function GEEKFORGEEKS() {
var name =
document.forms.RegForm.Name.value;
var email =
document.forms.RegForm.EMail.value;
var phone =
document.forms.RegForm.Telephone.value;
var what =
document.forms.RegForm.Subject.value;
var password =
document.forms.RegForm.Password.value;
var address =
document.forms.RegForm.Address.value;
var regEmail=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/g; //Javascript reGex for Email
Validation.
var regPhone=/^\d{10}$/; // Javascript reGex for Phone Number validation.
var regName = /\d+$/g; // Javascript reGex for Name validation

if (name == "" || regName.test(name)) {


window.alert("Please enter your name properly.");
name.focus();
return false;
}
if (address == "") {
window.alert("Please enter your address.");
address.focus();
return false;
}

if (email == "" || !regEmail.test(email)) {


window.alert("Please enter a valid e-mail address.");
email.focus();
return false;
}

if (password == "") {
alert("Please enter your password");
password.focus();
return false;
}

if(password.length <6){
alert("Password should be atleast 6 character long");
password.focus();
return false;

}
if (phone == "" || !regPhone.test(phone)) {
alert("Please enter valid phone number.");
phone.focus();
return false;
}

if (what.selectedIndex == -1) {
alert("Please enter your course.");
what.focus();
return false;
}

return true;
}
</script>

14. Write a HTML document with JavaScript to count the number of Vowels in a text
typed in a Text Area.
HTML Code:
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Counts the number of vowels within a string</title>
</head>
<body>

</body>
</html>

JavaScript Code:
function vowel_count(str1)
{
var vowel_list = 'aeiouAEIOU';
var vcount = 0;

for(var x = 0; x < str1.length ; x++)


{
if (vowel_list.indexOf(str1[x]) !== -1)
{
vcount += 1;
}

}
return vcount;
}
console.log(vowel_count("The quick brown fox"));

15. Explain the use of Request and Response objects in the communication between
the browser and the web server.
The server processes the request and sends a response using a protocol (normally
HTTP). The request is sent from the browser to the web server. The term "server"
technically means nothing but a special piece of software running in a remote
computer to access resources

16. Write a note on Apache Web Server and IIS.


● Apache Web Server is designed to create web servers that have the ability to host
one or more HTTP-based websites. Notable features include the ability to support
multiple programming languages, server-side scripting, an authentication mechanism
and database support.
● It is also widely used by web hosting companies for the purpose of providing
shared/virtual hosting, as by default, Apache Web Server supports and distinguishes
between different hosts that reside on the same machine.
● Internet Information Services (IIS) Internet Information Services (IIS) is a flexible,
general-purpose web server from Microsoft that runs on Windows systems to serve
requested HTML pages or files. An IIS web server accepts requests from remote
client computers and returns the appropriate response.

17. Design a HTML form to find the railway fare from one place to another and also
design a 10x10 symmetric Matrix showing the railway fare between two places in a list
of 10 places.
Write a JSP which serves the form and tells the railway fare.
18. What are the event-handling methods in JavaScript?
Events are signals fired inside the browser window that notify of changes in the browser or
operating system environment. Programmers can create event handler code that will run
when an event fires, allowing web pages to respond appropriately to change.
onmouseover The user moves the mouse over an HTML
element

19. What are the JavaScript objects the events on that are for processing HTML form?

There are 3 ways to send form data:

● Building an XMLHttpRequest manually.


● Using a standalone FormData object.
● Using FormData bound to a <form> element.

20. List all the codes available in JavaScript for the Date.
The getDate() method returns the day of a date as a number (1-31):
example:
const d = new Date();
d.getDate();
21. What are Servlets?
Servlets are the Java programs that run on the Java-enabled web server or application
server. They are used to handle the request obtained from the webserver, process the
request, produce the response, then send a response back to the webserver.
Properties:
Servlets work on the server-side.
Servlets are capable of handling complex requests obtained from the webserver

22. How does the JSP provide connectivity to data bases?


The database is used for storing various types of data which are huge and has storing
capacity in gigabytes. JSP can connect with such databases to create and manage the
records.
In JSP, we are using databases for storing huge types of data. We can easily connect with
databases to create and manage records. JSP has a number of actions for database access
to improve the simple database-driven JAP applications. These actions provide the following
features:
1. Better performance and scalability.
2. Supports SQL queries like INSERT, UPDATE, DELETE and UPDATE.
3. Handles most common data type conversions.

Supports a combination of databases.

23. Design a database web page for Student Tabulation and Result using JSP and
JDBC-ODBC.

24. Explain the terms Active X control, ADOs, and ATL.


ActiveX controls are small building blocks that create applications that work over the
Internet through Web browsers. Examples include customized applications for collecting
data, viewing certain kinds of files, and displaying animation.
ActiveX Data Objects (ADO) is an application program interface from Microsoft that lets a
programmer writing Windows applications get access to a relational or non-relational
database from both Microsoft and other database providers.

Active Template Library (ATL), formerly called ActiveX Template Library) is a Microsoft
program library (set of prepackaged program routines) for use when creating Active Server
Page ( ASP ) code and other ActiveX program component s with C++

25. What are the DCOMs?


DCOM is a programming technique that allows a computer to run programmes on a remote
computer as if they were running locally. The Distributed Component Object Model (DCOM)
is an acronym for Distributed Component Object Model. It is a software component that
enables COM objects to communicate over the network.
26. Explain the term RMI and RPC.

27. What are some of the most common uses of applets? What features do they
contain?
Java applets are used to provide interactive features to web applications and can be
executed by browsers for many platforms. They are small, portable Java programs
embedded in HTML pages and can run automatically when the pages are viewed.
Features:
Draggable applets.
Separate JVM
Desktop shortcut
Increased heap size

28. Design a web page and include an applet. Customize the applet for your page.
Include information for users of text-only browsers and for those whose browsers are
not Java-enabled.
An applet is an object whose methods are run under the control of a Web browser. The Web
browser acts as a main() method and calls the applet's methods. The methods are called
when a Web page containing an applet is loaded, or in response to events such as mouse
clicks or menu selections.
Applets do not run by themselves. They are run in the context of a Web browser or the
appletviewer of the JDK.
To include an applet on a Web page use the following set of tags:
<applet code="MyApplet.class" width="250" height="200">
</applet>

The width and height give the size of a rectangle in the Web browsers screen that will be
used for the applet. You cannot omit width and height; but you can pick any reasonable
values you want.
The code="MyApplet.class" part names the compiled bytecodes of the applet that will be run.
With the above form of the applet tag, the bytecodes must be in the same disk subdirectory
as the Web page.
29. Design a Web page that uses the onMouseOver and onMouseOut event handlers
to load a new image when a user mouse over an image, and to restore the image
when the user moves the mouse off the image.
function handler(event) {

function str(el) {
if (!el) return "null"
return el.className || el.tagName;
}

log.value += event.type + ': ' +


'target=' + str(event.target) +
', relatedTarget=' + str(event.relatedTarget) + "\n";
log.scrollTop = log.scrollHeight;

if (event.type == 'mouseover') {
event.target.style.background = 'pink'
}
if (event.type == 'mouseout') {
event.target.style.background = ''
}
}

30. Design a Dynamic Web Site for online shopping. Web pages should include HTML,
Fast API, Session Tracking, Cookies, Java script, and DB Connectivity etc.

31. Explain the characteristics of Web Servers.


● Web Server can support enlarge data storage support, so it is capable to make
multiple websites.
● Easy to configure log file set up, enabling where to hold all log files. (Log files help to
analyses web traffic and more)
● It helps to control bandwidth to regulate network traffic, so due to this it can avoid the
down time while flowing high volume web traffic.
● Easy to make FTP websites, because it helps to move enlarge files from one site to
other site.
● Easy to set up website configuration and directory security
● Easy to make virtual directories, and then help to map them along with physical
directories.
● Easy to set up of custom error pages configuration that means it helps to view user
friendly error messages on your website, when your website is getting any issues like
as 404 Error will be displayed if web pages do not presented.
● Can be specified default documents for example if any file has not specify with its
name then default documents will be displayed.
● It is enabled with Server side web scripting so it allows user to make dynamic
websites. Few types of server side scripting languages are PHP, ASP, Ruby, Perl,
Python, and more.

32. ‘Javascript is referred to as Object based programming language’. Justify with an


example.
In contrast to object-oriented programming that uses classes, JavaScript does not have any;
it uses objects to represent complex data types. Some objects are created manually, while
others are built-in to the language itself, like the Date object.

33. What are the JavaScript events objects for processing HTML form?
JavaScript Event Handlers
Event handlers can be used to handle and verify user input, user actions, and browser
actions:

● Things that should be done every time a page loads


● Things that should be done when the page is closed
● Action that should be performed when a user clicks a button
● Content that should be verified when a user inputs data

onchange An HTML element has been changed

onclick The user clicks an HTML element

onmouseover The user moves the mouse over an HTML element

onmouseout The user moves the mouse away from an HTML element

onkeydown The user pushes a keyboard key

onload The browser has finished loading the page

34. Write the significance of XML schemas.


XML schema is a language which is used for expressing constraint about XML documents.
An XML schema is used to define the structure of an XML document. It is like DTD but
provides more control on XML structure.
The purpose of an XML Schema is to define the legal building blocks of an XML document:

● the elements and attributes that can appear in a document


● the number of (and order of) child elements
● data types for elements and attributes
● default and fixed values for elements and attributes

35. Write the differences between GET and POST methods in Fast API.
Compare GET vs. POST

The following table compares the two HTTP methods: GET and POST.

GET POST

BACK button/Reload Harmless Data will be re-submitted


(the browser should alert
the user that the data are
about to be re-submitted)

Bookmarked Can be bookmarked Cannot be bookmarked

Cached Can be cached Not cached

Encoding type application/x-www-form-urlencode application/x-www-form-url


d encoded or
multipart/form-data. Use
multipart encoding for
binary data

History Parameters remain in browser Parameters are not saved


history in browser history

Restrictions on data length Yes, when sending data, the GET No restrictions
method adds the data to the URL;
and the length of a URL is limited
(maximum URL length is 2048
characters)

Restrictions on data type Only ASCII characters allowed No restrictions. Binary data
is also allowed
Security GET is less secure compared to POST is a little safer than
POST because data sent is part GET because the
of the URL parameters are not
stored in browser history
or in web server logs

Never use GET when sending


passwords or other sensitive
information!

36. Write short notes on Fast API.


FastAPI is a modern, fast (high-performance), web framework for building APIs with Python
3.6+ based on standard Python type hints.

The key features are:

● Fast: Very high performance, on par with NodeJS and Go (thanks to


Starlette and Pydantic). One of the fastest Python frameworks available.
● Fast to code: Increase the speed to develop features by about 200% to
300%. *
● Fewer bugs: Reduce about 40% of human (developer) induced errors. *
● Intuitive: Great editor support. Completion everywhere. Less time
debugging.
● Easy: Designed to be easy to use and learn. Less time reading docs.
● Short: Minimize code duplication. Multiple features from each parameter
declaration. Fewer bugs.
● Robust: Get production-ready code. With automatic interactive
documentation.
● Standards-based: Based on (and fully compatible with) the open
standards for APIs: OpenAPI (previously known as Swagger) and JSON
Schema.

37. Explain the use of Request and Response objects in the communication between
the browser and the
Fast API web server.
38. Write the importance of integrating Fast API and AJAX with the help of examples.
39. Write a server-side python code to validate the form consisting of a username,
password and email fields.
import re
def solve(s):
pat = "^[a-zA-Z0-9-_]+@[a-zA-Z0-9]+\.[a-z]{1,3}$"
if re.match(pat,s):
return True
return False
from fastapi
import FastAPI,
Form

app = FastAPI()

@app.post("/register")

async def register(username: str = Form(...), password:


str = Form(...), email: str = Form(...) ):
If !solve(email)
raise HTTPException(status_code=400, detail="not
a valid email")
return {'username': username, 'password': password,
'email':email}

@app.post("/login")

async def login(username: str = Form(...), password: str =


Form(...)):
return {'username':username, 'password': password}

40. Write short notes on Web Applications.


● A web-application is an application program that is usually stored on a remote
server, and users can access it through the use of Software known as
web-browser.
● A web application are generally coded using the languages supported by
almost every web-browsers such as HTML, JavaScript because these are the
languages that rely on the web browsers to render the program executable.
● To operate a web- application, we usually required a web server (or we can say
some space on the web-server for our programs/application's code) to
manage the clients' upcoming requests and required an application server.
The Flow of the Web Application
● In general, a user sends a request to the web-server using web browsers such
as Google Chrome, Microsoft Edge, Firefox, etc over the internet.
● Then, the request is forwarded to the appropriate web application server by
the web-server.
● Web application server performs the requested operations/ tasks like
processing the database, querying the databases; produces the result of the
requested data.
● The obtained result is sent to the web-server by the web application server
along with the requested data/information or processed data.
● The web server responds to the user with the requested or processed
data/information and provides the result to the user's screen .
41. Explain with an example program how to connect to a SQL Server database from a
Fast API.
https://github.com/ben519/todooo

You might also like