0% found this document useful (0 votes)
13 views6 pages

Answer Key Pre Halfyearly 2024

Heheh

Uploaded by

w15612431
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)
13 views6 pages

Answer Key Pre Halfyearly 2024

Heheh

Uploaded by

w15612431
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/ 6

Q 1i.

Two benefits of effective communication in the workplace:


Improves teamwork and collaboration.
Enhances problem-solving and decision-making.

ii. Importance of self-motivation for an entrepreneur:


Self-motivation drives entrepreneurs to overcome challenges and remain focused on their goals, enabling business
growth and innovation.

iii. Two green skills required in the IT industry:


Energy-efficient programming.
Sustainable resource management in IT operations.

iv. Define self-motivation. Why is it important?


Self-motivation is the ability to push oneself to take initiative and pursue goals without external encouragement. It is
important because it fosters resilience, productivity, and personal growth.

v. Two key components of active listening:


Paying full attention to the speaker.
Providing feedback to ensure understanding.

vi. What are green jobs? Provide one example:


Green jobs are roles that contribute to preserving or restoring the environment.
Example: Solar panel technician.

Q2:
i. SQL command to modify data in a database:
a) UPDATE
ii. In Java, NOT a primitive data type:
c) String
iii. SQL command to delete a database:
b) DROP DATABASE
iv. SQL clause to filter data based on a condition:
a) WHERE
v. Used to uniquely identify a record in a relational database table:
b) Primary Key
vi. NOT a loop structure in Java:
c) switch
vii. Application program running on multiple devices, communicating with servers over the internet:
Web-based application

Q3:
i. Two services under Digital India initiative:
DigiLocker.
BHIM (Bharat Interface for Money).
ii. Invalid identifier:
d) #Score
iii. Degree and cardinality of Library table:
Degree: 5 (number of columns).
Cardinality: 4 (number of rows).
iv. Primary Key and Foreign Key for CUSTOMERS and ORDERS:
Primary Key: OrderID (in ORDERS table).
Foreign Key: CustID (in ORDERS table linking to CUSTOMERS table).
v. NOT an example of a government ICT-enabled service:
b) Online ticket booking for movies
vi. One way to prevent unauthorized access:
Use strong passwords and multi-factor authentication.
vii. Valid variable names in Java:
b) empName and d) Emp_123

Q4:
i. Sequence for hosting a webinar:
a) B, D, C, A
ii. SQL function to count rows in a table:
b) COUNT()
iii. False statement about online banking:
b) Online banking ensures complete safety from cyberattacks.
iv. TRUE or FALSE:
True (Data encapsulation in OOP).
v. Result of SQL query:
b) Displays the average marks.
vi. Output of Java statement:
b) False

Q5:
i. Valid Foreign Key in a database:
b) A non-unique attribute referring to the primary key of another table.
ii. TRUE or FALSE:
True (Encapsulation in Java).
iii. SQL command to delete all rows without deleting the table structure:
DELETE FROM EMPLOYEES;
iv. SQL command to rename a table or column:
ALTER TABLE (for column).
RENAME TABLE (for table).
v. Difference between Java statements:
Statement #1: int num = 10; declares an integer variable.
Statement #2: double decimalNum = 10.5; declares a double-precision floating-point variable.
vi. Method with the same name as the class:
b) Constructor

Q6:
i. SQL command to change column data type:
ALTER TABLE
ii. Invalid variable declaration in Java:
c) String @Name = "Priya";
iii. Java method without a return value:
Void method

iv. Constraint for AGE column values greater than 18:


CHECK
v. Two benefits of e-governance systems:
Easy access to government services.
Transparency in administrative processes.
vi. SQL operator for pattern matching with strings:
LIKE
Q7. Two benefits of time management for students:
Improves productivity and helps complete tasks on time.
Reduces stress by organizing study schedules effectively.
Q8. What is constructive feedback? How is it different from criticism?
Constructive Feedback: It provides specific, actionable suggestions aimed at helping a person improve their
performance or behavior while maintaining a positive and respectful tone.
Difference from Criticism: Constructive feedback focuses on improvement and encouragement, whereas criticism
often highlights faults in a negative or judgmental way.
Q9. Two common cybersecurity practices to protect data online:
Using strong, unique passwords and enabling multi-factor authentication.
Keeping software and antivirus programs updated regularly.
Q10. Define filtering in a spreadsheet. Can data be filtered by multiple criteria?
Definition: Filtering in a spreadsheet involves displaying only those rows that meet specific conditions, while hiding
others.
Yes, data can be filtered by multiple criteria using advanced filter options or combining conditions with logical
operators.
Q11. Two entrepreneurial competencies essential for running a business successfully:
Decision-making ability.
Effective communication skills.

Q 12
int n = 5;
for (int i = 0; i < n; i++) {
System.out.println("Number: " + i);
}

a) To add a new column Designation:


ALTER TABLE EMPLOYEE ADD COLUMN Designation VARCHAR(30);
b) To reduce the salary of all employees by 10%:
UPDATE EMPLOYEE SET Salary = Salary * 0.9;
Q14. Output of Java Code Segment:
Code:
int num = 6, result = 1;
for (int i = 1; i <= num; i++) {
result *= i;
}
System.out.println("Factorial: " + result);
Output:
Factorial: 720
Q15. Two Advantages of Using Relational Databases in Healthcare:
Data Integrity: Ensures accurate and consistent patient records, minimizing errors in medical history or prescriptions.
Efficient Data Retrieval: Allows quick access to patient details, treatments, and billing information.

