0% found this document useful (0 votes)
11 views

Operating Web and Java Notes

Uploaded by

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

Operating Web and Java Notes

Uploaded by

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

Operating Web Class 12 Notes 4.

Confirmation of Reservation – When a booking is done,


the confirmation of the booking just takes a few seconds. It
Operating Web-based Applications is fast and secure.
Web-based applications are those that can be accessed through a 5. Making Choices – In online booking, the user can see the
web browser and a network connection. A web-based application arrangement of seats, select a particular seat, etc. In railway
offers the benefit of global availability around-the-clock. Web- booking, selection of lower berth/upper berth, type of food
based applications are now utilised for a variety of tasks, including required and booking for beddings is possible.
online shopping with the option of paying with credit or debit 6. Time Saving – Online reservation consumes very less time
cards, e-governance, and learning through online tutorials, quizzes, in contrast to long queues at the counter.
and other activities. 7. Discount Scheme – The users can avail the special discount
Online Reservation Systems schemes provided by the service provider like, season
A web-based reservation system enables online ticket purchase and discount, advance booking discount and frequent user
cancellation. Online reservation systems examples are – discount.
 Airline ticket Advantages for Providers
 Railway ticket 1. Requires Less Staffing – Less man-power is required as
 Bus ticket every task is done through computers.
 Movie ticket 2. No Spatial Restrictions – The physical location of the office
 Hotel booking does not really matter to a customer who
 Car rental is reserving tickets online. So, the organization, big or small,
 Tour and travel booking can choose their office space depending on their needs.
Operating Web Class 12 Notes 3. Global Access – The scope of access to the online
Advantages of Online Reservation System reservation becomes large as anyone who has access to the
Internet can search for the reservation site and book the
The advantages of the online reservation system are :
tickets.
Advantages for consumers online reservation
Operating Web Class 12 Notes
1. Convenient – The user/consumer can book tickets anytime
anywhere – from home, office, while travelling, etc. Precautions while Performing Online Transactions
2. Price Comparison – Online booking allows the customer to Some actions that can be taken to make the passwords safer are as
check the prices, compare them and get the best deal. follows –
3. Security – Most online reservation sites require the user to  Make a password complex, like mix case, use numbers and

create their profile and provide them with a username and special characters. This decreases ability of automated
password. The information thus remains secure until their attacks by trying different character combinations.
password is secure.  Be cautious not to leave passwords around and do not share
them with friends.
 Never use names of near and dear ones as passwords.
E-Governance of Communications and Information Technology, manages the
The government’s ability to give citizens access to information is portal.
goidirectory.nic.in
made easier by the usage of ICT. The government has established
ICT-enabled services, such as the registration of birth and death All websites from the Indian Government, from all levels and
throughout all sectors, can be accessed through this portal. Sites
certificates, the purchase of train tickets, the submission of RTI
requests, etc. for several Indian states and union territories are also included, as
are those for legislative and judicial branches of government. It also
Initiative
offers details about various industries, including agriculture and
The national satellite-based computer network, NICNET, was
education.
launched in India in 1987, providing the primary impetus for e-
Operating Web Class 12 Notes
Governance. The District Information System of the National
Informatics Center (DISNIC) programme, which aims to Online Shopping and Bill payments
computerise all district offices across the nation, was then An online shopping application allows customers to make
introduced in 1990. purchases of goods over the Internet. The customer can go to a
The Department of Electronics and Information Technology (DEITY) number of websites to conduct online purchasing.
and Department of Administrative Reforms and Public Grievances Benefits of Online Shopping
(DAR&PG) created the National e-Governance Plan (NeGP) in 2006, Online shopping is useful in many situations. Here, we discuss
which has helped the e-Governance process. some of the situations :
Operating Web Class 12 Notes  The customer does not have enough time to visit a store
E-Governance Sites and purchase goods.
Some of the Central initiatives for e-governance include:  The store where you will get what you need may be very far
 National e-Governance Plan (NeGP) off.
 National e-Governance Division (NeGD)  The money spent in travelling to the store, parking the car,
 e-Governance Infrastructure etc., is much more than overhead if any in online shopping.
 Mission Mode Projects  The product you may require is not available at your market.
 Citizens Services  You want to send a product to your friend; you can do
 Business Services online shopping and provide the receiver’s address. You
 Government Services save your time and energy for delivery of the product to
 Projects and Initiatives your friend’s house located in a different city.
 R&D in e-Governance  You do not have time during the shopping hours. You can

