100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
COS2614 Assignment 5 2024 $5.81   Add to cart

Other

COS2614 Assignment 5 2024

 269 views  21 purchases
  • Course
  • Institution

Solutions Manual for Assignment 5 2024. Get 90+

Preview 3 out of 27  pages

  • October 13, 2024
  • 27
  • 2024/2025
  • Other
  • Unknown
avatar-seller
Question 1

Not yet answered

Marked out of 1.00

Flag question

Question text

In the Observer pattern, what is the role of the subject?

a.

To listen for changes in the observer.

b.

To maintain a list of observers and notify them when its state changes.

c.

To execute the update method of the observer directly.

d.

To control access to its state by preventing any changes.

Question 2

Not yet answered

Marked out of 1.00

Flag question

Question text

What does the `execute()` method of a ConcreteCommand typically do?

a.

It creates a new instance of Receiver.

b.

It directly calls the `do()` method of the Receiver.

c.

It adds a command to a stack or queue.

d.

It initializes a priority system for commands.

Question 3

,Not yet answered

Marked out of 1.00

Flag question

Question text

How does adding children in QObject differ from the classic Composite pattern?

a.

Children are automatically added through the `setParent()` function without the need for a dedicated
`addChild()` function.

b.

Children are added manually using an `addChild()` function as in the classic pattern.

c.

Children must be added in the constructor of the QObject.

d.

Children are added using a factory method in QObject.

Question 4

Not yet answered

Marked out of 1.00

Flag question

Question text

In what scenario would you use the Monostate pattern?

a.

When you need multiple instances with different states.

b.

When you need to restrict the number of instances created to one.

c.

When various parts of a program need to refer to the same state through different objects.

d.

When you want to delay object construction until it is explicitly needed.

Question 5

, Not yet answered

Marked out of 1.00

Flag question

Question text

What problem does the Command pattern solve?

a.

It provides a way to manage memory.

b.

It decouples a client from knowing when or how to execute a member function.

c.

It ensures multiple commands are executed simultaneously.

d.

It restricts the number of member functions a class can have.

Question 6

Not yet answered

Marked out of 1.00

Flag question

Question text

Which class would you use to allow users to choose from a set of colors?

a.

QInputDialog

b.

QColorDialog

c.

QFontDialog

d.

QMessageBox

Question 7

Not yet answered

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller princesszibani. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $5.81. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

85443 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$5.81  21x  sold
  • (0)
  Add to cart