Create a program in C++ language Create a LeaderEntry Header file.      In this file we will create LeaderEntry class:       public         LeaderEntry();         LeaderEntry(string playernameIn, int pointsIn, string datetimeIn);         ~LeaderEntry();        private               string playername;              int gamepoints;              string  dategame; The first step is to create a Header file and LeaderEntry class as defined above.        In main create a LeaderEntry object in your main. with sample data.         Retrieve the entry and then display it at the beginning of the game.         Now store LeaderEntry into a Vector and retrieve. Example    vector leaderboardtopten;    LeaderEntry *s1 = new LeaderEntry;      LeaderEntry *s1 = new LeaderEntry;      LeaderEntry *s1 = new LeaderEntry;     s1->gamepoints = 7000;     LeaderEntry *s2 = new Site;     s2->gamepoints = 9000;      leaderboardtopten.push_back(*s1);   //   leaderboardtopten.push_back(*s2);    ...   // Getting object out of Vector  vector::iterator it;     for (it = leaderboardtopten.begin(); it != leaderboardtopten.end(); ++it) {         cout << it->gamepoints;                            }            5.  Have the entry display at the front of the game i.e. Output Screen at this time.        6.  Add the remainder 9 sample Leader Entries into the game.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Create a program in C++ language

Create a LeaderEntry Header file.
     In this file we will create LeaderEntry class:
      public
        LeaderEntry();
        LeaderEntry(string playernameIn, int pointsIn, string datetimeIn);
        ~LeaderEntry();
       private 
             string playername;
             int gamepoints;
             string  dategame;

The first step is to create a Header file and LeaderEntry class as defined above.

  1.        In main create a LeaderEntry object in your main. with sample data. 
  2.        Retrieve the entry and then display it at the beginning of the game. 
  3.        Now store LeaderEntry into a Vector and retrieve.

Example

   vector<LeaderEntry> leaderboardtopten;   

LeaderEntry *s1 = new LeaderEntry;

     LeaderEntry *s1 = new LeaderEntry;

     LeaderEntry *s1 = new LeaderEntry;

    s1->gamepoints = 7000;

    LeaderEntry *s2 = new Site;

    s2->gamepoints = 9000;

     leaderboardtopten.push_back(*s1);

  //   leaderboardtopten.push_back(*s2);

   ...

  // Getting object out of Vector

 vector<LeaderEntry>::iterator it;

    for (it = leaderboardtopten.begin(); it != leaderboardtopten.end(); ++it) {

        cout << it->gamepoints;   
                        }

   
       5.  Have the entry display at the front of the game i.e. Output Screen at this time.
       6.  Add the remainder 9 sample Leader Entries into the game.  

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr