Skip to main content

Visual Programming MCQs with Answers

Practice important Visual Programming MCQs with answers and explanations.

Chapter: 2
Q21:
What does the condition if (f.good() && a != f.peek()) check in the code example?
A. If the file is writable and the next character is not 'a'.
B. If the file exists and the next character is different from 'a'.
C. If the file is empty and 'a' equals the next character.
D. If the file is not open and 'a' is less than the next character.
Correct Answer: B
Chapter: 2
Q22:
How is an "event" defined in the context of event-driven programming?
A. A scheduled task in the operating system.
B. An occurrence within a system or domain and its corresponding detection in the computer world.
C. A type of data structure used for storing information.
D. A programming language construct.
Correct Answer: B
Chapter: 2
Q23:
Which of the following best describes an event-object?
A. A programming language used for event-driven programming.
B. An object that represents an event, containing details about the event type.
C. A type of sensor used to detect events.
D. A function that handles events.
Correct Answer: B
Chapter: 2
Q24:
In the coffee shop analogy, what represents synchronous behavior?
A. Processing orders independently without waiting.
B. Completing an order before starting the next one.
C. Taking multiple orders simultaneously.
D. Ignoring new orders until a timer expires.
Correct Answer: B
Chapter: 2
Q25:
Which of the following is an example of an asynchronous operation?
A. Completing one operation before starting another.
B. Starting an operation and immediately starting another without waiting.
C. Waiting for a single event before proceeding.
D. Processing events in a strict sequence.
Correct Answer: B
Chapter: 2
Q26:
What is a key characteristic of synchronous operations?
A. They can be completed in any order.
B. They do not block other operations.
C. They are completed before the next operation can be started.
D. They allow multiple operations to run parallelly.
Correct Answer: C
Chapter: 2
Q27:
What is a key characteristic of asynchronous operations?
A. They block other operations until completion.
B. They must be completed before starting another operation.
C. They allow the program to perform other tasks before completion.
D. They are always event-driven.
Correct Answer: C
Chapter: 2
Q28:
What are the advantages of event-driven applications mentioned in the lecture?
A. Easier to scale, suited to visual programming, direct mapping to real world.
B. More efficient memory usage, easier to debug, less code.
C. Increased parallelism, automatic error handling, built-in security.
D. Faster execution, better performance, simpler logic.
Correct Answer: A
Chapter: 2
Q29:
Which of the following is NOT a type of event in non-real-time applications as mentioned in the lecture?
A. Mouse and keyboard events.
B. File events.
C. Network events.
D. Real-time sensor events.
Correct Answer: D
Chapter: 2
Q30:
What is the difference between deterministic and approximate mapping in event processing systems?
A. Deterministic mapping means exact mapping to real-world events; approximate means the system provides a close but not exact representation.
B. Deterministic mapping refers to mapping data structures; approximate refers to mapping algorithms.
C. Deterministic mapping is used in synchronous operations; approximate in asynchronous.
D. Deterministic mapping uses exact numbers; approximate uses floating-point numbers.
Correct Answer: A
Chapter: 2
Q31:
Which of the following operations is NOT a common event processing operation?
A. Reading events.
B. Creating events.
C. Transforming events.
D. Compiling events.
Correct Answer: D
Chapter: 2
Q32:
In the context of event-driven programming, what does "polling for events" mean?
A. Using events to control the program flow.
B. Actively checking for events in a loop.
C. Responding to events as they occur.
D. Ignoring events until a certain condition is met.
Correct Answer: B
Chapter: 2
Q33:
What is a drawback of not using event-driven programming, as mentioned in the lecture?
A. The application becomes more scalable.
B. Waiting for a single event is a blocking operation.
C. The application becomes less deterministic.
D. It allows for better real-world mapping.
Correct Answer: B
Chapter: 2
Q34:
In the flower delivery system example, what happens when a store receives a flower delivery order?
A. The order is processed immediately without notifying anyone.
B. A request is broadcast to relevant drivers within a certain distance.
C. The flowers are delivered by the store's staff.
D. The system automatically assigns the nearest driver.
Correct Answer: B
Chapter: 2
Q35:
In the flower delivery system, how is the driver ranked?
A. Based on the number of flowers they can carry.
B. Based on their ability to deliver flowers on time.
C. Based on customer ratings.
D. Based on their experience with the store.
Correct Answer: B
Chapter: 2
Q36:
What does a store's profile include in the flower delivery system?
A. The types of flowers they sell.
B. The maximum number of deliveries per day.
C. Constraints on driver rankings and driver assignment preferences.
D. The delivery routes.
Correct Answer: C
Chapter: 2
Q37:
What defines a "permanently weak driver" in the flower delivery system example?
A. A driver who always accepts deliveries but is slow.
B. A driver with fewer than five assignments on all active days.
C. A driver with consistently low customer ratings.
D. A driver who refuses assignments from certain stores.
Correct Answer: B
Chapter: 2
Q38:
What characterizes an "idle driver" in the flower delivery system?
A. A driver who has no assignments at all.
B. A driver who has at least one day of activity with no assignments.
C. A driver who is on vacation.
D. A driver who has low performance ratings.
Correct Answer: B
Chapter: 2
Q39:
How is a "consistently weak driver" defined in the flower delivery system?
A. A driver with fewer assignments than average every day.
B. A driver whose assignments are at least two standard deviations lower than the daily average.
C. A driver who frequently misses assignments.
D. A driver who takes too long to accept assignments.
Correct Answer: B
Chapter: 2
Q40:
What defines a "consistently strong driver" in the flower delivery system?
A. A driver with higher than average customer satisfaction.
B. A driver with daily assignments at least two standard deviations above the daily average.
C. A driver who never misses a delivery.
D. A driver with the most assignments overall.
Correct Answer: B

Test Your Knowledge

Take a timed quiz on Visual Programming

🚀 Start Quiz Now