Any contractor or subcontractor who shall purchase materials on credit and represent at the time of purchase that they are to be used in a designated building or other improvement and shall thereafter use, or cause to be used, the materials in the construction of any building or improvement other than that designated without the written consent of the person from whom the materials were purchased with intent to defraud that person shall be guilty of a violation if the materials were valued at one thousand dollars ($1,000) or more and upon conviction shall be punished by a fine not exceeding two thousand five hundred dollars ($2,500).