india.gov.in do online shopping from your office, home, a friend’s place,


India.gov.in went live on November 10th, 2005. It falls under the anywhere, any time. Thus there are no fixed shopping hours
National E-Government Plan, or NeGP, as a Mission Mode Project.  Online shopping also has bargain offers for the customer

The National Informatics Centre, which is a division of the Ministry delight.


 Some online stores allow customers to rate their services Feasibility : Is the project feasible?
and the items. (i) Check whether the project is technically feasible (is it possible to
Operating Web Class 12 Notes do it?).
Project Management – Web Based (ii) Check whether the project is economically feasible (is it
profitable?).
Application Development (iii) If feasible, proceed further, otherwise there is no need to
The process of generating web apps is included in web based proceed with the project.
application development. A software that is kept on a distant server Scope : The focus is on “what” the application must do. To define
is known as a web application. It is accessible online and supplied the scope of the application,
via a web browser interface. A web application could be of various (i) Compile a detailed list with a clear description of application
types, such as a game, quiz, or calculator for bills. features.
A project is a task that is carried out to produce an original good, (ii) Establish the goals that the solution must achieve.
service, or outcome. The following are some of a project’s essential (iii) Recognizing the limitations that are placed on the project.
qualities – Operating Web Class 12 Notes
 A project has a beginning and an end. The extent of the Design Phase
project is defined. It has boundaries. The focus is on “how” the application is to be designed. This
 A project requires finite resources that are required to consists of design of –
complete the project. A Map of the Web Application Site – A site map for a web
 A project has a specific time frame. It has a definite application comprises crucial details about the site’s structure,
beginning and end dates. including the pages and the connections between them.
 A project is complete when its end objectives are achieved. Database – Design the application database.
