annagraphicart 0 Light Poster

I'm almost finished with this program.
All i need to do is fix up the points system.

Right now I have it where it numbers everything, which i'm using as the points system.

take a look

#include <iostream> 
#include <string> 
#include <istream>
#include <fstream>

using namespace std; 

int main()
{
      const int MAX=4;    
      std::string names1[20] = 
{"Anderson, Scott",
"Batista, Peter",
"Bland, Michael",
"Bolton, Elise",
"Brown, Jenny",
"Carcagente, Michelle",
"Caro, Jonathan",
"Dodson, Matt",
"Esbrandt, Cody",
"Galganski, Erik",
"Garcia, Eddiedelso",
"Harris, Pauline",
"Ihrig, Jon",
"Macina, Samm",
"Nelson, Austin",
"Rambo, Kenny",
"Seymour, Amy",
"Sprague, Nicole",
"Tuckfield, Matt",
"Valenti, Chris"
};   
      int score[20];
      string names2[20] = 
{"Burgos, Vanessa",
"Coleman, Morgan",
"Connor-Siefried, Wade",
"Cummins, Joey",
"Davis, Stephen",
"Garcia, Alberto",
"Girata, Andrew",
"Gopaul, Jeremy",
"Greenspan, Max",
"Kramer, Sara",
"Lauseng, Justin",
"Mandell, Justin",
"Manzo, Billy",
"Ramos, Roberto",
"Sather, Rachel",
"Sessions, Shawn",
"Smith, Christy",
"Sutphin, Kaidee",
"Wright, Julie",
"Zotti, Steve"
};
      int score2[20];
      double date=0.0;
      double game=0.0;
      
      cout << "JUNIOR GOLD BOWLING LEAGUE" << endl;
      cout << endl << endl;
      cout << "DATE: ";
      cin >> date;
      cout << "GAME: ";
      cin >> game;
      cout << endl << "ENTER SCORES FOR DIVISION 1" << endl << endl;
      
      for(int i = 0; i < 20; i++) 
      {   
            cout << names1[i] << ": ";     
            cin >> score[i];     
            cin.ignore(); 
            }
      cout << endl;      
      cout << "ENTER SCORES FOR DIVISION 2" << endl << endl;
      
      for(int i = 0; i < 20; i++) 
      {   
            cout << names2[i] << ": ";     
            cin >> score2[i];     
            cin.ignore(); 
            }
            system("cls");
            
              //sort by score (div 1)  
              for ( int i = 0; i < 20; i++ ) 	
              { score[i];   
                    for ( int j = 0; j < 20; j++ )     
                    {       
                            if( score[i] > score[j] )       
                            {          
                                       string tmp_string;          
                                       int temp;           
                                       temp = score[i];            
                                       tmp_string = names1[i];           
                                       score[i] = score[j];           
                                       names1[i] = names1[j];           
                                       score[j] = temp;          
                                       names1[j] = tmp_string;
                            }    
                    }   
              } 
              //sort by score (div2)  
              for ( int i = 0; i < 20; i++ ) 	
              { score2[i];   
                    for ( int j = 0; j < 20; j++ )     
                    {       
                            if( score2[i] > score2[j] )       
                            {          
                                       string tmp_string;          
                                       int temp;           
                                       temp = score2[i];            
                                       tmp_string = names2[i];           
                                       score2[i] = score2[j];           
                                       names2[i] = names2[j];           
                                       score2[j] = temp;          
                                       names2[j] = tmp_string;
                            }    
                    }   
              }
               
           
              //output
              cout << "JUNIOR GOLD BOWLING LEAGUE" << endl << endl;
              cout << "Date: " << date << "   Game #: " << game;
              cout << endl << endl;
              cout << "DIVISION 1" << endl <<endl;
              int points1 = 20;

              for ( int k = 0; k < 20; k++ )   
              {
                      cout << names1[k] << ": " << score[k] << " (" << points1 << " POINTS)" <<endl;
                      points1 = points1 - 1;
       
                      }
              cout << endl << endl;   
              cout << "DIVISION 2" << endl << endl;
              int points2 = 20;

              for ( int k = 0; k < 20; k++ )   
              {
                       
                      cout <<names2[k] << ": " << score2[k] << " (" << points2 << " POINTS)" <<endl;
                      points2 = points2 - 1;
       
             }
            
    system("pause");
    return 0;
    
}

See the points thing?
Well... if the score is "0"... I need it to put the points as "0".

Can ya'll help me with that?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.