0% found this document useful (0 votes)
28 views18 pages

Question Bank 3

Uploaded by

singhprpg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views18 pages

Question Bank 3

Uploaded by

singhprpg
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 18

Answer all the questions. Each carry 2 marks.

1.List the various client-side scripting languages.

Client-side scripting languages are programming languages that run on the


user's web browser rather than on the web server. They are used to enhance
the functionality and interactivity of web pages. Here are some of the
popular client-side scripting languages:

1. JavaScript: Widely used for web development, JavaScript is a versatile


language that allows developers to create dynamic and interactive
content.
2. HTML/CSS: While not traditional programming languages, HTML
(Hypertext Markup Language) and CSS (Cascading Style Sheets) are
essential for client-side web development. HTML structures the
content, and CSS is used for styling.
3. TypeScript: A superset of JavaScript, TypeScript adds static typing to
the language, making it easier to catch errors during development.
4. CoffeeScript: A concise and elegant language that compiles into
JavaScript. It aims to make code more readable and maintainable.
5. Dart: Developed by Google, Dart is a language that can be compiled
to JavaScript. It is often used with the Flutter framework for building
cross-platform mobile applications.
6. ActionScript: Traditionally used for Adobe Flash development,
ActionScript is an object-oriented language. However, Flash is
becoming obsolete, and the usage of ActionScript has decreased.
7. VBScript: A scripting language developed by Microsoft, primarily used
with Internet Explorer. Its usage has declined, and it is not as widely
supported as JavaScript.
8. JScript: Microsoft's implementation of ECMAScript, similar to
JavaScript. It was commonly used in Internet Explorer but has been
largely replaced by JavaScript.

1. Differentiate between java and java script.


2. What is “this” keyword in JavaScript?
const person = {
firstName: "John",
lastName : "Doe",
id : 5566,
fullName : function() {
return this.firstName + " " + this.lastName;
}
};
In JavaScript, the this keyword refers to an object.

Methods like call(), apply(), and bind() can refer this to any object

3. What is Search Engine Optimization(SEO)?


4. List the various dialogue boxes in JavaScript.
JavaScript uses 3 kinds of dialog boxes:
 Alert
 Prompt
 Confirm

5. Write a JavaScript function to find sum of first natural numbers.


// Javascript program to find sum of first
// n natural numbers.
function findSum(n) {
let sum = 0;
for (let i = 1; i <= n; i++)
sum = sum + i;
return sum;
}

// Driver code
const n = 5;
console.log(findSum(n));
6. What do you mean by search engine?
A search engine is a web-based tool or software application designed to help
users find information on the internet. Search engines utilize algorithms to
search and retrieve data from various websites, databases, and other online
sources based on the user's query or search terms. The primary purpose of a
search engine is to present relevant and organized results to users in response
to their search queries.
Google is the most widely used search engine globally, but there are others such
as Bing, Yahoo, and specialized search engines focused on specific types of
content (e.g., image search, video search). Search engines play a crucial role in
facilitating access to information on the internet and have become an integral
part of the daily online experience for users worldwide.
7. How do search engine work?
Search engines work through a series of complex processes involving web
crawling, indexing, and ranking algorithms
8. Define Name Server.
A Name Server (or nameserver) is a crucial component of the Domain Name System
(DNS), which is a decentralized system that translates human-readable domain
names into IP addresses. Domain names, like "www.example.com," are easier for
people to remember, but computers communicate using IP addresses.
Name Servers store and manage DNS records, providing information about the
domain, such as its associated IP addresses, mail servers, and other resources.
When a user enters a domain name in a web browser or attempts to send an email,
the Name Server is responsible for resolving that domain name to the
corresponding IP address or other relevant information.

There are two main types of Name Servers:

1. Authoritative Name Server


2. Recursive Name Server
9. What is DNS?
Domain Name System (DNS) is a hostname for IP address translation service.
DNS is a distributed database implemented in a hierarchy of name servers. It
is an application layer protocol for message exchange between clients and
servers. It is required for the functioning of the Internet
Domain names, like "www.example.com," are easier for people to remember,
but computers communicate using IP addresses.