Q16. Suggested Schema for SALES Table:


Table: SALES
Field Name Data Type Description
SaleID INTEGER PRIMARY KEY Unique identifier for each sale.
ProdID INTEGER FOREIGN KEY REFERENCES PRODUCTS(ProdID) Links to the product sold.
SaleDate DATE Date of the sale.
Quantity INTEGER Number of units sold.
TotalPrice REAL(8, 2) Total amount of the sale.

a) To add a new column Designation:


ALTER TABLE EMPLOYEE ADD COLUMN Designation VARCHAR(30);

b) To reduce the salary of all employees by 10%:


UPDATE EMPLOYEE SET Salary = Salary * 0.9;

Q14. Output of Java Code Segment:


Code:
int num = 6, result = 1;
for (int i = 1; i <= num; i++) {
result *= i;
}
System.out.println("Factorial: " + result);
Output:
Factorial: 720
Q15. Two Advantages of Using Relational Databases in Healthcare:
Data Integrity: Ensures accurate and consistent patient records, minimizing errors in medical history or prescriptions.
Efficient Data Retrieval: Allows quick access to patient details, treatments, and billing information.
Q16. Suggested Schema for SALES Table:
Table: SALES(SaleID INTEGER, ProdID INTEGER, SaleDate DATE, Quantity INTEGER, TotalPrice decimal(8, 2))
Sales
Field Name Data Type Description
SaleID INTEGER PRIMARY KEY Unique identifier for each sale.
ProdID INTEGER FOREIGN KEY REFERENCES PRODUCTS(ProdID) Links to the product sold.
SaleDate DATE Date of the sale.
Quantity INTEGER Number of units sold.
TotalPrice REAL(8, 2) Total amount of the sale.

Q 17.
int A = 3, B = 4;
int Product = 1;
int i = 1;
while (i <= B) {
Product *= A;
i++;
}
System.out.println(Product);

Q 18 a) Define Primary Key:


A Primary Key is a unique identifier for each record in a table. It ensures that no two rows have the same value and
cannot contain NULL values.
b) Queries:
i) Total number of students in each class:
SELECT Class, COUNT(*) AS TotalStudents FROM STUDENT GROUP BY Class;
ii) Average marks of students born after 2008:
SELECT AVG(Marks) AS AverageMarks FROM STUDENT WHERE DOB > '2008-01-01';

Q 19
DROP DELETE
I) Removes an entire table from the database. Removes specific rows from a table.
II) Cannot be rolled back. Can be rolled back using a transaction.
III) DROP TABLE TableName; DELETE FROM TableName WHERE Condition;
Example:
-- DROP command:
DROP TABLE EMPLOYEE;

-- DELETE command:
DELETE FROM EMPLOYEE WHERE Salary < 30000;

Q20. Java Program for Factorial Calculation:


a) Using a for loop:
int num = 5;
int factorial = 1;
for (int i = 1; i <= num; i++) {
factorial *= i;
}
System.out.println("Factorial using for loop: " + factorial);
b) Using a while loop:
int num = 5;
int factorial = 1, i = 1;
while (i <= num) {
factorial *= i;
i++;
}
System.out.println("Factorial using while loop: " + factorial);

Q21.
a) Output of Java Code:

String greeting = "Hello, World!";


System.out.println(greeting.substring(7)); // "World!"
System.out.println(greeting.indexOf('W')); // 7
System.out.println(greeting.toUpperCase()); // "HELLO, WORLD!"
b) JVM: Java Virtual Machine.

Q22.
a) Platforms offering free coding bootcamps/tutorials:
Codecademy
freeCodeCamp
b) Phases of SDLC:
Requirement Analysis: Gathering and analyzing user needs (e.g., user interviews).
Design: Creating system and architectural designs (e.g., UML diagrams).
Implementation: Writing and compiling code (e.g., using Java or Python).
Testing: Ensuring the system meets requirements (e.g., unit testing).
Deployment: Installing the system for end-users.
Maintenance: Addressing bugs and updates.

Q23.
a) Term "Method" in Java:
A method is a block of code that performs a specific task and is executed when called.
Example:
public int addNumbers(int a, int b) {
return a + b;
}
b) Java Code:
int[] scores = {45, 56, 78, 34, 89, 67};
for (int i = 0; i < scores.length; i++) {
System.out.println(scores[i]);
}
Q24. SQL Queries for BOOK and BORROWER Tables:
a) Count of books borrowed by each borrower:
SELECT BorrowerName, COUNT(BID) AS BooksBorrowed FROM BORROWER GROUP BY BorrowerName;
b) Add a new book to the BOOK table:
INSERT INTO BOOK (BID, Title, Author, Price, Publisher) VALUES (105, 'Machine Learning', 'Tom Mitchell', 900,
'McGraw Hill');
c) Titles of books borrowed on or after "2023-03-01":
SELECT BOOK.Title FROM BOOK, BORROWER WHERE BOOK.BID = BORROWER.BID AND BORROWER.BorrowDate >=
'2023-03-01';
d) Books where price exceeds 600:
SELECT * FROM BOOK WHERE Price > 600;

You might also like