I need a code that works on a sample problem below. I am not a good java programmer and I'm trying to do it too but my solution might be incorrect. You may not use any external libraries to solve this problem, but you may use external libraries or tools for building or testing purposes.
Thank you for your help.
Our marketing department has just negotiated a deal with several local
merchants that will allow us to offer exclusive discounts on various
products to our top customers every day.
The catch is that we can only offer each product to one customer and we
may only offer one product to each customer.
Each day we will get the list of products that are eligible for these
We then have to decide which products to offer to which of our
Fortunately, our team of highly skilled statisticians has developed an
amazing mathematical model for determining how likely a given customer
is to buy a given product by calculating what we call the "suitability
The top-secret algorithm to calculate the "SS" between a customer and a
product is this:
1. If the number of letters in the product's name is even then the "SS" is
the number of vowels in the customer's name
multiplied by 1.5.
2. If the number of letters in the product's name is odd then the "SS" is
the number of consonants in the customer's name.
3. If the number of letters in the product's name shares any common
factors (besides 1) with the number of letters in the customer's name
then the "SS" is multiplied by 1.5.
Your task is to implement a program that assigns each customer a product
to be offered in a way that maximizes the combined total "SS" across all
of the chosen offers.
Note that there may be a different number of products and customers.
You may include code from external libraries as long as you cite the
Your program should accept as its first argument a path to a
filename. Each line in this file is one test case.
Each test case will contain a set of comma delimited customer names
followed by a semicolon and then a set of comma delimited product names,
iPad 2 - 4-pack,
Girl Scouts Thin Mints,
Theodore Donald Kerabatsos,