This article considers a Cost-of-Quality (CoQ) optimization problem that finds an optimal allocation of prevention and inspection resources to minimize the expected total quality costs under a prevention-appraisal-failure framework, where the quality costs in the proposed model are involved with prevention, inspection, and correction of internal and external failures. Commencing with a simple structure of the problem, the complexity of the problem is progressively increased by accommodating realistic scenarios regarding preventive, appraisal, and corrective actions. The resulting problem is formulated as a zero-one polynomial program, which can be solved either directly using a mixed-integer nonlinear programming solver such as BARON or using a more conventional Mixed-Integer Linear Programming (MILP) solver such as CPLEX after performing an appropriate linearization step. Two case studies from the literature (related to a lamp manufacturing context and an order entry process) are examined to illustrate how the proposed model can be utilized to find optimal inspection and prevention strategies, as well as to analyze sensitivity with respect to different cost parameters. A comparative numerical study of using the aforementioned solvers to optimize the respective model formulations is provided. The results provide insights into the use of such quantitative methods for optimizing the CoQ and indicate the efficacy of using the linearized MILP model for this purpose.