COS 102 Past Questions and Answers

Share With Friends

csc 102

COS 102

1. What is the primary function of an operating system?
A) To manage hardware and software resources
B) To compile code
C) To connect to the internet
D) To create databases
Answer: A) To manage hardware and software resources


2. In a flowchart, what shape is used to represent a decision?
A) Rectangle
B) Oval
C) Diamond
D) Parallelogram
Answer: C) Diamond


3. Which of the following is NOT a programming language?
A) Python
B) HTML
C) Java
D) SQL
Answer: B) HTML


4. In a relational database, what is the purpose of a primary key?
A) To uniquely identify a record in a table
B) To create relationships between tables
C) To sort data
D) To store images
Answer: A) To uniquely identify a record in a table


5. What does the acronym CPU stand for?
A) Central Processing Unit
B) Computer Personal Unit
C) Central Programming Unit
D) Control Processing Unit
Answer: A) Central Processing Unit


6. Which of the following data structures uses LIFO (Last In First Out) principle?
A) Queue
B) Stack
C) Array
D) Linked List
Answer: B) Stack


7. In HTML, which tag is used to create a hyperlink?
A) <link>
B) <href>
C) <a>
D) <hyperlink>
Answer: C) <a>


8. Which command is used to compile a C program?
A) run
B) execute
C) gcc
D) make
Answer: C) gcc


9. In a spreadsheet application, what function is used to calculate the average of a range of cells?
A) SUM()
B) AVG()
C) AVERAGE()
D) MEAN()
Answer: C) AVERAGE()


10. What does GUI stand for in computer terminology?
A) General User Interface
B) Graphical User Interface
C) Global User Interface
D) Graphical Utility Interface
Answer: B) Graphical User Interface


11. Which of the following is a characteristic of an object-oriented programming language?
A) Functions
B) Inheritance
C) Procedures
D) Assembly
Answer: B) Inheritance


12. In CSS, which property is used to change the text color of an element?
A) font-color
B) text-color
C) color
D) style
Answer: C) color


13. What is the main purpose of a firewall?
A) To speed up internet connection
B) To protect a network from unauthorized access
C) To enhance graphics performance
D) To manage database transactions
Answer: B) To protect a network from unauthorized access


14. Which of the following is an example of a non-volatile memory?
A) RAM
B) Cache
C) ROM
D) Register
Answer: C) ROM


15. In programming, what is a loop used for?
A) To perform calculations
B) To repeat a block of code
C) To define functions
D) To manage memory
Answer: B) To repeat a block of code


16. What is the result of the expression 5 + 2 * 3 in most programming languages?
A) 21
B) 11
C) 17
D) 15
Answer: B) 11


17. In Python, how do you create a comment?
A) // This is a comment
B) /* This is a comment */
C) # This is a comment
D) — This is a comment
Answer: C) # This is a comment


18. Which command in SQL is used to retrieve data from a database?
A) SELECT
B) GET
C) FETCH
D) RETRIEVE
Answer: A) SELECT


19. What is the default file extension for a Python file?
A) .java
B) .py
C) .html
D) .txt
Answer: B) .py


20. In computer networks, what does IP stand for?
A) Internet Protocol
B) Internal Process
C) Internet Program
D) Interface Protocol
Answer: A) Internet Protocol


21. Which of the following is an example of a primary key in a database?
A) Employee ID
B) Employee Name
C) Employee Address
D) Employee Phone Number
Answer: A) Employee ID


22. In programming, what does API stand for?
A) Application Programming Interface
B) Automated Programming Interface
C) Application Process Integration
D) Automated Process Interface
Answer: A) Application Programming Interface


23. Which HTML tag is used for the largest heading?
A) <h1>
B) <h6>
C) <title>
D) <header>
Answer: A) <h1>


24. What is the purpose of the return statement in a function?
A) To define the function
B) To stop the program
C) To send a value back to the caller
D) To execute the next statement
Answer: C) To send a value back to the caller


25. In CSS, which property is used to set the background color of an element?
A) background-color
B) color
C) bg-color
D) background
Answer: A) background-color


