Course Solutions Uncategorized (Solved) : Modify Miltime Class Created Programming Challenge 4 Chapter 15 Time Format Class Impleme Q32813683 . . . .

(Solved) : Modify Miltime Class Created Programming Challenge 4 Chapter 15 Time Format Class Impleme Q32813683 . . . .

 

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

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post