The writer is very fast, professional and responded to the review request fast also. Thank you.
Everyone has at least one friend who always remembers everyone’s birthday. Write a program to go through your address book and print the names and phone numbers of all people who have birthdays on that day, so you can give them a call.
For this program you MUST use the following struct, the classand the non member function
struct Date { int month; int day;
};
classDatetype
{ public:
void set(intnew_month, intnew_day);
// date set according to the incoming parameters
// this function calls the check_date function.
intget_month(); // accessor function
intget_day();
private:
voidcheck_date();
Date bday;
};
bool compare(Datetype d1, Datetype d2);
// returns true if d1 and d2 represent same month and day;
//otherwise returns false
Input: Today’s month and day (from the keyboard); and a list of names, phone numbers, and birthdates (from the data file). Entries in the file – Friendfile.dat are in the form
PROUD NORMA 555-256-1256 3 5 HANDSOME HANLY 800-133-2255 8 15
CLUMSY NORA 740-123-4567 3 5
GLAMOROUS PENNY 760-345-2211 1 25
MONEYBAG JOE 740-589-9876 4 29
Etc..
Output:The names and phone numbers of any friends whose birthdays are on that day.
Sample output is as follows: If no one has a birthday on that day, just print the message
“No birthdays today”
Enter today’s month and day 3 5
PROUD NORMA 555-256-1256
CLUMSY NORA 740-123-4567
Hints:
v Create a separate directory for this assignment.
v First you need to declare two objects of the Datetype. – one store the month and day from the data file and the other to store month and day from the keyboard.
v Declare the first,last and the phone_number as sting variables and month and day as integer variables in the function main to store the values read from the data file.
v Then you enter the today’s date (month and day) from the keyboard and call the mutator function (set function) to set the values. This function calls the check_date function.
v The check_date function exit the program if month or day is invalid. (pg 562)
v You need to use the dotoperator in the set function definition and the check_date function definition and in accessor functions because the bday has two members of the structtype.
v Now start with awhile(file_stream>> first >> last >> …) loop in the main that will read the first line of data in the data file. Call the function set again with the values from the data file. (same as above)
v Then call the compare function to compare the two days (month and day). If they are equal print the first, last, phone number to the screen with left justifications.
v You can open, check for fail and close the input file in the main.
v Don’t forget to include the necessary libraries.
Electronic submission /home/kmgsubm/bin/2400submit -p 6
Submit only the source code and the data file. Also turn in your source code on Friday, November 14th.
Scoring for Assignment 6
2 points comments (name, date, good introduction to the program, declaration comments etc)
8 points function main
15 points correct implementation of member non member function in the class 4 points style – indenting, formatting etc. 1 point source code
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more