I need help with this button, I do not know!

Construct a button with the input, number, name, current and previous price of a series of 30 products and calculate the inflation rate for each product analyzed. The button must calculate and print in the body of the document: product name, algebraic difference and percentage, and average price of the 30 products.