The aim of this homework assignment is to practice using a class written by someone else and use dynamic allocation. This homework assignment will also help build towards project 1, which will be to write a program implementing the Roster Management Program. For this assignment, write a program that uses the class Date. As an added challenge, I will not provide you with the .cpp file for this class, rather, only the .o file, to which you can link your program for testing purposes. Write a program that does the following:Note that you do not need to know the implementation of the Date class.In order to compile your program and link it to my Date class you will need to do the following:
1. Before you begin writing any program, make a copy of the Date.h file into your directory. Do this by typing the following (note the . at the end):
cp ~alayev/cs211/fall2022/hw4/Date.h .
2. Write your program.
3. Compile your program using the following (to link to my .o file)
g++ main.cpp ~alayev/cs211/fall2022/hw4/Date.oNote that you may copy the Date.o file to your local directory; however, this is not necessary, and will use up valuable space on your venus/mars account. Note further that this .o file will only work on venus/mars, it will not work on other UNIX systems or on Windows. Submit this program to your lab instructor following his instructions. If you find any bugs with the code, please do not hesitate to e-mail me. /* Date.h
*
* Declaration of the class that holds a date,
* which is a month-day-year combination.
*
* Author: Yosef Alayev
*/
#ifndef DATE_H
#define DATE_H
#include <string>
using namespace std;
class Date {
public:
// Initializes a date to the default value of January 1, 1970.
Date();// Initializes a date to the values in the parameters. If the
//date is not legal, sets the date to one of the legal values.
Date(int m, int d, int y);// Returns the month stored by the class
string getMonth() const;// Returns the month stored by the class as a number
int getMonthNum() const;// Returns the day stored by the class
int getDay() const;// Returns the year stored by the class
int getYear() const;// solicit the date from the user
void input();// output the date in a nice format
void output() const;private:
int month, day, year;
void adjust();
};
#endif
Assignment, Class, CS211, else, Homework, practice, solved, someone, This, using, Written
[SOLVED] Cs211 homework 4 the aim of this homework assignment is to practice using a class written by someone else
$25
File Name: Cs211_homework_4__the_aim_of_this_homework_assignment_is_to_practice_using_a_class_written_by_someone_else.zip
File Size: 998.52 KB
Only logged in customers who have purchased this product may leave a review.
Reviews
There are no reviews yet.