Homework 4

Due: October 8th, 2021 12:00pm


Scenario

As of today, there is a small problem just outside the Codémon Academy. It seems a group of protestors has amassed outside the gates to protest the practice of keeping Codémon as pets, or something. Recently, members of Team Picket have been disguising themselves as students to try to break into the school, and cause shenanigans. The school has asked you to develop a security system to keep these intruders out. Here is what you must do:

Define a struct Entrant. Objects of the type entrant will be the different people that try to enter the school. Entrants are to have 5 members:

All of this information will be input by the user. Your program will create an array of 5 possible entrants at a time, and determine whether or not any of them are secretly Team Picket spies trying to infiltrate the school. There are 2 ways to tell if any of the possible entrants are spies:

You will also need to develop a printEntrant function that will display the data of the entrant in a readable manner. You must also use multiple files for your program. That is, a main.cpp file, a header.cpp file, and a header.h file. All of your functions must be properly documented as well.

Program Flow

Notes

Example Ouput

Note: //Note: The following program output asks for the name, age, occupation, and numberOfCodemon for each entrant at the same time. Feel free to ask for all of these values individually, ask for first and last name and get the rest of the data separately, take all 5 entrant values at once, etc. Just make sure that you have the user input these values in the same order as is shown in the example output here. I.e. entrant 1 first name, entrant 1 last name, entrant 1 age, entrant 1 occupation, entrant 1 numberOfCodemon, entrant 2 first name, entrant 2 last name, etc. Taking more than 1 input from the user can make range checking more difficult, so if you find yourself stumped, I recommend taking in 1 variable from the user at a time.

---Now booting up Codémon Academy security system---

Please input name, age, occupation, and the number of Codémon for entrant 1:

Glenallen Mixon 14 Student 5

Please input name, age, occupation, and the number of Codémon for entrant 2:

Bobson Dugnutt 41 Student 1

Please input name, age, occupation, and the number of Codémon for entrant 3:

Tim Sandaele 11 Faculty 6

Please input name, age, occupation, and the number of Codémon for entrant 4:

Mike Truk 38 Staff 11

Please input name, age, occupation, and the number of Codémon for entrant 5:

Rey McSriff 29 Student 0

The following entrants have been denied entry due to suspicions of Team Picket affiliations:

Name: Bobson Dugnutt
Age: 41
Occupation: Student
Number of Codémon: 1

Name: Mike Truk
Age: 38
Occupation: Staff
Number of Codémon: 11

Are there more people waiting to enter the academy?

Y

Please input name, age, occupation, and the number of Codémon for entrant 1:

Darryl Archideld 26 Staff 4

Please input name, age, occupation, and the number of Codémon for entrant 2:

Dwigt Rortugal 8 Student 3

Please input name, age, occupation, and the number of Codémon for entrant 3:

Shown Furcotte 91 Faculty 6

Please input name, age, occupation, and the number of Codémon for entrant 4:

Willie Dustice 2 Faculty 0

Please input name, age, occupation, and the number of Codémon for entrant 5:

Tony Smehrik 15 Student 5

None of the entrants were suspected of spycraft, all were allowed to enter”

Are there more people waiting to enter the academy?

N

Goodbye.

Sample Input

If you want to test some input to try and get the same results as the example above, you can run your code and copy/paste this into the command line:

Glenallen Mixon 14 Student 5 Bobson Dugnutt 41 Student 1 Tim Sandaele 11 Faculty 6 Mike Truk 38 Staff 11 Rey McSriff 29 Student 0 Y Darryl Archideld 26 Staff 4 Dwigt Rortugal 8 Student 3 Shown Furcotte 91 Faculty 6 Willie Dustice 2 Faculty 0 Tony Smehrik 15 Student 5 N