Using a form with formulas via many languages can achieve these results. My concern is with the mention of a shopping cart. Assuming your lack of knowledge of code I would recommend just creating options or attributes for the product to be added to the cart and set the prices accordingly. Especially since you only have four materials. I would highly doubt that you will find premade code for such a request that you could merely copy and paste.
It's not looking good for finding a premade script that I could just insert into my site. I see you have listed a few books to read, thank you. I will take a look and see if it is something I could try. I thought I might be able to find a program that maybe a company like a rug distributor might use, but no luck.
Thanks for your help.