SOLUTION OF PRE
SOLUTION OF PRE
i. a) Declarative sentences
ii. d) Physiological motivation is made up of emotional, behavioral, and mental set of
characteristics.
iii. a) Internal motivation
iv. c) Sorting
v. c) Concern for Employees' Welfare
vi. a) Social Entrepreneurs
i. a) B, D, C, A (The correct sequence for booking flight tickets is: 1) Open the website, 2) Browse and
search for information, 3) Choose the dates of travel, 4) Make the payment.)
iii. b) Once the goods are purchased they cannot be returned or exchanged (This is not true for online
shopping, as most online shopping platforms offer returns or exchanges.)
v. Java is case-sensitive means that Java distinguishes between uppercase and lowercase letters. For
example, variable and Variable would be treated as two different identifiers. This is in contrast to
some languages that are case-insensitive.
vi. false (The statement 4*4*4 == 8*8 is false because 64 (444) is not equal to 64 (88).)*
Q.5 (General IT and Java Questions):
i. False
(Fixing all the application bugs and fixing them is part of the Debugging Phase, not the Testing Phase.)
ii. DROP TABLE SCHOOL.PERSONAL;
(This command will remove the table named PERSONAL permanently from the SCHOOL database.)
iii. c) IDE
(An IDE, or Integrated Development Environment, is used to compile, debug, and execute Java
programs.)
iv.
Statement #1 (char Alpha = 'A';): This statement declares a variable Alpha of type char and
assigns it the character value 'A'.
Statement #2 (String Name = "Manish";): This statement declares a variable Name of type
String and assigns it the string value "Manish".
v. b) Constructor
(A constructor is a special method used to initialize the data members of a class when an object of the
class is created.)
vi. An exception in Java is an event that disrupts the normal flow of the program's execution. It
represents an error or an unexpected situation, such as dividing by zero or trying to access an invalid array
index. Exceptions are handled using try, catch, and finally blocks to ensure the program can recover
gracefully from errors.
Q.7 to Q.11:
Q.7 Importance of Self-Motivation
1. Increases Productivity: Self-motivation helps individuals stay focused on their tasks and work
more efficiently, leading to increased productivity.
2. Helps Achieve Goals: Self-motivation provides the drive and persistence to achieve personal and
professional goals, even when challenges arise.
Q.8 What is Active Listening? List Any Two Factors that Affect Active Listening
Active Listening is the process of fully concentrating, understanding, responding, and
remembering what is being said. It involves not just hearing but engaging with the message.
Factors that affect active listening:
1. Environmental Distractions: Noisy surroundings or other distractions can hinder the
ability to listen attentively.
2. Emotional Barriers: Personal biases, emotions, or preconceived notions may interfere
with listening actively and understanding the message.
Q.9 Do You Think There Are Toxins in Our Environment? What Is Your View of Toxins in Our
Homes?
Yes, toxins are present in our environment in various forms, such as air pollution, chemicals in food, and
industrial waste.
Toxins in our homes can come from cleaning products, pesticides, and even household items like
paints and furniture. Exposure to these toxins can harm health, especially over time, so it's
essential to minimize their use and ensure proper ventilation.
Q.10 What is Sorting in a Spreadsheet? Can Data Be Sorted on More Than One Column?
Sorting in a Spreadsheet refers to arranging data in a specific order (either ascending or
descending), such as sorting a list of names alphabetically or numbers by size.
Yes, data can be sorted on more than one column. For example, you can first sort by name
alphabetically and then by date or price within each name group.
Q.11 Two Methods to Deal with Stress
1. Exercise: Physical activity helps reduce stress by releasing endorphins, which improve mood and
reduce anxiety.
2. Relaxation Techniques: Practicing deep breathing, meditation, or yoga can help calm the mind
and alleviate stress.
Q.12 to Q.15:
Q.12 Output of the Code Segment:
public class Main {
public static void main(String[] args) {
int day = 4;
switch (day) {
case 6:
System.out.println("Today is Saturday");
break;
case 7:
System.out.println("Today is Sunday");
break;
default:
System.out.println("Looking forward to the Weekend");
}
}
}
Output:
Looking forward to the Weekend
Since day is 4, which does not match either case 6 or case 7, it goes to the default case and
prints "Looking forward to the Weekend".
Q.16 Answers:
a) To modify the Value column to store real numbers with a precision of up to 4 decimal places, Rajni
needs to alter the column type in the STOCKDATA table. The appropriate SQL statement would be:
ALTER TABLE STOCKDATA
MODIFY Value DECIMAL(10, 4);
This command changes the Value column to have a decimal type with a total of 10 digits, where 4 digits
are reserved for the fractional part (precision of 4 decimal places).
b) To increase all the values in the Value column by 25%, Rajni can use the UPDATE statement as follows:
UPDATE STOCKDATA
SET Value = Value * 1.25;
This statement will multiply the current value in the Value column by 1.25, effectively increasing each
value by 25%.
17-Corrected and completed code in Java to print "Yes" 5 times using a loop:
Explanation:
Q.18
a) Referential Integrity
Referential Integrity is a property of a relational database that ensures that relationships between tables
remain consistent. Specifically, it ensures that foreign keys in a table correspond to primary keys in
another table. In simple terms, it ensures that a record in a child table can only reference an existing
record in a parent table. For example, a Student table might have a Department_ID column that refers to
the Department table. Referential integrity ensures that every value in Department_ID corresponds to an
existing department.
b) SQL Statements:
i) To display the number of teachers and the corresponding department name in each department:
SELECT DEPT, COUNT(TID) AS Number_of_Teachers
FROM TEACHER
GROUP BY DEPT;
This query groups the records by DEPT and counts
the number of teachers (represented by TID) in
each department.
ii) To display the minimum PAY of teachers whose Date of Appointment is after 2010:
SELECT MIN(PAY) AS Minimum_PAY
FROM TEACHER
WHERE DOA > '2010-01-01';
This query finds the minimum PAY of teachers whose Date of Appointment (DOA) is after
January 1st, 2010.
Q.20
a) Output for the Code:
String myString = "Welcome to Java";
System.out.println(myString.concat(" Session"));
System.out.println(myString.length());
System.out.println(myString.replace("to", "2"));
Output:
Welcome to Java Session
18
Welcome 2 Java
concat(" Session"): Concatenates the string " Session" to the original string, so the output is
"Welcome to Java Session".
length(): Returns the length of the string, which is 18 characters.
replace("to", "2"): Replaces the word "to" with the number "2", so the string becomes
"Welcome 2 Java".
Q.21
a) Two Educational Websites Providing Free Online Courses:
1. Coursera - Offers free online courses in collaboration with various universities like Stanford,
University of Michigan, etc.
2. edX - Provides online courses for free from universities like Harvard, MIT, etc.
b) What is a Project?
A project is a temporary and organized effort undertaken to achieve a specific goal or objective. It
typically has a defined start and end, specific resources, and a set of deliverables. Projects can involve
various activities, such as research, development, or construction, and are often used in fields such as
business, technology, and education.
An array is a data structure that stores a fixed-size collection of elements, all of which are of the same
type. It allows you to store multiple values in a single variable, and each element in the array can be
accessed using an index.
Example:
i) Create an array Marks that stores values 78, 65, 85, 91, and 82:
ii) To print all the values of the array Marks using a loop:
int sum = 0;
for (int i = 0; i < Marks.length; i++) {
sum += Marks[i]; // Sum up all the values
}
double average = sum / (double) Marks.length; // Calculate the average
System.out.println("The average is: " + average); // Print the average
Here is the typical process Aman would follow to shop for shoes online: