Any C++ technique covered in Chapters 1 through 12is allowedexcept for global variablesYou are not allowed to use any global variables.If necessary, global constants may be used.Project 10DescriptionFor this project a Date class(specifiedin the file Project_10.h) will be constructed and all function definitions will be written in the file Project_10.cpp. A makefileis provided to compile this project. The file Project_10_main.cppcontainsthe main functionthat is used to run the program.On Canvas, download the files Project_10.h, Project_10_main.cpp and Makefile. Save these files in your Project 10directory. Do not modify these files.Another file is provided as well.It is Project_10.cpp. Download this and all the code you write will be in this file.This file contains all the function definitions for the methods for theclass specification provided in the header file Project_10.hThis project is similar to the Time class described in the classes power point slides and goine over in classNote: do not use any variable/parameter in your functions or program that are named month, day or year –these are used as private membersof the class and you wanttomake sure that you know which variable or parameter you are talking about. For this project the following functions are written:1)For class constructors:a.A default constructor called Date() –default date is 1/1/1900b.A parameterized constructor Date(intmonth, intday, intyear) –initialize a Date object to the values provided when it is declared(i.e. Date myDate(1,1,1900);) c.A parameterized constructor Date(int month,int year) –initialize a Date object with the two values provided and sets the day value to 1.2)For the class Transformersa.A parameterized function SetDate(int,int,int) –this sets thedate in a Date object (instance/variableof the class Type Date) to the date specifiedb.A function toincrement the date by 1 day
Spring 2021CPE211Project AssignmentProject 10Page 2of 33)For the class observers –two functionsfor writing out the date –one format is all numbers the other requires the use of the month name and threefunctionsfor comparing two dates.a.WriteNumberFormat() –writes out the date in format MM/DD/YYYYb.WriteNameFormat() –writes out the date in format MonthName day, yearc.SameDate(Date) –returns trueif the class object invoking the function is the same date ofthe classobject passed in as an argument and returns false otherwised.BeforeDate(Date) –returns trueif the class object invoking the function is before the date ofthe class object passed in as an argument and returns false otherwisee.AfterDate(Date) –returns trueif the class object invoking the function is after the date ofthe classobject passed in as an argument and false otherwiseAfterdownloadingall 4 files (Project_10.h, Makefile, Project_10_main.cpp and Project_10.cpp), start your work by making empty function stubs in Project_10.cpp. The function headings are determined from thepublicfunctions listed in Project_10.h. Once you have all the function stubs written, you should be able to run the Makefile(type make at the command prompt)to generate the program executable Project_10. You can run the program, but not much happens.Now add code to each ofthe functions described above and after completing each function, run the makefile to make sure the program still compiles. If it does not compile fix the errors until it does compile. I recommend writing the two constructors and WriteNumberFormat functions first.Then the rest of the functions can be written in any order.Project 10Function Contents1)The constructor functionsset the private members of month, day and year to the default values or the values specified. The order for the 3 parameter Parameterized constructor is Month, Day and Year. The order for the 2 parameter Parameterized constructor is Month, Year and the day is set to 1.2)The SetDatefunction takes in a date –order is Month, Day and Year –and stores those values in the appropriate private members3)The IncrementDatefunction increments the date of the object by one day. This function will have to make a test for when a new month is moved into and when a new year is moved into because of the increment. Using a switch statement based on the month of the current date simplifies the work necessary for cases where a new month or year is entered due to the increment of 1 day. Do not worry about leap years–assume February always has 28 days. Lots of ways to perform the increment action4)The WriteNumberFormatfunction takes the values of the private members month, day and year and outputs them in the form mm/dd/yyyy. If needed, Leading 0’s are required
We need at least 10 more requests to produce the answer.
0 / 10 have requested this problem solution
The more requests, the faster the answer.
For this project a Date class(specifiedin the file Project_10.h) will be constructed and all function definitions will be written in the file Project_10.cpp. A makefileis provided to compile this project. The file Project_10_main.cppcontainsthe main fun
Makefile (2).txtProject_10 cpp.JPGProject_10 h.JPGProject_10_main 1.JPGProject_10_main 3.JPGProject_10_main 2.JPGProject_10.pdfall files and instructions attatched
Create an abstract class “Appointment” that represents an event on a calendar. The “Appointment” class will have four instance variables: • An instance variable called “year” which will be of type int • An instance variable called “month” which will be of type int • An instance variable called “day” which will be of type int • An instance variable called “description” which will be of type String The “Appointment” class must also implement the following methods: • A getter...
Part (A) Note: This class must be created in a separate cpp file Create a class Employee with the following attributes and operations: Attributes (Data members): i. An array to store the employee name. The length of this array is 256 bytes. ii. An array to store the company name. The length of this array is 256 bytes. iii. An array to store the department name. The length of this array is 256 bytes. iv. An unsigned integer to store...
Given the following date class interface: class date {private: int month;//1 - 12 int day;//1 - 28. 29. 30. 31 depending on month & year int year;//4-digit, e.g.. 2017 public: date();//Default constructor (investigate; find what it is used for)//Postcondition: the newly declared date object is initialized to 01/01/2000 date(int mm, int dd, int yyyy);//Second constructor//Postcondition: the newly declared data object is initialized to mm/dd/yyyy void setDate(int mm. int dd. int yyyy);//Postcondition: set the contents of the calling date object to...
Amend the Date.java file on p. 77 (also available on the lab drive) so that the Date class: a. Has a month field that is a String instead of an int. b. Has a third constructor that will take in a String parameter (only.) This constructor will parse the String into the month, day, and year fields. The String is provided in the following format: “Month Day, Year”. If the tokenizing and/or parsing generates an exception, the date defaults to...
c++ format Goals . Understand how to implement operator overloading in C++ Warning: Programs must compile using gt+ on the Computer Science Linux systems. If your code does not compile on CS machines you will get 0 for the assignment. Organize your files into folders by lab assignment. For this assignment, create a folder called Lab9. A. Read Chapter 18 B. Create a new class called RationalNumber to represent fractions. The class should have the following capabilities: 1) It should...
The class dateType is designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the data members. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and the year are checked before storing the date into the data members. Add a function member, isLeapYear, to check whether a year is a leap...
Design a class that contains: we have to make 3 files header file , one .cpp file for function and one more main cpp file 9.3 (The Account class) Design a class named Account that contains: An int data field named id for the account. A double data field named balance for the account. A double data field named annualInterestRate that stores the current interest rate. A no-arg constructor that creates a default account with id 0, balance 0, and...
Provide code and full projects neatly and in proper form and in the correct header and cpp files((we have to make 3 files header file , one .cpp file for function and one more main cpp file) Template Classes – Chapter 12 Write an example of a template function that can swap 2 generic elements. Create a C++ class vector using the class diagram shown in Figure 12.2. in Liangs textbook. Do not use the C++ provided header file <vector>...
Using C++ to write .cpp and .h file. Main function and sample output are given. The task is to write a vector class for dynamic allocation.declare the the class named vector with the required attributes. The task are defined in the main function. #include <iostream> #include "vector.h". #define LOG(x,y) std::cout << x << y « std::endl; #define INFO(x) std::cout << "[INFO]: #define WARNING(x) std::cout <« "[WARNING]: "<< x <« std: :endl; << x << std::endl; " « x < std::endl;...