SECTION-B
Answer any two questions. Each carry 5 marks.
1. Write a JavaScript program to print first N odd numbers divisible by 7.
function printOddNumbersDivisibleBy7(N) {
let count = 0;
let number = 1;

while (count < N) {


if (number % 2 !== 0 && number % 7 === 0) {
console.log(number);
count++;
}
number++;
}
}

// Example: Print the first 5 odd numbers divisible by 7


printOddNumbersDivisibleBy7(5);
2. What are the various JS objects? Explain each with an example.
CHAT GTP
3. What is web hosting? Discuss the different types hosting packages in detail.
Web hosting is a service that allows individuals and organizations to make
their websites accessible on the internet. When you create a website, you
need a place to store and make your web pages and files available for
visitors. Web hosting providers offer server space, resources, and other
essential services to host your website and make it accessible to users
worldwide.

Here are different types of web hosting packages:

1.Shared Hosting:
a. Description: In shared hosting, multiple websites share
resources on the same server. Each customer has a limit on the
resources they can use, such as disk space, bandwidth, and
databases.
b. Pros: Cost-effective, easy to set up, suitable for small websites
and beginners.
c. Cons: Shared resources can lead to performance issues if other
websites on the server experience high traffic.
2.Virtual Private Server (VPS) Hosting:
a.Description: VPS hosting uses virtualization technology to create
isolated virtual servers on a physical server. Each VPS operates
independently with its own dedicated resources.
b.Pros: More control and customization than shared hosting, better
performance and reliability.
c.Cons: More expensive than shared hosting, may require more
technical knowledge for management.
3Dedicated Hosting:
d. Description: With dedicated hosting, you get an entire physical
server exclusively for your website. This provides maximum
performance, control, and customization options.
e. Pros: High performance, full control over server settings,
suitable for large websites and applications.
f. Cons: Higher cost, requires server management skills, may be
overkill for small websites.
4. Cloud Hosting:
a. Description: Cloud hosting utilizes a network of interconnected
virtual servers that can scale resources dynamically based on
demand. It offers flexibility and scalability.
b. Pros: Scalability, flexibility, and reliability. Pay-as-you-go pricing
model.
c. Cons: Costs can increase based on usage, may require
understanding of cloud services.
5. Managed WordPress Hosting:
a. Description: Tailored for WordPress websites, this hosting type
includes specialized features for WordPress optimization,
security, and performance.
b. Pros: Simplifies WordPress management, automatic updates,
enhanced security.
c. Cons: Can be more expensive than shared hosting, may have
limitations for non-WordPress websites.
6. Reseller Hosting:
a. Description: Reseller hosting allows individuals or businesses to
resell hosting services. Resellers purchase hosting plans in bulk
and sell them to their clients.
b. Pros: Potential for profit by reselling hosting services, ability to
manage multiple hosting accounts.
c. Cons: Requires business management skills, relies on the
hosting provider's infrastructure.
7. Colocation Hosting:
a. Description: Colocation hosting involves renting space in a data
center to place your own server hardware. You are responsible
for maintaining and managing the server.
b. Pros: Full control over hardware, high security, can be cost-
effective for large-scale operations.
c. Cons: Requires technical expertise, higher upfront costs,
responsibility for maintenance.

4.What are the various JS operators? Explain each with an example.


5.Write a JavaScript program to calculate the factorial of a given number n.
6.Illustrate the steps required in registering Domains. Also mention why Domain
registering is useful.
CHAT GTP
7.Write a JavaScript program to find largest among five numbers.
function findLargestAmongFive(num1, num2, num3, num4, num5) {
// Initialize a variable to store the largest number
let largest = num1;

// Compare with the remaining numbers


if (num2 > largest) {
largest = num2;
}

if (num3 > largest) {


largest = num3;
}

if (num4 > largest) {


largest = num4;
}

if (num5 > largest) {


largest = num5;
}

// Print the result


console.log("The largest number is: " + largest);
}

// Example: Find the largest among 5, 10, 8, 15, and 12


findLargestAmongFive(5, 10, 8, 15, 12);

SECTION-C
Answer any one question. Each carry 10 marks.
1. Explain any six event handlers in JavaScript. Give an example of each. Write a JavaScript
program to develop the arithmetic calculator.
function arithmeticCalculator(num1, operator, num2) {
let result;

switch (operator) {
case '+':
result = num1 + num2;
break;
case '-':
result = num1 - num2;
break;
case '*':
result = num1 * num2;
break;
case '/':
if (num2 !== 0) {
result = num1 / num2;
} else {
console.log("Error: Division by zero is not allowed.");
return;
}
break;
default:
console.log("Error: Invalid operator.");
return;
}

console.log(`Result: ${num1} ${operator} ${num2} = ${result}`);


}

// Example: Perform addition (5 + 3)


arithmeticCalculator(5, '+', 3);

// Example: Perform multiplication (7 * 4)


arithmeticCalculator(7, '*', 4);

// Example: Perform division (10 / 2)


arithmeticCalculator(10, '/', 2);

// Example: Invalid operator


arithmeticCalculator(5, '%', 3);

Mouse events:

Event Performed Event Handler Description

click onclick When mouse click on an element


<button onclick="myFunction()">Click me</button

mouseover onmouseover When the cursor of the mouse comes over th

mouseout onmouseout When the cursor of the mouse leaves an elem

mousedown onmousedown When the mouse button is pressed over the e

mouseup onmouseup When the mouse button is released over the

mousemove onmousemove When the mouse movement takes place.

Keyboard events:

Event Performed Event Handler Description

Keydown & Keyup onkeydown & onkeyup When the user press and then releas

Form events:
Event Performed Event Handler Description

focus onfocus When the user focuses on an element

submit onsubmit When the user submits the form

blur onblur When the focus is away from a form element

change onchange When the user modifies or changes the val


element

Window/Document events

Event Performed Event Handler Description

load onload When the browser finishes the loading of the page

unload onunload When the visitor leaves the current webpage


unloads it

resize onresize When the visitor resizes the window of the browse

2. Write a JavaScript program that takes a sentence as input from the user and
counts the number of vowels (a, e, i, o, u) present in the sentence.
3. Design a JavaScript function that takes an array of numbers as input and
returns the sum and average of all the elements in the array. Display both
the sum and average.
function calculateSumAndAverage(numbers) {
// Check if the array is not empty
if (numbers.length === 0) {
console.log("Array is empty.");
return;
}

// Calculate sum
const sum = numbers.reduce((acc, num) => acc + num, 0);

// Calculate average
const average = sum / numbers.length;
// Display sum and average
console.log(`Sum: ${sum}`);
console.log(`Average: ${average}`);
}

// Example: Call the function with an array of numbers


const numberArray = [10, 5, 8, 12, 7];
calculateSumAndAverage(numberArray);
4. Discuss how do you use JavaScript for form validation? Develop a complete
application that would include information functions to validate the user data.
5. Discuss the creation of Cpanel in detail.

cPanel (Control Panel) is a web-based control panel used for


managing and administering websites and server settings on a web
hosting platform. It simplifies the process of website and server
management by providing an intuitive graphical interface. cPanel is
widely used in the web hosting industry due to its user-friendly
design and comprehensive features. Here's a detailed discussion on
the creation and usage of cPanel:

1. Accessing cPanel:
 Access to cPanel is typically provided by your web hosting
provider. You can access cPanel by navigating to a specific URL
provided by your hosting company, usually in the format
https://yourdomain.com/cpanel .

2. Logging In:
 Upon accessing the cPanel URL, you'll be prompted to log in.
Use the username and password provided by your hosting
provider.

3. cPanel Dashboard:
 After a successful login, you'll be greeted by the cPanel
dashboard. The dashboard is the central hub for managing
various aspects of your hosting account.
4. File Management:
 File Manager:
 cPanel provides a File Manager that allows you to upload,
download, and manage files directly from the web
interface. You can create, delete, and modify files and
folders.

5. Domain Management:
 Addon Domains:
 You can add additional domains to your hosting account
using the "Addon Domains" feature. This allows you to
host multiple websites under a single hosting account.

6. Database Management:
 MySQL Databases:
 cPanel includes tools for creating and managing MySQL
