The Nobel peace prize. The process of selecting the winners for the various prices have been criticized as being biased especially from the side of the panel members. The committee of experts at a general council meeting decided to automate the selection process. On a trial bases, you have been engaged to develop a system that will automatically select a nominee as the winner of the award in two categories (peace and science). Your program should have the following functionalities.
a) Define a class named NobelAward. Your class must have two
functions, one of the functions should be named AwardCategory, and the
other function should be named AwardWinner. Your AwardCategory
must have a string argument and return the string when called. Your
AwardWinner function must contain two parameters, one should be a string called name and the other an integer called votes. When called (AwardWinner) it should return the name and highest votes as the winner for a particular category.
1
Expert's answer
2021-08-23T13:40:51-0400
class NobelAward{
string AwardCategory(string s){
return s;
}
void AwardWinner(string s, int n) {
cout << s << ' ' << n;
}
};
Comments
Leave a comment