Modify the MilTime class you created for Programming Challenge 4of Chapter 15 (Time Format). The class should implement thefollowing exceptions:
BadHour Throw when an invalid hour (< 0 or > 2359) ispassed to the class.
BadSeconds Throw when an invalid number of seconds (< 0 or >59) is passed to the class.
Demonstrate the class in a driver program.
THIS IS MY PROGRAM:
#include <iostream>
#include <string>
#include <cstring>
using namespace std;
class Time
{
protected:
int hour;
int min;
int sec;
public:
// Default constructor
Time()
{
hour = 0; min = 0; sec = 0;
}
// Constructor 2
Time(int h, int m, int s)
{
hour = h; min = m; sec = s;
}
// Accessors
int getHour() const
{
return hour;
}
// returns the minutes
int
PayPal Gateway not configured
PayPal Gateway not configured