Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The language is C++ Problem Statement Professor Oak has been discovering more new Pokemon than he knows what to do with lately. He has hired

The language is C++

Problem Statement

Professor Oak has been discovering more new Pokemon than he knows what to do with lately. He has hired you to create a Pokemon catalog program that will make gathering new Pokemon data and searching through it easier. To simplify your task, the Professor has provided you with their current Pokemon information. These come in the form of a text file that contains a list of the currently discovered Pokemon and their abilities, all of the information that your program will display.

Requirements

Command Line Argument:

When starting the program, the user will provide one command line argument. The command line argument will be the name of the file that contains the information about Pokemon. If the user does not provide the name of an existing file the program should print out an error message and quit.

Searching and Printing:

Once the program begins, the user should be prompted with a list of different ways to display the Pokedex information. After the user has chosen an option, they should be asked if they want the information printed to the screen or written to a file. If they choose to write to a file, they should be prompted for a file name. If the file name already exists, the information should be appended to the file. If the file name does not exist, a file should be created and the information should be written to the file.

Available Options:

  • Search by dex number: If the user picks this option the program must search through the available Pokemon for one that matches a user entered number. Once found, it should print/write to file that Pokemon's data. If there is no matching Pokemon, the program must print an error message and give them all of the options again.
  • Search by name: If the user picks this option the program must search through the available Pokemon for one that matches a user entered name. Once found, it should print/write to file that Pokemon's data. If there is no matching Pokemon, the program must print an error message and give them all of the options again.
  • Search by type: If the user picks this option the program must search through the available Pokemon for ones that match a user entered type. Once found, it should print/write to file all of the Pokemon that have that type. If there is no Pokemon with the requested type, the program must print an error message and give them all of the options again.
  • Add new Pokemon: If the user picks this option, the program must prompt the user to enter each of the fields for a new Pokemon. The size of the Pokedex will need to dynamically increase to store the new data.
  • Quit: The program will exit.

Your program should continue searching and printing/writing until the user chooses to quit.

Required Classes:

The following classes are required in your program. They will help organize the information that will be read in (or derived) from the files. You cannot modify, add, or take away any part of the class.

The Pokedex class will be used to hold information from the dex.txt file. This class holds information about the Pokedex.

class Pokedex { string trainer; int num_pokemon; Pokemon* dex; };

The Pokemon class will also be used to read in information from the dex.txt file. This class holds information about a Pokemon.

class Pokemon{ int dex_num; string name; string type; string abilities[4]; };
 

Required Input File Format

Your program must accommodate the file formats as specified in this section.

The dex.txt file will have the following pattern:

                     

etc...

7 1 Bulbasaur Grass Vine_Whip Razor_Leaf Solarbeam Growl 4 Charmander Fire Scratch Ember Flamethrower Rage 7 Squirtle Water Bubble Bite Tackle Aqua_Tail 25 Pikachu Electric Thundershock Quick_Attack Swift Electro_Ball 37 Vulpix Fire Flame_Burst Confuse_Ray Fire_Spin Payback 54 Psyduck Water Soak Confusion Zen_Headbutt Water_Sport 133 Eevee Normal

Helping_Hand Sand_Attack Take_Down Last_Resort

(Thank you!)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

Students also viewed these Databases questions