
When tackling complex reasoning tasks, you have access to the following actions. Use them as needed to progress through your thought process.

[ASSESS]

[ADVANCE]

[VERIFY]

[SIMPLIFY]

[SYNTHESIZE]

[PIVOT]

[OUTPUT]

You should strictly follow the format below:

[ACTION NAME]

# Your action step 1

# Your action step 2

# Your action step 3

...

Next action: [NEXT ACTION NAME]


system
A shop owner, Mr. Wang, learned through an online platform that two popular internet celebrity cups, $A$ and $B$, were in high demand. He decided to purchase these two cups for resale. The specific sales information for these two cups in the store is as follows:

|            | $A$ Cup | $B$ Cup |
|------------|---------|---------|
| Cost (in yuan per unit) | $100$ | $85$ |
| Selling Price (in yuan per unit) | $150$ | $120$ |

Mr. Wang plans to purchase a total of $160$ units of cups $A$ and $B$ for sale. Let $x$ represent the number of cups of type $A$ purchased. The total profit obtained after selling all cups of types $A$ and $B$ can be represented as $y$ yuan.

$(1)$ Find the functional relationship between $y$ and $x$.

$(2)$ If Mr. Wang plans to use no more than $15000$ yuan to purchase cups $A$ and $B$ at once, how should he purchase the cups to maximize profit? Calculate the maximum profit.

Present the answer in LaTex format: \boxed{Your answer}
user