2nd Year Computer Science (Essay Type) - Answer Key
Section I - MS ACCESS
1. Data independence means the capacity to change the schema at one level without having to change the schema at
the next level.
2. Responsibilities of DBA: (i) Managing database structure (ii) Controlling access permissions.
3. Database: A collection of related data. DBMS: Software to manage database (e.g., MS Access).
4. Entity: An object that exists and is distinguishable. Example: Student, Teacher.
5. 2NF: A relation is in 2NF if it is in 1NF and all non-prime attributes are fully functionally dependent on the primary key.
6. SQL (Structured Query Language) is used to communicate with databases.
7. Four major components: Tables, Queries, Forms, Reports.
8. Methods of modifying a table: (i) Design View (ii) Datasheet View (iii) SQL View (iv) Using Queries.
Section I - C Language
1. Characteristics of C Language: Portable, Structured, Low-level access, Rich Library.
2. Low-level language is machine-friendly and close to hardware (e.g., Assembly).
3. Header file: Contains function declarations, e.g., stdio.h.
4. Output of code: a = 6, b = 2, c = 2.
5. Errors: Missing return type in main(), missing semicolon, improper syntax.
6. End of text file is indicated by EOF (End Of File).
7. getch() waits for a key press. getchar() inputs a character.
8. Stream: Sequence of data elements made available over time.
9. Ampersand (&) is used to pass address of variable in scanf().
2nd Year Computer Science (Essay Type) - Answer Key
Section I - Visual Basic
1. Characteristics: Easy GUI design, Event-driven, Integrated Debugging, Rapid Development.
2. Low-level language: Communicates directly with hardware, not commonly used in VB.
3. Difference: Property describes characteristics; method performs action.
4. Data types: Integer, String, Double, Boolean.
5. EOF is indicated using EOF function in VB.
6. Input box collects user input; message box displays message.
7. Literal constant: A constant value written directly, e.g., 5, "Text".
8. Comment: Used to explain code, e.g., 'This is a comment.
Section II - Visual Basic
1. Control structure: Controls the flow of execution. Examples: If, Select Case, Loops.
2. Flowchart of extended If-Then-Else: [Start] -> [Condition] -> [True -> Action1] -> [False -> Action2] -> [End]
3. Alternative of Select Case: If-Else-If ladder.
4. Iteration structures: Loops that repeat code. Examples: For, While, Do While.
5. Loop types in VB: For Next, While Wend, Do While, Do Until.
6. Pretest loop (checks condition first): e.g., While. Posttest loop (executes first): e.g., Do Until.
7. Actual parameters: Values passed. Formal parameters: Placeholders in function definition.
8. Exit Sub exits a subroutine. Exit Function exits a function and returns a value.
9. Function procedure: A reusable block of code that returns a value.
Section II - MS ACCESS (Descriptive)
2nd Year Computer Science (Essay Type) - Answer Key
1. Analysis stage includes: (i) Requirement gathering (ii) Data modeling (iii) Entity identification (iv) Relationship
definition.
2. Methods to modify table: (i) Altering structure in Design View (ii) Modifying data in Datasheet View (iii) Using SQL
commands (iv) Using Queries.
Section III - C Language (Descriptive)
1. Integer data: Whole numbers without decimals. Types: int, short, long.
2. Program (Even or Odd):
int a;
printf("Enter number: ");
scanf("%d", &a);
if (a % 2 == 0)
printf("Even");
else
printf("Odd");
3. Program (Output using loop):
for (int i = 1; i <= 8; i++)
printf("-%d ", i);
Section III - Visual Basic (Descriptive)
2nd Year Computer Science (Essay Type) - Answer Key
1. Integer data: Whole numbers. Types: Integer, Long, Short.
2. Program (Even or Odd):
Dim a As Integer
a = InputBox("Enter number:")
If a Mod 2 = 0 Then
MsgBox "Even"
Else
MsgBox "Odd"
End If
3. Program (Output using loop):
For i = 1 To 8
Print "-" & i
Next