C++ programing
PROGRAM 4 - Magical Creature Zoo
NAME:
Earned Points
Possible Points
Detailed Description
5 Compiling / Syntax Errors
Compiles with no errors – 5 points Does not compile – 0 points
85 Specifications
10 Source/Header Files: (10 points) • Main function is in its own source file (Prog5.cpp) • Programmer-defined functions in separate file (functions.cpp) • #include headers, structure definitions and function
prototypes are all in header file (Prog5.h)
5 Creatures Text File (5 points) • Submitted a text file with information on 10 creatures • All data is separated by a pound sign.
5 Structures (5 points)
• Cost Structure
• Creatures structure
10 Main Function (10 points) • Creation of Creatures array (100 elements) • Shows main menu / correct choices • Runs until user chooses option 5 • Validate user choice • Function call statements • saveCreaturesToFile if user wants to after choosing option 5
15 enterCreatures Function (15 points) • Check if current # of creatures is less than 100, error
message if equal to 100. • Menu of two choices • Validate user’s choice
CHOICE 1 • Ask user for filename • Open file as input • Check file for errors • Read from file using getline, while loop (eof) and increment
num creatures. • Close file • Confirmation message
CHOICE 2 • Ask user for each piece of data in specified/neat way • Read data from standard input • Place data in Creatures array in correct element. • Choice 2 happens as many times as user wants it to • Confirmation message
Earned Points
Possible Points
Detailed Description
10 deleteCreature Function (10 points) • List each creature’s name • Ask user which one they want to delete • Send the name of the one to delete to mAE(), returning a
bool if it was removed. • If removed, decrement num creatures • Confirmation message if it was removed or not.
5 moveArrayElements Function (5 points)
• Use for loop to see if string sent in matches any in the array. • If found, for loop to move array elements & return true • If not found, return false
15 printCreatures Function (15 points)
• Menu of two options • Validate user’s choice CHOICE 1 • Print each creature to the screen • Neat/uses stream manipulators • BONUS (5 points) does word wrapping for description CHOICE 2 • Ask user for filename • Open file as output file • Print each creature to the file • Neat/uses stream manipulators • Close file • Confirmation message
5 printStatistics Function (5 points)
• Cost of each creature per week is printed out with for loop • Total cost of all creatures is printed out
5 saveCreaturesToFile Function (5 points)
• Filename is acquired from user • File is opened as output file • Use for loop to print out creatures to file with # between each
piece of data • File is closed • Confirmation message
10 Readability of
Code
Sufficient comments in code & naming of variables Includes comment block at top containing title of program, date, author, and purpose of program. Code is indented properly.
(only subtracts
from grade)
Delivery Program received by email before midnight - Wednesday April 23rd. DATE/TIME Delivered:
100 TOTAL (FINAL) GRADE