26. Which of the following best describes a “bit”?
A) A unit of data that can be 0 or 1
B) A unit of data that can be 0 to 255
C) A unit of data that represents a character
D) A unit of storage capacity
Answer: A) A unit of data that can be 0 or 1


27. What is the primary function of the operating system’s kernel?
A) To manage hardware
B) To provide user interfaces
C) To run applications
D) To manage files
Answer: A) To manage hardware


28. In SQL, which command is used to delete data from a table?
A) DELETE
B) REMOVE
C) DROP
D) TRUNCATE
Answer: A) DELETE


29. Which of the following is NOT a type of software?
A) Operating system
B) Compiler
C) Hardware
D) Application
Answer: C) Hardware


30. In Python, how do you define a function?
A) function myFunction():
B) def myFunction():
C) create myFunction():
D) func myFunction():
Answer: B) def myFunction():


31. Which of the following is an advantage of using a version control system?
A) It decreases collaboration
B) It tracks changes to code
C) It limits access to code
D) It simplifies the code structure
Answer: B) It tracks changes to code


32. In a spreadsheet, what symbol is used to denote a formula?
A) =
B) +
C) –
D) #
Answer: A) =


33. Which data structure is best suited for implementing a queue?
A) Array
B) Linked List
C) Stack
D) Tree
Answer: B) Linked List


34. In an if statement, what does the “else” clause do?
A) Executes if the condition is true
B) Executes if the condition is false
C) Always executes
D) Compiles the code
Answer: B) Executes if the condition is false


35. In the context of databases, what is normalization?
A) The process of ensuring data is structured properly
B) The process of indexing data
C) The process of deleting duplicate records
D) The process of storing data in multiple locations
Answer: A) The process of ensuring data is structured properly


36. Which of the following is a characteristic of a relational database?
A) Data is stored in a flat file
B) Data is organized into tables
C) Data is unstructured
D) Data is stored as documents
Answer: B) Data is organized into tables


37. In a computer network, what does LAN stand for?
A) Local Area Network
B) Large Area Network
C) Long Area Network
D) Local Access Network
Answer: A) Local Area Network


38. What does the term “debugging” refer to in programming?
A) Writing code
B) Testing for errors and fixing them
C) Compiling the code
D) Documenting the code
Answer: B) Testing for errors and fixing them


39. Which of the following is an example of a data type?
A) Variable
B) Function
C)

String
D) Class
Answer: C) String


40. In programming, what does the term “syntax” refer to?
A) The meaning of a statement
B) The structure of code
C) The execution speed
D) The variable types
Answer: B) The structure of code


41. In a flowchart, what shape represents the start or end of a process?
A) Rectangle
B) Oval
C) Diamond
D) Parallelogram
Answer: B) Oval


42. Which of the following is NOT a type of loop?
A) For loop
B) While loop
C) Repeat loop
D) Do-while loop
Answer: C) Repeat loop


43. What is the purpose of a constructor in object-oriented programming?
A) To initialize an object
B) To destroy an object
C) To compile the code
D) To define a class
Answer: A) To initialize an object


44. In CSS, which selector is used to select an element by its ID?
A) .id
B) #id
C) *id
D) id
Answer: B) #id


45. What type of database model uses a tree structure?
A) Hierarchical
B) Network
C) Relational
D) Object-oriented
Answer: A) Hierarchical


46. Which of the following is a valid variable name in most programming languages?
A) 1stVariable
B) my-variable
C) myVariable
D) my variable
Answer: C) myVariable


47. What does the term “API” allow developers to do?
A) Develop operating systems
B) Interact with other software applications
C) Create databases
D) Design user interfaces
Answer: B) Interact with other software applications


48. In SQL, which clause is used to filter results?
A) WHERE
B) SELECT
C) FROM
D) JOIN
Answer: A) WHERE


49. In a binary tree, what is the maximum number of children a node can have?
A) 1
B) 2
C) 3
D) Any number
Answer: B) 2


50. In HTML, which tag is used to create an unordered list?
A) <ol>
B) <ul>
C) <list>
D) <li>
Answer: B) <ul>

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Emmy is Sorry Bruh !!