Hello programmers,

I need someone to give me just hint of how to design an algorithm to the following problem:

Suppose you have three types of fax machine:
1. Super fax with the features: colored, high quality and double sided.

2. Colored fax with the features: colored and high quality but not double sided.

3. Old fax with the features: non-colored, low quality and double sided.

Requests come to central server to allocate appropriate fax depend on the type:
if the request have features: colored and high quality but not double sided. This request can be handled by Super fax or Colored fax.

The question here is:
I solve the request properties as Boolean fields. The question is How can I decide which available fax machine can handle my request?

I don't need the code itself, I just need the idea.

I solve the request properties as Boolean fields. The question is How can I decide which available fax machine can handle my request?

One way you might approach this problem is to start with a list of fax machines and go through it, removing machines that don't support the request. After that, the only machines left in the list are ones that support the request--you'd still have to decide what to do if you ended up with zero or more than one machine in the list.

Also, you'll want to rank features somehow to indicate fax machine support... for example, a B/W fax doesn't support a color request, but a color fax does support a B/W request. This is simple enough for your current problem, but probably needs a more formal solution if you get into multiple-choice options, e.g., fax machines that support one of 150/300/600/1200 DPI.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.