Select Page

Anne Arundel Community College C Constructs Programming Practice

Question Description

I’m working on a c++ discussion question and need a reference to help me learn.

Coding Assignment 6 Rubric – 2208

Coding Assignment 6 Rubric – 2208

Criteria Ratings Pts

This criterion is linked to a Learning OutcomeFormattingProgram is properly formatted – both alignment and indention. Student’s name and id are at the top of every file containing code and the file containing main() is named Code6_xxxxxxxxxx.c where xxxxxxxxxx is the student’s 10 digit student id.

10 pts

Pass

0 pts

Fail

10 pts

This criterion is linked to a Learning OutcomeCoding Requirement – GameLib.cStartGame() takes 3 parameters – an empty array for chosen phrase, a File Handle and an array of phrases. It returns the index of the chosen phrase. StartGame() calls ReadFileIntoArray() which returns the number of records in the array. StartGame() should use that value to display the menu of phrase choices. The #include for PhraseBank.txt should be removed.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – GameLib.hGameLib.h should contain the typedef structure of the information being read from the file. The structure must contain at least 3 char pointers and at least one member that has a known size that does not change. The variable names should sufficiently describe the data they are holding. GameLib.h contains a define called MAX_ENTRIES is used to create the array of structures used to hold the information read from the file.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – FileLib.c – Open the FileFileLib.c sould contain a function to open a file. Function should take 3 parameters – argc, argv and mode. This function should open the filename found in argv[1] if possible or keep prompting for a filename until able to open the file. The while condition should be properly formed – no arbitrary values or using break/continue/return/exit. If the while condition is not properly formed, fail this rubric criterion. Function should return the file handle once the file has successfully opened.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – FileLib.c – Read File Into ArrayThis function should read the file and store the contents in the array of structures. The array of structures and the file handle should be passed into this function. It will return the number of records that were read from the file. File reading process should be able to skip blank lines using continue. Functions strtok(), malloc() and strcpy() should be used to create the array of structures given the input from the file. At least one member of the struct should be statically allocated and malloc() should not be used for it.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – FileLib.c – Write out new fileThis function should write out a new version of the file. The array, the index that was returned by StartGame() and the file handle should be passed in. After correctly guessing and winning, the entry that was used should be removed from the file so that the next game does not include that entry the player has already guessed. All dynamically allocated memory should be free’d and the file should be closed. Functions fseek() and ftell() must be used to exactly blank out the last record – writing an arbitrary large number of blanks/spaces will cause the rubric criterion to fail. All non NULL array elements should be written except for the winning phrase (which should be skipped).

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – FileLib.hFileLib.h should contain the prototypes for the 3 functions defined in FileLib.c and a proper include guard.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – mainAn array of structures of size MAX_ENTRIES is created. The function to open the file is called and returns a file handle (FILE *). Function StartGame() with an empty Phrase and the file handle and the array. It returns the index of the chosen entry from the array. The rest of main() should continue to work like it did in Coding Assignment 5. If the player wins the game, the new version of the file is written using the input file name.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeCoding Requirement – MiscellaneousNo global variables are allowed. Functions should only take parameters as described in the assignment and should only return values as described in the assignment. Any while conditions in the program should be properly formed – no arbitrary values/value added solely to control the loop or using break/continue/return/exit.

5 pts

Pass

0 pts

Fail

5 pts

This criterion is linked to a Learning OutcomeExecution 1Welcome message should be appropriate to new game. The game play should match the information in the student’s provided PhraseBank.txt. One of the members of the student’s struct should be the phrase to be guessed while the other members are using to make the menu of play choices.

10 pts

Pass

0 pts

Fail

10 pts

This criterion is linked to a Learning OutcomeExecution 2Run the program with no command line parameters – program should prompt for a filename. Run the program with a file name on the command line parameter – program should use it and not prompt for a filename. Run the program with an invalid filename – program should state that the file could not be opened and should prompt for a new file name. Run the program with no command line parameters – program should prompt for a filename – given a bad file name – program should prompt for a file name until a valid one is entered.

10 pts

Pass

0 pts

Fail

10 pts

This criterion is linked to a Learning OutcomeExecution 3Increase the size of the student’s submitted PhraseBank.txt by copying all records and pasting them at the end of the file (double the size of the file). Run program with this longer/larger file and verify that the program does not overflow its array by reading more records than it should from the file.

10 pts

Pass

0 pts

Fail

10 pts

This criterion is linked to a Learning OutcomeExecution 4Play the game and win. Verify that the newly written out file no longer contains the winning entry and that the newly written out file can then be used to play the game again without that entry. Menu on second run should renumbered to not include that entry.

10 pts

Pass

0 pts

Fail

10 pts

This criterion is linked to a Learning OutcomeExecution 5Alter PhraseBank.txt so that the file element/struct member that is being guessed contains a dash. Verify that the game stops and exits when the dash is found.

10 pts

Pass

0 pts

Fail

10 pts

This criterion is linked to a Learning OutcomeGTA InstructionsCompile the student’s Code6_xxxxxxxxxx.c and other.c files using the student’s makefile on OMEGA. Perform all rubric criterion and pass/fail each one as needed. If code compiles with warnings/errors, fail all rubric points which will assign a grade of 0. Do not check any of the rubric criterion. Paste a copy of the compiler error/warning into the grader’s notes for this criterion.

Assign a grade of 0 to assignment if any of the following coding constructs were used in the program – global variables, goto, continue, break (except in a switch) and return used inside any loop.

0 pts

Fail

0 pts

Pass

0 pts

This criterion is linked to a Learning OutcomeBonusAdvanced command line parameter handling was added. Run the program using just the program’s name. Program should print an error message that includes the name of the command line parameters and how to run the program. Run program using those instructions. Mark this rubric criterion as passed if the command line parameters work as described in the error message.

0 pts

Full Marks

0 pts

No Marks

0 pts

Total Points: 100

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now