An accurate prediction of bugs in software projects can help in improving software projects' quality. A simple majority voting (SMV) ensemble is an effective technique for bug prediction. SMV combines the results of base classifiers (BCs) based on the majority voting of class. All the stand-alone BCs do not perform equally well, yet all the BCs in SMV are given equal weights. Therefore, in order to improve the performance of SMV, BCs should be assigned different weights. Therefore, here, we propose a novel reward-based weighted majority voting (WMV) ensemble technique to build a bug prediction model. In WMV, the performance of each classifier in the ensemble is evaluated; then, a reward-based mechanism is used to calculate the weights of each classifier. When a BC predicts the correct class of an instance, then a reward is provided, but no punishment is given for wrong prediction. A BC will get higher weight in an ensemble that predicts more instances correctly. Naive Bayes, support vector machine, K-nearest neighbor, random forest, and C5.0 heterogeneous algorithms are used as BCs in the WMV ensemble. WMV outperforms aforesaid BCs, SMV, and also majority of state-of-the-art techniques published recently in terms of accuracy, F-measure, and Matthew's correlation coefficient.