akosiraff

Download CheeseCake

Apr 11th, 2016
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1.  
  2. Download: http://solutionzip.com/downloads/cheesecake/
  3. This assignment is quite simple in what needs to be done but could turn out to be one of the more complicated programming projects that you will have this term. This assignment will involve storing information in a dynamically allocated array, sorting information and then looking at the data and analyzing the data in the form of a summary.
  4. You are to read in a file that contain several records of data, each record will contain: The Last Name of the person taking the survey, First Name of the person taking the survey, and a character “C” or Character “P” that indicates whether a person believes that Cheese cake is a cake “C” or is really a pie “P” .
  5. There are an unknown number of records.
  6. Programming Specifications:
  7. Here are the lists of tasks and specifications.
  8. 1. Ask the user for the name of the input file. You must make sure it is a valid file and that it can be opened. If not, you need to continually ask the user for a valid file.
  9. 2. Open the file and read the contents only counting the number of records in the file.
  10. 3. Close file.
  11. 4. Dynamically allocate an array to store the data make sure that you only allocate enough storage to hold exactly the number of records needed.
  12. 5. Open the file and read the file into the array.
  13. 6. Sort the Array on Last Name in ascending order.
  14. 7. Print out the information (to standard output) using the example at the end of this document.
  15. 8. Print out at the end of the summary of information (i.e. how many people said that Cheesecake is a Cake and how many said it was a Pie).
  16. 9. Also print out the number of participants. Be sure that the number of people who said Cheesecake is a Cake + Cheesecake is Pie is equal to the total number participants.
  17. COP3010 Programming I in C/C++
  18. COP3014 Page 2
  19. Design Considerations:
  20. 1. You will use this C/C++ struct to define your data structure.
  21. struct Roster {
  22. string LName;
  23. string FName;
  24. char Cheesecake;
  25. }
  26. struct Roster * MyRoster;
  27. 2. You must determine how many records are in the file before you allocate the array to hold the data.
  28. 3. You must have the minimum functions to perform the following operations:
  29. o Get a valid file name that holds the data
  30. o Read the data into the array passing the array as a parameter
  31. o Sort the data
  32. o Find the number of people who said Cheesecake is a Pie passing the array as a parameter and returning the number as a return value of the function.
  33. o Find the number of people who said Cheesecake is a Cake passing the array as a parameter and returning the number as a return value of the function.
  34. o Sorting the Array passing the array as a parameter by reference.
  35. o Printing the report passing the array as a const value.
  36. 4.
  37. General Requirements:
  38. 1. No global variables, other than constants and type definitions!
  39. 2. Use the const qualifier on member functions wherever it is appropriate.
  40. 3. Your main routine should just mainly handle the calling of functions and basic program structure.
  41. 4. You will need to use the library for output. You may use the library for formatting your output if you wish.
  42. 5. When you write source code, it should be readable and well-documented.
  43. 6. You must have prototypes for all of your functions.
  44. 7. You may use any sorting technique you wish but the simplest (exchange or bubble sort) is all that is required.
  45. 8. The size of the array must match exactly the number of records in the file. No more no less.
  46. Grading Criteria:
  47. 1. The program compiles. If the program does not compile no further grading can be accomplished. Programs that do not compile will receive a zero.
  48. 2. (25 Points) The program executes without exception and produces output. The grading of the
  49. Download: http://solutionzip.com/downloads/cheesecake/
Add Comment
Please, Sign In to add comment