Assignment 1.1 Specifications
Assignment 1.1 Specifications
Due Date: Friday 30th September 2022 @ 11:55pm (Fiji Standard Time)
Submission: This assignment is to be done in pairs (group of two students). Submit the entire
project folder as a zip file via the Moodle Assignment 1 Drop box.
Weight: 10%
1 Problem Statement
Due to the recent Covid-19 outbreak in Pacific, you have been hired as programmer by your local
government to help them with vaccination reports and analysis. The authorities has vaccination
data, vaccination registration data for individuals and the vaccination administrative data for
individuals in the system. They would like to make a program that would analyze that data to get
meaningful insights which would allow the Health Ministry to reach out to the people for
vaccination, vaccination drives, reports, and vaccination certificates for travels.
1. citizens.txt – this file contains the personal details of all users. The file has 7 columns.
• c_id – citizen id is a unique identifier for an individual which identifies a citizen.
• fname – first name of the citizen.
• lname – last name of the citizen.
• gender – gender of the citizen.
• age – age of the user.
• phone – phone contact of the user.
• address – village they belong to.
• pre_con – pre health condition
2. vaccination.txt – this file contains the personal details of all users. The file has 7
columns.
• c_id – citizen id is a unique identifier for an individual which identifies a citizen.
• num_vac – this represents the number of vaccines shot the citizen is given. 1 means only
first shot, 2 means both vaccines and 3 means both vaccines with booster shot.
• V1_code – a unique identifier for vaccines for first shot/dose which is vaccine_code
in vaccine.txt.
• V1_date – timestamp in days for simplicity. This means if you have 16005789 for vaccine
one short and 16005820 for second vaccine then difference between two vaccine in days
is 16005820 – 16005789.
• V2_code – a unique identifier for vaccines for second shot/dose which is
vaccine_code in vaccine.txt. If second shot is not given, then the value is 0 for
V2_code.
• V2_date – timestamp in days for simplicity. This means if you have 16005789 for vaccine
one short and 16005820 for second vaccine then difference between two vaccine in days
is 16005820 – 16005789. If second shot is not given, then the value is 0000000 for
V2_date.
• B_code – a unique identifier for vaccines for Booster shot/dose which is vaccine_code
in vaccine.txt. If second shot is not given, then the value is 0 for B_code.
3. vaccine.txt – this file contains the personal details of all users. The file has 7 columns.
• vaccine_code – a unique identifier for different available vaccines.
• vaccine_name – name of the vaccine.
o Pfizer – given to children below 5 years and age greater than 60 years.
o Moderna – given to children above 5 years and age less than 17 years.
o AstraZeneca – given to citizen older than 18 years and less than 59 years.
• vaccine_minspace – this is in days. This shows the minimum number of days citizen
has to wait after getting respective vaccine after which second shot can be given.
3 Constraints
• The problem must be solved using Structures and Arrays.
• The program must work with any number of lines in the files, up to 1000. You can create
the arrays with a maximum capacity of 1000 to store the file contents.
• Do not edit the input files. The file has arbitrary number of empty lines at the end. This is
done intentionally.
• The files citizens.txt, vaccination.txt and vaccine.txt must be placed
along with your main.cpp file. That is, in the same location. The files must also be named
as citizens.txt, vaccination.txt and vaccine.txt respectively, in small
caps in your source code. Do not rename the files to any other name.
4 Requirements
This problem must be solved using structures and arrays. Create the struct for each file. In the
driver program, read the files into the respective arrays. The analysis should happen through
these arrays.
Your program should do the following:
• Read the data file and store details in Struct.
Create a menu for the user that can do the following:
1. Exit the program - the program must exit when the user enters 1.
2. Print the citizens – this function should print all citizens from citizen.txt file.
Sample Output:
4. Print vaccination data – this function should print all citizen’s vaccination record.
(Hint: you have to use data from all three files) : Display Citizen ID | Full Name |
Number of Vaccines | Vaccination 1 Name | Vaccination 1 Timestamp |
Vaccination 2 Name | Vaccination 2 Timestamp | Booster Name | Booster
Timestamp | Vaccination Status (Read on different status under 4.1 specification).
You can print blanks for the Vaccination 2 Name and Date, and Booster Name and Date for
CS112 ASSIGNMENT 1 – Semester 2 2022 Page 4 of 11
partial and fully vaccinated cases. Finally print Total vaccinated (at least partial
vaccinated as shown in the sample output), percentage of each status for example: Partial
Vaccinated: 60%, Fully Vaccinated: 30%, and Fully Vaccinated with Booster:
10%. Sample output.
Explanation:
C ID is citizen ID , #Vac is number of vaccines given to the citizen. Full name comes from Citizen
data mapping user using C ID. V1, V2 and Booster name are names for the vaccines given to the
citizen. The name comes from Vaccine data mapping the vaccine code. The instance the citizen
are partial vaccinated or with 2 shots then vaccination name date dates are blanks for missing
ones. Total Vaccinated is number of citizen with at least 1 shot and percentage of total vaccinated
is percentage of citizen with at least 1 shot. Partial vaccinated percentage is percentage of
vaccinated citizen with 1 shot, Fully vaccinated percentage is percentage of vaccinated citizen
with 2 shots and Fully vaccinated with booster is percentage is percentage of vaccinated citizen
with 3 shots.
5. Search citizen using the Citizen ID - When Ministry of Health needs to give
vaccination certificate for an individual citizen, this function should allow the program user
to search and print the details of the citizen’s vaccination record. Display the Citizen ID,
Full Name, Gender, Age, Phone, Address, Number of Vaccines,
Vaccination 1 Name, Vaccination 1 Timestamp, Vaccination 2 Name,
Vaccination 2 Timestamp, Booster Name, Booster Timestamp, Vaccination
Status.
• Except the first menu, all others should be implemented using functions of the main program.
• All inputs must be validated. The program must be able to handle and respond accordingly to
any input provided by the user, such as characters or letters instead of numbers.
Your program must conform to the standards of C++ programming. The expectations from this
assignment are:
• Proper comments and indentation
• Proper variable and function names
• Correct use of functions, struct and arrays
• Correct program functionality and respective output
• Proper data representation
6. Print Recommendation – based on the citizen’s vaccination records this function should
display the recommendation/comments which includes: Citizen ID | Full Name |
Number of Vaccines | Vaccination Status | Recommendation (Read on different
recommendation under 5.1 specification).
5.1 Specification
Based on the vaccination record of an individual the recommendation is given for the individual. This
recommendation is based on age and number of days after second shot was given. Only work on the
following scenarios and recommendation as shown below:
6 Submission Guidelines
1. Go to the location where your project is saved.
2. Zip the entire project folder. Do not zip or submit the individual file/files such as main.cpp
or any executable file. You must zip the entire folder.
3. Rename the zipped file with the student IDs of both the group members. Example:
sXXXXXXXX_sXXXXXXXX.zip. X’s represents the ID numbers of the student ID.
4. After renaming, submit the single zipped file in the Assignment 1 Dropbox on Moodle.
5. After submitting, download your submission on your computer, unzip and open with
Microsoft Visual Studio to ensure it opens successfully and you’re able to compile and run
it.
All submission must be made through the correct dropbox. Do not submit any assignment via
email. Late assignments will not be accepted. Please note there will be no due date extension
until prior approval has been taken.
Plagiarism
Any kind of plagiarism or cheating like submission of work that is not your own will lead to a ZERO
(0) score AND you will be subject to disciplinary action. Discussing is permitted however you must
avoid giving your working copy or the final assignment file to anyone. This increases the risk of
your assignment being cited as a plagiarized work.
ALL plagiarized assignments will receive a mark of ZERO and will be referred to the Disciplinary
Committee.
Assignment Clarification
It is expected that students will seek clarifications regarding this assignment. For any such
clarification, you may post a message on Moodle Discussion Forums under the Assignment 1
Discussions Topic only. Any message relating to the Assignment placed under a different topic
WILL NOT be looked at or answered.
At the same time, please note that you are not allowed to share/discuss your Assignment on
these forums. Students must refrain from placing their assignments on the discussion forum.
Students found doing this will be referred to the Disciplinary Committee and will also be awarded
a mark of ZERO.
CBOK Beyond expectation [0% - Meet expectation [50% - 75%] Below Satisfactory [76% - 100%] Score
49%]
Programming All satisfactory and I. Able to write a simple code for a well- I. Code has compile/run/logic 20
demonstrate very good defined problem errors.
programming skills. II. Use of basic standard programming Poorly written code.
practices such as commenting, II. Plagiarism
indentation etc. III. Poor indentation, hard to read
III. computer program produces correct and follow the code
output IV. Lots of bugs and/or errors
V. Program produces unexpected
output
VI. In appropriate use of variables
and parameters.
VII. No input validation
VIII. Hard coding of data in the
program.
IX. Program is not well structured.
Function 2: Print Function declaration, Function declaration with partial Only function declaration. Rubric: I 10
the Citizens implementation and call. Function implementation. Rubric: I - III - IX
displays correct output. Rubric: I
Function 3: Print Function declaration, Function declaration with partial Only function declaration. Rubric: I 10
Vaccines implementation and call. Function implementation. Rubric: I - III - IX
displays correct output. Rubric: I
Function 4: Print Function declaration, Function declaration with partial Only function declaration. Rubric: I 30
Vaccination data implementation and call. Function implementation. Rubric: I - III - IX
displays correct output. Rubric: I
Function 5: Function declaration, Function declaration with partial Only function declaration. Rubric: I 30
Search citizen implementation and call. Function implementation. Rubric: I - III - IX
using the Citizen displays correct output. Rubric: I
ID
Bonus (2%) – marked separately
Function 6: Print Function declaration, Function declaration with partial Only function declaration. Rubric: I 20
Recommendation implementation and call. Function implementation. Rubric: I - III - IX
displays correct output. Rubric: I