Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Super Hero Information Program For this assignment, write a Ct+ program on the PCC Linux system that keeps track of a set of superheroes. Instead

image text in transcribed
Super Hero Information Program For this assignment, write a Ct+ program on the PCC Linux system that keeps track of a set of superheroes. Instead of saving superhero information to a file like project 1, this time you will load your superhero information into memory so they can be listed and searched. When the program starts, your program will ask the user to enter the name of an input file, which your program will open to load the hero information. The super hero information will be loaded into memory using an array of structs. The struct definition is listed below in a textbox. The input text file will use the same comma separated value format as project 1. You may only open the text file once, by calling load Heroes0 at the beginning of program execution. Do not open the file in any other function other than loadHeroes (see below). After the data from the file is loaded, the program will enter a user-controlled loop. Inside of the loop, the program will as e user what they want to do. In addition to searching and listing, the user will have the option to add another uperhero to the database, but only to memory; do not add the new super hero information to the text file or this project. So, the options that the user can select are: struct herointo Search for a superhero by name char heroNaneISTR SIZE1: char rea Nane [STR SIZE1: char powers [STR SIZE] double firstAppear; char creators [STR SIZE: char publisher [STR size1: List all of the superheroes. Add a new superhero to the memory database. Quit There are 4 functions that you will be required to write for this project in addition to main: loadHeroes ), addAHero 0 searchHeroes (), and 1istHeroes(). Call LoadHeroes when the program starts. Call the other functions inside of the user-controlled loop. See below for example output and function prototypes Remember from project 1 that the file format contains all of the information for one superhero on one line. There's an example file along with this document in the D2L assignments folder that contains the following superheroes in this format speed and Previous Experience.I966.0.Lee and Kacbx Besxe shifting and ealing. 2013.08,ana na t Whacker N:1sen anat naeMa Sstength, webs electric shock and sense 21, Bendsn This file is also available from my Linux home directory. Use the cp command: gp /home/inst/robert martin4/superHeroes.txt The dot at the end will place the file in your current directory Example Program Execution Output (User Input in Bold) Example 1 Welcome to the ssperhero ntormatian progran notAF i ie.txt as cot tound. Try again or type qust.20:53.;t:tet.togram, quit Termina progran Example 2 Super Hero Information Program For this assignment, write a Ct+ program on the PCC Linux system that keeps track of a set of superheroes. Instead of saving superhero information to a file like project 1, this time you will load your superhero information into memory so they can be listed and searched. When the program starts, your program will ask the user to enter the name of an input file, which your program will open to load the hero information. The super hero information will be loaded into memory using an array of structs. The struct definition is listed below in a textbox. The input text file will use the same comma separated value format as project 1. You may only open the text file once, by calling load Heroes0 at the beginning of program execution. Do not open the file in any other function other than loadHeroes (see below). After the data from the file is loaded, the program will enter a user-controlled loop. Inside of the loop, the program will as e user what they want to do. In addition to searching and listing, the user will have the option to add another uperhero to the database, but only to memory; do not add the new super hero information to the text file or this project. So, the options that the user can select are: struct herointo Search for a superhero by name char heroNaneISTR SIZE1: char rea Nane [STR SIZE1: char powers [STR SIZE] double firstAppear; char creators [STR SIZE: char publisher [STR size1: List all of the superheroes. Add a new superhero to the memory database. Quit There are 4 functions that you will be required to write for this project in addition to main: loadHeroes ), addAHero 0 searchHeroes (), and 1istHeroes(). Call LoadHeroes when the program starts. Call the other functions inside of the user-controlled loop. See below for example output and function prototypes Remember from project 1 that the file format contains all of the information for one superhero on one line. There's an example file along with this document in the D2L assignments folder that contains the following superheroes in this format speed and Previous Experience.I966.0.Lee and Kacbx Besxe shifting and ealing. 2013.08,ana na t Whacker N:1sen anat naeMa Sstength, webs electric shock and sense 21, Bendsn This file is also available from my Linux home directory. Use the cp command: gp /home/inst/robert martin4/superHeroes.txt The dot at the end will place the file in your current directory Example Program Execution Output (User Input in Bold) Example 1 Welcome to the ssperhero ntormatian progran notAF i ie.txt as cot tound. Try again or type qust.20:53.;t:tet.togram, quit Termina progran Example 2

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions