UNIUYO COS121 Past Questions and Answers; meticulously compiled to supercharge your academic success
COS121 Past Question 1
Control structures in Visual Basic programming includes the following except (a) While loop (b) Do while loop (c) For each loop (d) None of above
Answer
(d) None of above
All the options listed (While loop, Do while loop, For each loop) are valid control structures in Visual Basic. Since all the options are correct, the answer is “None of above.”
COS121 Past Question 2
Which of these lines of code accept any key from the keyboard, and exits visual basic console Widow (a) console. ReadLine() (b) console. ReadNext() (c) console. Readkey() (d) console.read()
Answer
(c) console.ReadKey()
console.ReadKey() accepts any key from the keyboard and waits for a key press before continuing or closing the console window. It’s commonly used to pause the console so the user can see the output before the window closes.
COS121 Past Question 3
If K =2, i = 0, j = 8; what datatype will be the value of the code snippet: console.WriteLine((x <> y) AND (i<= j )). (a) Boolean (b) Float (c) Double (d) Integer (e) Error
Answer
(a) Boolean
The expression console.WriteLine((x <> y) AND (i <= j)) involves a logical comparison. Since the AND operator is used and it results in either True or False, the data type is Boolean.
COS121 Past Question 4
Which of these options is not a valid datatype in Visual Basic (a) Boolean (b) String (c) float (d) object
Answer
(c) float
In Visual Basic, the correct name for the floating-point data type is Single or Double, not float. Therefore, float is not a valid Visual Basic data type.
COS121 Past Question 5
- Given that num variable is 110, What will be the output of the if…then… else block?
If num <=100 then
Num =num*2;
Elseif num >110
Num= num *3;
Endif
(a) 110 (b) 220 (c) 330 (d) no output
Answer
(a) 110
Given that num = 110, the condition num <= 100 is false, so the program skips the first block. The next condition num > 110 is also false. Therefore, no change is made to num, and the output remains 110.
COS121 Past Question 6
In the Visual Basic application, which of the following are listed in a properties window? (a) Items (b) Values (c) Attributes (d) Objects (e) Files
Answer
(c) Attributes
The Properties window in Visual Basic lists attributes (properties) of the selected object, like text, color, size, etc. Items, Values, Objects, and Files are not specifically listed in the Properties window.
COS121 Past Question 7
Which of the following displays list of projects is contained in the Visual Basic current solution? (a)List Window (b) Project window (c) Catalogue window (d) Solution Explorer Window
Answer
(d) Solution Explorer Window
The Solution Explorer window displays all projects and files in the current Visual Basic solution. It’s used to navigate between different parts of a project.
COS121 Past Question 8
Which of the following instruction tells the computer to close the current form in Visual Basic? (a) This.Close() (b) Me.Close() (c) Close.this() (d) Close()
Answer
(b) Me.Close()
Me.close() is the correct syntax in Visual Basic to close the current form. Me refers to the current instance of the form.
COS121 Past Question 9
Which of the following is the default name assigned to the label control in Visual Basic? (a) Label (b) DefaultLabel (c) NewLabel (d) Labell
Answer
(a) Label
The default name assigned to a new label control in Visual Basic is “Label” followed by a number (e.g., Label1, Label2). The other options are not default names.
COS121 Past Question 10
Which of the following toolbox is used to include an image on the Visual Basic? (a) Add image box (b) Picture Box (c) Add picture Box (d) Image box
Answer
(b) Picture Box
The Picture Box control in Visual Basic is used to display images. Other options like Add image box and Image box are not actual Visual Basic controls.
COS121 Past Question 11
In visual basic language what are the rules of a programming language called? (a) Grammar (b) Order (c) Syntax (d) RulesA
Answer
(c) Syntax
In programming, the rules and structure of writing code are referred to as syntax. The other options do not specifically refer to the rules of a programming language.
COS121 Past Question 12
Which of the following is used to display a message box in visual basic? (a) MessageBox.Show (b) MessageBox.show (c) MessageBox (d) AlertBox.View
Answer
(b) MessageBox.show
Explanation: MessageBox.show (with correct capitalization) is the method used to display a message box in Visual Basic.
COS121 Past Question 13
In visual basic, which function is used to return a copy string without trailing space? (a) LTrim (b) RTrim (c) Trim (d) a and b
Answer
(b) RTrim
Explanation:RTrim removes trailing spaces from a string. LTrim removes leading spaces, and TRim removes both leading and trailing spaces.
COS121 Past Question 14
In Visual Basic, which of these will the value not change during program execution? (a) Const rest (b) dim rest As integer (c) dim rest As string (d) dim rest As char
Answer
(a) Const rest
Explanation: A constant (Const) is a variable whose value cannot change during the execution of a program, making option (a) correct.
COS121 Past Question 15
The graphical representation of step-by-step approach to problem solving is ——— (a) algorithm (b) pie chart (c) flowchart (d) process
Answer
(c) flowchart
Explanation: A flowchart is a graphical representation of a step-by-step approach to solving a problem, typically using various symbols.
COS121 Past Question 16
The decision symbol in a flow chart is defined using a___________ shape (a) square (b) rectangle (c) Diamond (d) Oval
Answer
(c) Diamond
Explanation: The decision symbol in a flowchart is represented by a diamond shape, which is used to denote a decision point.
COS121 Past Question 17
The condition is checked at the end of the loop is a characteristics of_______ (a) while loop (b) for loop (c) Do-while (d) None
Answer
(c) Do-while
Explanation: In a Do-while loop, the condition is checked at the end of the loop, which allows the loop to execute at least once.
COS121 Past Question 18
The primary decision-making capability in BASIC programming is provided by the ——– (a) IF – statement (b) FOR -statement (c) WHILE -statement (d) PRINT
Answer
(a) IF – statement
Explanation: The IF statement is the primary decision-making capability in Visual Basic, allowing the program to choose between different paths.
COS121 Past Question 19
What is the first step in the problem-solving process? (a) Identify the problem (b) Implement the solution (c) Evaluate the result (d) Choose a random approach
Answer
(a) Identify the problem: The first step in the problem-solving process is to clearly identify the problem. This step is crucial to finding an effective solution.
COS121 Past Question 20
What does brainstorming involve in the context of problem-solving? (a) Narrowing down ideas (b) Generating a variety of ideas (c) Selecting the best solution immediately (d) Ignoring creative input
Answer
(b) Generating a variety of ideas: Brainstorming involves generating a wide range of ideas without immediately evaluating them, allowing for creative and diverse solutions.
COS121 Past Question 21
What is a common obstacle to effective problem-solving? (a) Flexibility (b) Creativity (c) Lack of information (d) Open-mindedness
Answer
(c) Lack of information: A common obstacle to effective problem-solving is a lack of sufficient information, which can hinder the ability to make informed decisions.
COS121 Past Question 22
The most effective strategy in solving a problem is: (a) to follow the maxim: the shortest distance between two point is a straight line (b) to work backward from the goal (c) to form subgoal (d) dependent on the problem
Answer
(d) dependent on the problem: The most effective problem-solving strategy depends on the specific nature of the problem. Sometimes working backward, forming subgoals, or other strategies may be more appropriate.
COS121 Past Question 23
________ problem requires the identification of the best solution to a search problem from a given set of solution: (a) Search (b) counting (c) Undecidable (d) Optimization
Answer
(d) Optimization: An optimization problem involves finding the best solution from a set of possible solutions. This type of problem requires considering various factors to achieve the optimal outcome.
COS121 Past Question 24
Two common methods of representing an algorithm are___________ (a) Pseudocode and flowchart (b) Flowchart and model (c) Pseudocode and mathematical function (d) Mathematical function and flowchart
Answer
(a) Pseudocode and flowchart: Pseudocode and flowcharts are two common methods used to represent algorithms. Pseudocode uses structured language, while flowcharts use visual diagrams.
COS121 Past Question 25
One of these is not a characteristics of an algorithm (a) Finiteness (b) Logical (c) Effectiveness (d) Definiteness
Answer
(b) Logical: An algorithm must be logical, with clear, unambiguous steps. This ensures that the algorithm can be followed correctly to achieve the desired result.
COS121 Past Question 26
Which area of computing can heuristic algorithm be found? (a) Artificial Intelligence (b) Natural language processing (c) Big Data Analysis (d) All of these.
Answer
(d) All of these.: Heuristic algorithms, which are used to find approximate solutions to complex problems, can be found in various areas of computing, including Artificial Intelligence, Natural Language Processing, and Big Data Analysis.
COS121 Past Question 27
Two common methods of representing an algorithm are __________ (a) Pseudocode and Flowchart (b) Flowchart and model (c) Pseudocode and Mathematical Function (d) Mathematical Function and Flowchart
Answer
(a) Pseudocode and Flowchart: This is the same as question 24. Pseudocode and flowcharts are commonly used to represent algorithms.
COS121 Past Question 28
One of these is NOT a step in problem analysis (a) understanding the problem (b) Breaking the problem (c) Defining problem goal (d) Merging the problem
Answer
(d) Merging the problem: Merging the problem is not a step in problem analysis. Problem analysis typically involves understanding the problem, breaking it down, and defining the problem’s goal.
COS121 Past Question 29
Problem solving tools can be any of the following EXCEPT (a) Linear programming (b) Queueing systems (c) Simulation (d) Alpha beta
Answer
(d) Alpha beta: Alpha-beta pruning is a search algorithm used in artificial intelligence, particularly in game theory. It is not typically considered a general problem-solving tool like linear programming, queuing systems, or simulation.
COS121 Past Question 30
________is the process the computer takes to convert a high-level programming language (a) Coding (b) Compilation (c) Programming (d) Documentation
Answer
(b) Compilation: Compilation is the process by which a computer converts a high-level programming language into machine code that the computer can execute.
COS121 Past Question 31
One of these is NOT a valid variable name in BASIC programming (a) bassey, (b) ba_ssey (c) 2bassey, (d) base3y.
Answer
(c) 2bassey: In BASIC programming, variable names cannot start with a number. Therefore, “2bassey” is not a valid variable name.
COS121 Past Question 32
One of these is NOT a BASIC programming keywords (predefined functions) (a) COS (b) DATA (c) NEXT (d) SCH
Answer
(d) SCH: “SCH” is not a predefined keyword in BASIC programming, whereas COS, DATA, and NEXT are.
COS121 Past Question 33
Which of these operations has the highest hierarchy of operations? (a) Division (b) Parenthesis (c) Subtraction (d) Addition
Answer
(b) Parenthesis: Parentheses have the highest precedence in the hierarchy of operations, ensuring that expressions within parentheses are evaluated first.
COS121 Past Question 34
Which of these is NOT a core concept in computing (a) Process (b) Input (c) Document (d) Output
Answer
(c) Document: Document is not considered a core concept in computing. Core concepts typically include processes like Input, Processing, and Output.
COS121 Past Question 35
_______ uses the structure of formal programming languages and mathematics to break the algorithm into one -sentence steps. (a) Flowchart (b) Pseudocodes (c) Compiler (d) Interpreter.
Answer
(b) Pseudocodes: Pseudocode uses the structure of formal programming languages and mathematics to break down algorithms into one-sentence steps, making it a useful tool for planning and designing algorithms.
Enhance Your Learning with Practice Quizzes
You’ve done an excellent job studying past questions and answers—this is a crucial step in preparing for any exam. Now, it’s time to take your learning to the next level by practicing with quizzes. Quizzes provide an interactive way to reinforce what you’ve learned, helping to solidify your knowledge and improve your recall.
By testing yourself with quizzes, you can identify areas where you need more practice, boost your confidence, and ensure you’re fully prepared for the real exam. So, after reviewing the past questions, challenge yourself with a quiz. It’s not just about knowing the answers—it’s about mastering the material.
Take the time to practice, and you’ll be better equipped to tackle any question that comes your way on exam day.