In this lab we will implement a very small part of a big problem without object oriented design. Hopefully, by the end of the lab you will see why we sometimes wrap some variables together and define a class/struct, and also, appreciate how classes could make the programmers' life easier.
As part of a grad school application, one should list their publications. For each publication, the applicant must provide
Without using classes or structs, you will be completing a piece of code that keeps a list of publications and allows the following commands:
The input is given in a file like commands.txt :
save_application "authors_list1" "title1" "conference1" 2016 "poster" save_application "authors_list3" "title3" "conference2" 2010 "oral" save_application "authors_list2" "title2" "journal1" 2015 "none" print sort print remove_application 1 print
The output for this file should be
"authors_list1" "title1" "conference1" 2016 "poster" "authors_list3" "title3" "conference2" 2010 "oral" "authors_list2" "title2" "journal1" 2015 "none" "authors_list3" "title3" "conference2" 2010 "oral" "authors_list2" "title2" "journal1" 2015 "none" "authors_list1" "title1" "conference1" 2016 "poster" "authors_list3" "title3" "conference2" 2010 "oral" "authors_list1" "title1" "conference1" 2016 "poster"
Download publication_management_no_class.cpp and complete it by filling in the save_application, remove_application, move, and print functions. You should declare your own global variables to keep the data. Remember you are not allowed to define a class or struct; you can only use arrays, vectors (preferred) , etc.
Upload the completed publication_management_no_class.cpp to lab3 activity in CMPT 225 on CourSys.
You can test your implementation by compiling and running the program on the given commands.txt and verify you get the output specified.
If you decided to use vectors, please note that the following functionality is available:
vectorv; v.push_back("hello!"); // will insert hello at the end of the vector v.erase(v.begin()+i); // will erase the item at position i in the vector sort(v.begin(), v.end()); // will sort the vector. you have to include <algorithm> for this though
Application is completed
An applicant should fill in an application form and provide details of their best courses as well as referees' contact information for future references.If they are applying for grad school, they should also provide a list of their publications.
Here you can see the information that they will provide in each part of their application:
in application form:
for each course in the selected courses:
for each referee in the list of referees:
for each application in the list of publications:
References are collected
After the application is submitted, the referees are contacted and will provide the following information:
Decisions are made
After the application deadline is passed and are applications are complete and references are collected, each application will be reviewed by 3 professors who will each give a score between 0 and 10 to the application.
Undergraduate applicants will be sorted based on the average of reviewers' scores and 100 of them will be admitted.
Graduate applicants will be admitted if and only if at least one of the reviewers have given them a score of 9 or more.