databases. You can create databases, add users, and
assign privileges.

7. Email Management:
 Email Accounts:
 Create and manage email accounts associated with your
domain. You can set up email forwarding,
autoresponders, and access webmail.

8. Security Settings:
 SSL/TLS Manager:
 cPanel provides tools for managing SSL/TLS certificates,
allowing you to secure your websites with HTTPS.

9. Software Installation:
 Softaculous (or similar):
 Many cPanel installations include Softaculous, a script
installer that simplifies the installation of applications like
WordPress, Joomla, and other content management
systems.

10. Metrics and Analytics:


 Awstats:
 View website statistics using Awstats. This provides
insights into visitor traffic, popular pages, and more.

11. Backup and Restore:


 Backup Wizard:
 cPanel includes a Backup Wizard that allows you to create
and restore backups of your website files, databases, and
email configurations.

12. DNS Management:


 Simple DNS Zone Editor:
 Manage DNS records for your domain using the Simple
DNS Zone Editor. You can add, edit, or delete DNS
records.

13. Advanced Settings:


 Advanced Options:
 Access advanced settings such as Cron Jobs, SSH access,
and PHP configuration through the "Advanced" section.

14. Customization and Branding:


 Branding:
 Some cPanel installations allow hosting providers to
customize the appearance and branding of the cPanel
interface.

15. Logging Out:


 After completing your tasks, it's essential to log out of cPanel
for security reasons.

cPanel simplifies server and website management, making it


accessible for users with various levels of technical expertise. Its
intuitive interface and diverse features make it a powerful tool for
website owners and administrators. Keep in mind that the specific
features and appearance of cPanel may vary slightly depending on
your hosting provider and the version of cPanel they are using.
6. Explain the importance of SEO. Differentiate between On Page Optimization
and Off Page Optimization under SEO.

S. No. On-Page SEO Off-Page SEO

On-page SEO includes


providing good
Off-page SEO includes
content, good keyword
link building, increasing
selection, putting
1. link popularity, search
keywords in correct
engine, link exchange
places, giving an
etc.
appropriate title for
every page, etc.

On-page SEO will


In off-page SEO we will
2. analyze the complete
promote the website.
website.

On-page SEO we will In off-page SEO we will


3.
use internal linking. use direct linking.

On-page SEO is for Off-page SEO is for


4.
Content writing. Article writing.

5. Techniques that are Techniques that are


used in on-page SEO. used in off-page SEO.
 Publish high-  Influencer
quality Outreach.
content.  Contribute as
 Optimize page Guest Author.
titles and meta  Social Media
S. No. On-Page SEO Off-Page SEO

descriptions.
 Optimize page
content. Engagement.
 Headings and  Social
content Bookmarking
formatting. Sites.
 SEO Images  Forum
and other Submission.
multimedia  Blog Directory
elements. Submission.
 URL  Article
optimization. Submission
 Internal links.
 External links.

According to
the MOZ website
While on off page it
6. owners spend about
only 30% activity
70% of time on on-
page activity

Off-page SEO looks at


On-page SEO looks at
7. how popular your site
what your site is about.
is.

8. Factors that impact On- Factors that impact


page SEO are as Off-page SEO are as
follows- follows-
 Internal  Social Media
Linking  Backlinks
 Mobile Friendly  Mentions
 Navigation  Google
 Content Business
Quality Profile (earlier
 Meta Google My
Descriptions Business)
 Image Alt Text
 Page Speed
 Core Web
S. No. On-Page SEO Off-Page SEO

Vitals
 Title Tags

Both SEO work Both SEO work


together in a together in a
complementary fashion complementary fashion
to achieve Search to achieve Search
Engine Optimization Engine Optimization
which is our main goal. which is our main goal.
We cannot select which We cannot select which
9.
is more important is more important
between the two. But between the two. But
in the whole process, in the whole process,
SEOs recommend that SEOs recommend that
the focus should be the focus should be
given to on-page SEO given to on-page SEO
before off-page SEO. before off-page SEO.

Applying relevant
Link Building is the
subtopics to content is
10. example of off- page
the example of on-
SEO.
page SEO.

You might also like