Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #include // needed for formatting using namespace std; // declaration section class Date { private: int month; int day; int year; // function prototypes
#include
#include // needed for formatting
using namespace std;
// declaration section
class Date
{
private:
int month;
int day;
int year;
// function prototypes
public:
Date(int mm = 1, int dd = 1, int yyyy = 2014) // inline constructor
{month = mm; day = dd; year = yyyy;}
void setDate(int mm, int dd, int yy) // inline mutator
{month = mm; day = dd; year = yy;}
void showDate(); // accessor
bool isLeapYear();
bool operator==(const Date&);
};
// implementation section
void Date::showDate()
{
cout
cout
Expert Q&A Done TurboPolarCoordinates. Modify the class TurboPolarCoordinates (c to declare, implement and test the following functions 1. void setAnglelnDegrees(double a); (25 points) 2. void setAnglelnRadians(double a); (25 points) 3. void show ValuesInDegrees 4. void showValuesInRadiansO; Extra Credit: Validate that the angle is greater than or equal to zero and less than 360 degrees (or equivalently 2 PI radians). (15 points) Submit the cpp file with a comment line containing your name, class code and date (25 points) (25 points) }
bool Date::isLeapYear()
{
if((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0))
return true; // is a leap year
else
return false; // is not a leap year
}
bool Date::operator==(const Date& date2)
{
if(day == date2.day && month == date2.month && year == date2.year)
return true;
else
return false;
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started