

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Need to prep for your CS exams? This solved exam paper has 8 exam-style questions with answers, covering everything from OOP, SQL queries, networking (TCP vs UDP), OS synchronization, and more. Great for university-level Computer Science students
Typology: Assignments
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Instructions:
Answer: A compiler translates the entire program into machine code before execution, producing an executable file. An interpreter translates and executes the program line by line, without producing a separate executable.
2. Write a SQL query to retrieve all students with marks above 70 from a table named Students.
Answer: SQL Query: SELECT * FROM Students WHERE marks > 70;
3. Describe three differences between TCP and UDP.
Answer:
Answer: Process synchronization ensures that multiple processes can operate safely when accessing shared resources, preventing race conditions and ensuring data consistency. Common mechanisms include semaphores, mutexes, and monitors.
5. List and briefly explain the four principles of Object-Oriented Programming (OOP).
Answer:
Answer: Storing hashes increases security by preventing attackers from directly obtaining user passwords if the database is compromised. Even if hashes are stolen, reversing them is computationally difficult, especially with salted hashes.
7. Differentiate between Waterfall and Agile models in Software Engineering.
Answer: Waterfall is a sequential model with distinct phases (requirements โ design โ implementation โ testing โ deployment). Agile is iterative, adaptive, and involves continuous feedback and incremental development.
8. Write a simple Python program to check if a number is prime.
Answer: Python Code: def is_prime(n): if n <= 1: return False for i in range(2, int(n**0.5) + 1): if n % i == 0: return False return True print(is_prime(7))