Description

An instructor for a class decided to clean his/her office and noticed that he/she lost the students assignments (I guess the instructor forgot to record the grades earlier in the semester). Luckily the instructor found a pile of the graded assignments but looks like a few students' assignments are lost and somehow some of them are duplicated. The instructor wants to determine how many submissions was lost for each student by simply tallying up each assignment for each student without counting any duplicates. Each student has turned in 9 assignments so far thus if any student tally amount is below 9 then the instructor lost at least one assignment for that student.

The instructor wants this task done quickly since he/she is often busy, thus a hash map will be used to tally up each assignment for each student (without counting duplicates) since a brute force search would take quite some time especially if there are a lot of assignments and/or a lot of students in the class.

Input

You will be given two files, one that has all the students' names and the other with a set of assignments, each assignment will contain the following string studentName_A# where # will be a number from 1-9

Output

Output the amount of missing assignments for each student

Contents of main

You will prompt for a names file and store all the students names into a vector of string objects. You then will read in a file with the assignment submissions, and determine if this file has already been tallied, if it has not been then tally into the amount of assignments tallied for a student. This will require a few unordered_map objects (I will not tell you what the key and value types will be, you'll need to figure that out)

Specifications

  • Comment your code and your functions
  • You must use the unordered_map to find student names or assignments
  • You can traverse through elements in a list but all searches must use a hash, no linear or binary searches can be used

Sample Run

$ g++ Assignment06.cpp
$ ./a.out

Enter students file: Students.txt
Enter students file: students.txt
Enter students file: Names.txt

Enter assignments file: Programs.txt
Enter assignments file: Assignments.txt

NAME MISSING ASSIGNMENTS
Ora 0
Wyatan 5
Aubrey 7
Delinda 8
Ruttger 8
Blanche 0
Ford 7
Doretta 5
Lu 1
Annamaria 8
Ida 7
Andie 0
Rosina 7
Chantalle 8
Hilary 4
Glyn 6
Pacorro 1
Matthew 8
Kassi 0
Jilly 5
Bentlee 4
Jolie 5
Lorena 8
Tasia 8
Sebastien 8
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.