MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .
Date.h
******************
class Date {
private:
int day, month, year;
public:
void init(int m, int d, int y);
void init(void);
void print(void);
};
Date.cpp
******************
#include <iostream>
#include <ctime>
#include "Date.h"
using namespace std;
void Date::init(int m, int d, int y) {
month = m;
day = d;
year = y;
}
void Date::init() {
time_t now = time(0);
tm *ltm = localtime(&now);
init(ltm->tm_mon + 1, ltm->tm_mday, 1970 + ltm->tm_year);
}
void Date::print() {
cout << month << "-" << day << "-" << year << endl;
}
Main.cpp
*****************
#include <iostream>
#include <ctime>
#include "Date.h"
using namespace std;
int main() {
Date d1;
d1.init();
d1.print();
Date d2;
d2.init(11, 30, 2017);
d2.print();
}
MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST BE DONE IN C++ .MUST...
Use c++ to code: Problem 1 Implement a class Clock whose get hours and get_minutes member functions return the current time at your location. To get the current time, use the following code, which requires that you include the <ctime>header time_t current_time time (e); ta local time - localtime(current, tine)i int hours -local_time->tm hour int minutes-local time->tm_min; Also provide a get_time member function that returns a string with the hours and minutes by calling the get_hours and get_minutes functions. Provide...
You are to write a basic fitness application, in C++, that allows the user of the application to manually edit “diet” and “exercise” plans. For this application you will need to create three classes: DietPlan, ExercisePlan, and FitnessAppWrapper. Diet Plan Attributes: The class DietPlan is used to represent a daily diet plan. Your class must include three data members to represent your goal calories (an integer), plan name (a std::string), and date for which the plan is intended (a std::string)....
its about in C++ You will implement a simple calendar application The implementation should include a class named Calendar, an abstract class named Event and two concrete classes named Task and Appointment which inherit from the Event class The Event Class This will be an abstract class. It will have four private integer members called year, month, day and hour which designate the time of the event It should also have an integer member called id which should be a...
HW_8b - Famous People - One class used by another class - This exercise requires the declaration of two classes: o Famous People O Date - 5 Files are required: o Date.h o Date.cpp o Famous People.h o Famous People.cpp o main.cpp File: Date.h Private data members: O _month o _day 0 year - Public member functions: o Default constructor • Assign O's to all three data members. o Overloaded constructor • Three integer values are passed as arguments from...
C++ problem 11-6 In Programming Exercise 2, the class dateType was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class dateType so that it can perform the following operations on a date, in addition to the operations already defined: Set the month. Set the day. Set the year. Return the month. Return the day. Return the year. Test whether the year is a leap year. Return the number of days in...
C++ programming question Topic: Class 'Date' Hello everybody, can some one help me... ... Write a class Date with the following properties: a) Data elements of the class are day, month, year. All three data elements are defined by the Type int. b) A set and a get element function are to be provided for each data element. In Within the framework of this task, it should be assumed that the values that are passed for day and year, are...
I need sub-questions e, f, g, h. SaffSpring 2019 Professor Question 1: Answer ALL of the following questions based on this provided int daya int montha Date int dnt int y day-d year class Event ring locatson eventbat Event (5tring , Dated ocatlon- event Date-d pubiie String toStringt String detalla-Locatlons"LocatlonDatesevent Date.day return detalia eventDate-year publie statie weld mai arg Event 2ew EventCBayan" hew Date1.3,20191 Systen.out peintil The event n (11.201,as scheduled-ee . 내 1 eentDate.yeari ystem.st-printeinte yatem.ost-printcin(e2) a) What is...
Java Code: 2. Define a class ACCOUNT with the following members: Private members Acno of type int Name of type String Balance of type float Public members void Init) method to enter the values of data members void Show) method to display the values of data members void Deposit(int Amt) method to increase Balance by Amt void Withdraw(int Amt) method to reduce Balance by Amt (only if required balance exists in account) float RBalance() member function that returns the value...
Project_10_base_files.zipMakefile (2).txtProject_10_main 1.JPGProject_10_main 2.JPGProject_10_main 3.JPGProject_10 h.JPGProject_10 cpp.JPGAny 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...