Library Publication Storage and Retrieval Application
V0.9(Milestone 4 - draft)
When Books and other publications arrive in a library, they should be tagged and put on shelves, so they are easily retrievable to be lent out to those who need it.
Your task is to design an application that receives the publications and stores them into the system with the information needed for their retrieval.
Later, each publication can be lent out to members of the library with a due date for return.
Before we start developing the application, we need to have few classes developed to help us with the dates in the system and also the user interface of the application.
CITATION AND SOURCES
When submitting the milestone deliverables, a file called sources.txt must be present. This file will be submitted with your work automatically.
You are to write either of the following statements in the file "sources.txt":
I have done all the coding by myself and only copied the code that my professor provided to complete my workshops and assignments.
Then add your name and your student number as signature OR:
Write exactly which part of the code of the workshops or the assignment are given to you as help and who gave it to you or which source you received it from.
You need to mention the workshop name or assignment name and also the file name and the parts in which you received the code for help.
Finally add your name and student number as signature.
By doing this you will only lose the mark for the parts you got help for, and the person helping you will be clear of any wrong doing.
PROJECT DEVELOPMENT NOTES
When developing the classes in this project, note that you may add additional member variables, member functions to any class if you find them necessary or
Make sure these additional variables and functions are well documented.
An extra empty module is provided with the project in case you would like to add any helper functions of your own or additional classed to add to your
This module has two files: Utils.h and Utils.cpp.
Utils.h will be included an all the tester files and Utills.cpp will be added to the compile line of all submissions.
You may reuse and copy any code your professor provided for your workshops or functions you may have from previous work in this subject or other subjects and place it in the Utils
If you choose not to reuse any of your code, just leave these file empty but have them present when submitting your
OVERVIEW OF THE CLASSES TO BE DEVELOPED FOR MILESTONE 1
All the code developed in this project should be under the namespace sdds;
A class the encapsulates year, and month and day values for Date stamp, comparison and Date IO purposes.
A class that hold a text Item; (an option or title to be displayed) in a menu to be selected by the user. This is a fully private class that is only accessible by Menu (see next class)
A class that has several MenuItems to be displayed so the user can select one of them for an action to be executed in the program
THE DATE CLASS
The Date class was partially implemented by another program that left the company and your responsibly is to reuse the parts she developed to complete the implementation:
The date class incapsulates the following values:
Year; an integer between the year 1500 till today
Month, an integer between 1 and 12
Day, an integer between 1 and the number of days in the
Error code; an integer which holds the code that corresponds to an error that recently happened or ZERO if the date object is valid and ready to be
Current year; an integer that is automatically initialized to the current date of the system for validation purposes when a Date object is
The Date module in files Date.h and Date.cpp is well documented and is placed in the project directory.
Study it and learn what each constant, variable and member function does and then using those function and your knowledge of iosteam, cin an cout add the following member functions to the Date class:
std::istream& read(std::istream& is = std::cin);
This function reads a date from console in following format YYYY/MM/DD as follows:
Clear the error code by setting it NO_ERROR
Read the year, the month and the day member variables using istream and ignore a single character after the year and the month values to bypass the Slashes
Note that the separators do not have to be Slash characters “/” but any separator that is not an integer number.
Check and see if istream has failed. If it did fail, set the error code to CIN_FAILED and clear the
If not, validate the values entered.
Flush the keyboard
Return the istream object
std::ostream& write(std::ostream& os = std::cout)const;
If the Date object is in a “bad” state or (it is invalid) print the “dateStatus()”.
otherwise the function should write the date in the following format using the ostream object:
Prints the year
Prints a Slash “/”
Prints the month in two spaces, padding the left digit with zero, if the month is a single digit number
Prints a Slash “/”
Prints the day in two spaces, padding the left digit with zero, if the day is a single digit number
Makes sure the padding is set back to spaces from zero
Returns the ostream
Operator overloads: (do not use friend)
Overload the following comparison operators to compare two dates.
Use the return value of the daysSince0001_1_1 member function to compare two dates:
bool operator== bool operator!= bool operator>= bool operator<= bool operator< bool operator>
Use the return value of the daysSince0001_1_1 member function to overload the
to return the difference in number of days between two dates. Example:
D1(2019, 12, 02),
D2(2019, 11, 11);
int days = D1 - D2;
“days: in the above code snippet will hold the value 21.
Bool cast overload:
Overload the Boolean cast so if a date is casted to bool, it will return true if the date is valid and false if it is not.
Helper operator overloads:
Overload the following helper operator overloads to have the Date class compatible with cin and cout, input and output operations:
operator<< (for cout) operator>> (for cin)
DATE FUNCTIONS THAT ARE ALREADY IMPLEMENTED:
int daysSince0001_1_1()const; // returns number of days passed since the date 0001/1/1 bool validate(); /* validates the date setting the error code and then
returning the result that is true, if valid, and false if invalid. */
void errCode(int theErrorCode); // sets the error code
int systemYear()const; // returns the current system year bool bad()const; // return true if
int mdays()const; // returns the number of days in current month void setToToday(); // sets the date to the current date (system date)
Public Functions and constructors:
Date(); // creates a date with current date Date(int year, int mon, int day); /* creates a date with assigned values
then validates the date and sets the error code accordingly */
int errCode()const; // returns the error code or zero if date is valid
const char* dateStatus()const; /* returns a string corresponding to the current status
of the date */
int currentYear()const; // returns the m_CUR_YEAR value;
DescriptionIn this final assignment, the students will demonstrate their ability to apply two majorconstructs of the C programming language – Fu
Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t
Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th
1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of
1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of