daily pastebin goal
3%
SHARE
TWEET

Untitled

a guest Mar 13th, 2018 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. struct Team
  6. {
  7.   string name;
  8.   int wins;
  9.   int losses;
  10. };
  11.  
  12. double win_percentage (string , double , double );
  13. void wins_losses (string , double , double , double );
  14. void winning_teams (string , double , double , double );
  15.  
  16. int main() {
  17.   Team school1 = {"Bethune-Cookman", 11, 3};
  18.   Team school2 = {"Coppin State", 5, 9};
  19.   Team school3 = {"Delaware State", 1, 13};
  20.   Team school4 = {"Florida A&M", 6, 8};
  21.   Team school5 = {"Hampton", 11, 4};
  22.   Team school6 = {"Howard", 6, 8};
  23.   Team school7 = {"Maryland Eastern Shore", 2, 12};
  24.   Team school8 = {"Morgan State", 6, 8};
  25.   Team school9 = {"North Carolina A&T", 10, 4};
  26.   Team school10 = {"North Carolina Central", 8, 6};
  27.   Team school11 = {"Norfolk State", 10, 4};
  28.   Team school12 = {"Savannah State", 10, 4};
  29.   Team school13 = {"South Carolina State", 6, 8};
  30.  
  31.  
  32.  
  33.  
  34.   cout<< "MEAC MENS BASKETBALL TEAMS CONFERENCE STANDINGS"<< endl;
  35.  
  36.   cout<< school1.name<<" "<<school1.wins<<"-"<<school1.losses<< endl;
  37.   cout<< school2.name<<" "<<school2.wins<<"-"<<school2.losses<< endl;
  38.   cout<< school3.name<<" "<<school3.wins<<"-"<<school3.losses<< endl;
  39.   cout<< school4.name<<" "<<school4.wins<<"-"<<school4.losses<< endl;
  40.   cout<< school5.name<<" "<<school5.wins<<"-"<<school5.losses<< endl;
  41.   cout<< school6.name<<" "<<school6.wins<<"-"<<school6.losses<< endl;
  42.   cout<< school7.name<<" "<<school7.wins<<"-"<<school7.losses<< endl;
  43.   cout<< school8.name<<" "<<school8.wins<<"-"<<school8.losses<< endl;
  44.   cout<< school9.name<<" "<<school9.wins<<"-"<<school9.losses<< endl;
  45.   cout<< school10.name<<" "<<school10.wins<<"-"<<school10.losses<< endl;
  46.   cout<< school11.name<<" "<<school11.wins<<"-"<<school11.losses<< endl;
  47.   cout<< school12.name<<" "<<school12.wins<<"-"<<school12.losses<< endl;
  48.   cout<< school13.name<<" "<<school13.wins<<"-"<<school13.losses<< endl;
  49.  
  50.  
  51.  
  52.  
  53.   cout<<"TEAMS WINNING PERCENTAGE"<<endl;
  54.   win_percentage(school1.name,school1.wins,school1.losses);
  55.   win_percentage(school2.name,school2.wins,school2.losses);
  56.   win_percentage(school3.name,school3.wins,school3.losses);
  57.   win_percentage(school4.name,school4.wins,school4.losses);
  58.   win_percentage(school5.name,school5.wins,school5.losses);
  59.   win_percentage(school6.name,school6.wins,school6.losses);
  60.   win_percentage(school7.name,school7.wins,school7.losses);
  61.   win_percentage(school8.name,school8.wins,school8.losses);
  62.   win_percentage(school9.name,school9.wins,school9.losses);
  63.   win_percentage(school10.name,school10.wins,school10.losses);
  64.   win_percentage(school11.name,school11.wins,school11.losses);
  65.   win_percentage(school12.name,school12.wins,school12.losses);
  66.   win_percentage(school13.name,school13.wins,school13.losses);
  67.   cout<<"TEAMS WITH WINNING RECORDS"<<endl;
  68.  
  69.   wins_losses(school1.name,school1.wins,school1.losses, win_percentage);
  70.   wins_losses(school2.name,school2.wins,school2.losses,win_percentage);
  71.   wins_losses(school3.name,school3.wins,school3.losses,win_percentage);
  72.   wins_losses(school4.name,school4.wins,school4.losses,win_percentage);
  73.   wins_losses(school5.name,school5.wins,school5.losses,win_percentage);
  74.   wins_losses(school6.name,school6.wins,school6.losses,win_percentage);
  75.   wins_losses(school7.name,school7.wins,school7.losses,win_percentage);
  76.   wins_losses(school8.name,school8.wins,school8.losses,win_percentage);
  77.   wins_losses(school9.name,school9.wins,school9.losses,win_percentage);
  78.   wins_losses(school10.name,school10.wins,school10.losses,win_percentage);
  79.   wins_losses(school11.name,school11.wins,school11.losses,win_percentage);
  80.   wins_losses(school12.name,school12.wins,school12.losses,win_percentage);
  81.   wins_losses(school13.name,school13.wins,school13.losses,win_percentage);
  82.  
  83.   winning_teams(school1.name,school1.wins,school1.losses,win_percentage);
  84.   winning_teams(school2.name,school2.wins,school2.losses,win_percentage);
  85.   winning_teams(school3.name,school3.wins,school3.losses,win_percentage);
  86.   winning_teams(school4.name,school4.wins,school4.losses,win_percentage);
  87.   winning_teams(school5.name,school5.wins,school5.losses,win_percentage);
  88.   winning_teams(school6.name,school6.wins,school6.losses,win_percentage);
  89.   winning_teams(school7.name,school7.wins,school7.losses,win_percentage);
  90.   winning_teams(school8.name,school8.wins,school8.losses,win_percentage);
  91.   winning_teams(school9.name,school9.wins,school9.losses,win_percentage);
  92.   winning_teams(school10.name,school10.wins,school10.losses,win_percentage);
  93.   winning_teams(school11.name,school11.wins,school11.losses,win_percentage);
  94.   winning_teams(school12.name,school12.wins,school12.losses,win_percentage);
  95.   winning_teams(school13.name,school13.wins,school13.losses,win_percentage);
  96.  
  97.   return 0;
  98. }
  99.  
  100. double win_percentage(string a, double b, double c){
  101.   double x;
  102.   x == b / (b + c);
  103.   cout<< a<<" "<<x<<endl;
  104.  
  105. }
  106. void wins_losses( string e, double f, double g, double h){
  107.  
  108.    cout<< e<< "Record is"<<f<<"-"<<g<< h<<endl;
  109. }
  110. void winning_teams(string w, int f, int y, double z){
  111.   if ( z >.500){
  112.     cout<< w<<" "<<f<< "-"<<y<< " "<< z<< endl;
  113.  
  114.   }
  115. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top