The objective is specific and identifiable. (i) Identify the database tables that will be required in the
Project Essentials and Tips application.
Phases in a Web Application Project (ii) Decide the table structures: For each table we need to identity
Web-based application development can be broadly divided into the attributes of the tables, their data types, the size of the columns
four phases. In the development in the tables, the relationship between tables.
1) Requirements Definition Phase Page Structure – Design the structure of page. Identify the main
2) Design Phase sections of the page like header, main content and sidebar.
3) Implementation Phase Implementation Phase
4) Testing Phase Create backend database, frontend and the connectivity between
Requirement Definition Phase them.
In this phase we identify the problem statement for which the web Backend Database – Create the database and write SQL code
application is to be developed. defining tables, attributes and relationships, as per the requirement
of the application.
Frontend – Identify the inputs that are required to be taken from d. Long
the user in the Front-End of the application. Decide the kind of e. Float
buttons you will provide to the user, to minimize the user’s typing f. Double
effort, like, Radio buttons, checkbox, list and combo box. g. Char
Data Connectivity – Establish the data connectivity between the h. Boolean
Front-End interface and Back-End Database. 4. What is String Variable?
Testing Phase Answer – String variables, also known as alphanumeric or character
Test the front end and back end of the entire programme using variables, have values that are interpreted as text. In other words,
various example data sets. Find and fix any application bug you string variables’ values could be made up of letters, numbers, or
can. symbols.
5. What is Operator and what are the different types of
Fundamentals of Java Programming Class
Operator?
12 Questions and Answers Answer – Operators are special symbols in a programming
1. What is Variable? language and perform certain specific operations. Java support –
Answer – A variable is a storage location for information whose a. Arithmetic Operators : +, -, *, /, %, ++, —
value may vary while a programme is running. A variable is, b. Relational Operators : ==, !=, >, <, >=, <=
technically speaking, the name of a storage area in the computer’s c. Assignment Operators : =, +=, -=, *=, /=, %=
internal memory. The data present there serves as the variable’s d. Logical Operators : &&, ||, !
value. Fundamentals of Java Programming Class 12 Questions and
2. What are the different Variable naming rules in Java? Answers
Answer – The variable naming rules in Java are – 6. Difference between Entry control loop and Exit control loop.
a. Variable names can begin with either an alphabetic character, an Answer – Difference between entry control and Exit control loop
underscore, or a dollar sign. are –
b. Space is not allowed in variable names. Entry Control Loop –
c. Reserved words are not used in variables. a. Entry Control Loop tests the condition first and then executes the
d. Java is a case-sensitive language. body of the loop.
Fundamentals of Java Programming Class 12 Questions and b. If the condition is false, Entry control loop will not execute
Answers c. Example of entry control loop are – for loop and while loop
3. What are the different Primitive Data Types in Java? Exit Control Loop –
Answer – There are eight different types of primitive data types in a. Exit Control loop tests the condition after running a block of
Java. code.
a. Byte b. If the condition is false, the Entry control loop will execute at
b. Short least one time.
c. Int c. Example of entry control loop are – do-while
7. What is an Array? 12. What are the different types of Access Modifiers?
Answer – Arrays are variables that can hold more than one value, Answer – Access modifiers are keywords that manage a class’s
they can hold a list of values of the same type. Example – marks = fields, methods, and function. Examples of access modifiers are
new double[5]; Public, protected, and private.
Fundamentals of Java Programming Class 12 Questions and Fundamentals of Java Programming Class 12 Questions and
Answers Answers
8. What is the purpose of user defined methods? 13. What is the purpose of Getter and Setter Methods?
Answer – User-defined functions are techniques you can use to Answer – Private data members of a class cannot be accessed
arrange your code within a body. Once a function has been outside the class however, you can give controlled access to data
defined, it can be used in the same way that the built-in action and members outside the class through getter and setter methods.
parser functions are used. Instead of being passed by value, Basic Java program –
variables are passed by reference to functions. 14. Write a program to accept integer number from user and print
9. What are OOPs? the number.
Answer – OOPs stands for Object Oriented Programming, Java is import java.util.Scanner;
an Object Oriented Programming (OOP) language. In an OOP public class HelloWorld {
language, a program is a collection of objects that interact with
other objects to solve a problem. Each object is an instance of a public static void main(String[] args) {
class. Scanner reader = new Scanner(System.in);
10. What is the difference between local and global variables? System.out.print("Enter a number: ");
Answer – Depending on their scope, variables are divided into
global variables and local variables. Local variables can only be int number = reader.nextInt();
accessed within the function or block in which they are defined, In
System.out.println("You entered: " + number);
other hand the global variables, which can be used worldwide }
throughout the entire programme. }
Fundamentals of Java Programming Class 12 Questions and
Answers Output -
11. What is the purpose of Constructor in Java? Enter a number: 20
You entered: 20
Answer – A special method member called the constructor method
15. Write a program to accept two numbers from the user and find
is used to initialize the data members of the class (or any other
the sum of numbers.
initialization is to be done at time of object creation). The class Example {
constructor has the same name as the class, has no return type, and
may or may not have a parameter list. Whenever a new object of a public static void main(String[] args) {
class is created, the constructor of the class is invoked
int n1=22, n2=44, sum;
automatically. We do not call the constructor explicitly.
sum = n1 + n2;
If Statement related program –
System.out.println("The sum is: " + sum); 17. Write a program to accept number from the user and check
} whether number is even or odd.
} import java.util.Scanner;
public class Example {
Output - public static void main(String[] args) {
Enter two numbers
22 44 Scanner reader = new Scanner(System.in);
The sum is: 66 System.out.print("Enter a number: ");
Fundamentals of Java Programming Class 12 Questions and int num = reader.nextInt();
Answers if(num % 2 == 0)
System.out.println(num + " is even");
16. Write a program to swap the numbers without using 3rd
else
variable. System.out.println(num + " is odd");
public class Swap { }
}
public static void main(String[] args) {
Output -
int n1=51, n2=48; Enter a number: 22
System.out.println("First number = " + n1); 22 is even
System.out.println("Second number = " + n2);
Fundamentals of Java Programming Class 12 Questions and
n1=n1+n2;
n2=n1-n2; Answers
n1=n1-n2; 18. Write a program to accept number from the user and check
whether an alphabet is vowel or consonant.
System.out.println("Result"); import java.util.Scanner;
System.out.println("First number = " + n1); public class Example {
System.out.println("Second number = " + n2); public static void main(String[] args) {
}
} Scanner reader = new Scanner(System.in);
System.out.print("Enter a character: ");
Output - char ch = reader.next().charAt(0);
First number = 51
Second number = 48 if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' )
Result System.out.println(ch + " is vowel");
First number = 48 else
Second number = 51 System.out.println(ch + " is consonant");
Fundamentals of Java Programming Class 12 Questions and
Answers }
}
public static void main(String[] args) {
Output -
Enter a character: a int year = 2022;
a is vowel boolean leap = false;
19. Write a program to accept three numbers from the user and
find the largest number. if (year % 4 == 0) {
public class Example {
public static void main(String[] args) { if (year % 100 == 0) {
if (year % 400 == 0)
Scanner reader = new Scanner(System.in); leap = true;
System.out.print("Enter a 1st number: "); else
char n1 = reader.nextInt(); leap = false;
}
System.out.print("Enter a 2nd number: ");
char n2 = reader.nextInt(); else
leap = true;
System.out.print("Enter a 3rd number: "); }
char n3 = reader.nextInt();
else
if( n1 >= n2 && n1 >= n3) leap = false;
System.out.println(n1 + " is the largest number.");
if (leap)
else if (n2 >= n1) System.out.println(year + " is a leap year.");
System.out.println(n2 + " is the largest number."); else
System.out.println(year + " is not a leap year");
else }
System.out.println(n3 + " is the largest number"); }
}
} Output -
2022 is not a leap year
Output - Fundamentals of Java Programming Class 12 Questions and
Enter a 1st number: 7 Answers
Enter a 2nd number: 3 21. Write a program the check weather a number is positive or
Enter a 3rd number: 9 negative.
9 is the largest number public class Example {
Fundamentals of Java Programming Class 12 Questions and
Answers public static void main(String[] args) {
20. Write a program to check leap year.
public class Example { double n1 = 18;
if (number < 0.0) int num = 10;
System.out.println(number + " is a negative number"); long f = 1;
for(int i = 1; i <= num; ++i)
else if ( number > 0.0) {
System.out.println(number + " is a positive number"); f = f * i;
}
else System.out.printf("Factorial of a number ", f);
System.out.println(number + " is 0"); }
} }
}
Output -
Output - Factorial of a number = 3628800
18 is a positive number 24. Write a program to print the Fibonacci series 0, 1, 1, 2, 3, 5, 8,
22. Write a program to check whether a character is alphabet or class Example {
not. public static void main(String[] args) {
public class Example {
int n = 10, first = 0, second = 1, sum = 0;
public static void main(String[] args) {
for (int i = 1; i <= n; i++) {
char c = 'a'; System.out.print(first + ", ");

if( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) sum = first + second;
System.out.println(c + " is an alphabet"); first = second;
else second = sum;
System.out.println(c + " is not an alphabet"); }
} }
} }
Fundamentals of Java Programming Class 12 Questions and
Output - Answers
a is an alphabet 25. Write a program to check whether the string is palindrome or
Fundamentals of Java Programming Class 12 Questions and not.
Answers class Example {
Looping statement related program – public static void main(String[] args) {
23. Write a program to Find Factorial of a Number String str = "MADAM", r_str = "";
n=1*2*3*4*…*n int strLength;
public class Example {
int strLength = str.length();
public static void main(String[] args) {
for (int i = (strLength - 1); i >=0; i--) {
r_str = r_str + str.charAt(i); 27. Write a program to design simple calculator using switch
} statement.
import java.util.Scanner;
if (str.toLowerCase().equals(r_str.toLowerCase())) { class Example {
System.out.println(str + " is a Palindrome"); public static void main(String[] args) {
}
else { char ch;
System.out.println(str + " is not a Palindrome"); Double number1, number2, result;
}
} Scanner input = new Scanner(System.in);
}
System.out.println("Choose an operator: +, -, *, or /");
Output - System.out.println("1. +");
MADAM is a Palindrome System.out.println("2. -");
Fundamentals of Java Programming Class 12 Questions and System.out.println("3. *");
Answers System.out.println("4. /");
26. Write a program to check whether a number is prime or not.
public class Example { System.out.println("Select choice");

public static void main(String[] args) { ch = input.next().charAt(0);

int num = 7; System.out.println("Enter first number");


boolean f = false; number1 = input.nextDouble();
for (int i = 2; i <= num / 2; i++) { System.out.println("Enter second number");
if (num % i == 0) { number2 = input.nextDouble();
f = true;
break; switch (ch) {
}
} case '+':
result = number1 + number2;
if (!f) System.out.println(number1 + " + " + number2 + " = " + result);
System.out.println(num + " is a prime number"); break;
else
System.out.println(num + " is not a prime number"); case '-':
} result = number1 - number2;
} System.out.println(number1 + " - " + number2 + " = " + result);
break;
Output -
7 is a prime number case '*':
result = number1 * number2;
Switch Statement related program – System.out.println(number1 + " * " + number2 + " = " + result);
break; Output -
1
case '/': 2
result = number1 / number2; 3
System.out.println(number1 + " / " + number2 + " = " + result); 4
break; 5
29. Write a program to find the average of given array 7, 34, 55, 82,
default: 44.
System.out.println("Invalid choice!"); public class Example {
break;
} public static void main(String[] args) {
int[] numArray = { 7, 34, 55, 82, 44 };
input.close(); double sum = 0;
}
} for (double num: numArray) {
sum += num;
Output - }
1. +
2. - double average = sum / numArray.length;
3. * System.out.format("The average is " + average);
4. / }
Select Choice + }
Enter first number 4
Enter second number 6 Output -
4 * 6 = 10 The average is: 44.4
Fundamentals of Java Programming Class 12 Questions and String function related program –
Answers 30. Write a program to find the concatenate of two different string
Array public class Example {
public static void main(String[] args) {
28. Write a program to Print an Array.
String str1="Anurag";
public class Example {
String str2="Anand";
public static void main(String[] args) {
String str3=str1.concat(str2);
int[] array = {1, 2, 3, 4, 5};

for (int element: array) { System.out.println(str3);


System.out.println(element);
}
}
}
}
}
Output -
Anurag Anand }
31. Write a program to find the length of the string
public class Example { Output -
public static void main(String[] args) { anurag
String str="Anurag";

int len=str.length();

System.out.println(len);

}
}

Output -
6
32. Write a program to convert the string in uppercase format.
public class Example {
public static void main(String[] args) {
String str="anurag";

String upper=str.toUpperCase();

System.out.println(upper);

}
}

Output -
ANURAG
33. Write a program to convert the lowercase string to uppercase
string.
public class Example {
public static void main(String[] args) {
String str="ANURAG";

String lower=str.toLowerCase();

System.out.println(lower);

You might also like