Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I know this program is really long but i really need it to move further in the c

ID: 3771763 • Letter: I

Question

I know this program is really long but i really need it to move further in the class thanks for taking the time to do it.

Write a class declaration section section for each of the following specifications. Include a prototype for a constructor and a member function named showData() that can be used to display data member values.

A. a class named Time that has interger data members named secs, mins and hours

b. A class named Date that has interger data members named month, day, and year

C. a class named Circle that has integer data members named xcenter and ycenter and a double precision data member named radius.

5) A. Construct an implementation section for the constructor and showData() member functions corresponding to the class decleration created in 4a, 4b,and 4c indivisually.

6) Include the decleration and implementation sections prepared for Exercise 4a and 5a in a complete working program. b) include the decleration and implementation sections prepared for Exercise 4b and 5b in a complete working program. C) include the decleration and implementation sections prepared in 4c and 5c in a complete working program.        Thanks again i know its alot but i really appreciate it. these are made to be indivisual programs.

Explanation / Answer

Complete Program:

// File: Time.h
#ifndef TIME_H
#define TIME_H

#include <iostream>
#include <string>
using namespace std;

class Time
{
private:
int hours;
int mins;
int secs;

public:
Time(int thours, int tmins, int tsecs);
void showData();
};
#endif

// File: Time.cpp
#include "Time.h"

Time::Time(int thours, int tmins, int tsecs)
{
hours = thours;
mins = tmins;
secs = tsecs;
}

void Time::showData()
{
cout << "Time = (HH:MM:SS): ";

cout << hours << ":";

if(mins < 10)
  cout << "0";

cout << mins << ":";

if(mins < 10)
  cout << "0";
  
cout << secs << endl;
}


// File: Date.h
#ifndef DATE_H
#define DATE_H

#include <iostream>
#include <string>
using namespace std;

class Date
{
private:
int month;
int day;
int year;

public:
Date(int dmonth, int dday, int dyear);
void showData();
};
#endif


// File: Date.cpp
#include "Date.h"

Date::Date(int dmonth, int dday, int dyear)
{
month = dmonth;
day = dday;
year = dyear;
}

void Date::showData()
{
cout << "Date = (MM/DD/YYYY): ";

if(month < 10)
  cout << "0";

cout << month << "/";

if(day < 10)
  cout << "0";

cout << day << "/";

if(year < 1000)
  cout << "0";

if(year < 100)
  cout << "0";

if(year < 10)
  cout << "0";

cout << year << endl;
}


// File: Circle.h
#ifndef CIRCLE_H
#define CIRCLE_H

#include <iostream>
#include <string>
using namespace std;

class Circle
{
private:
int xcenter;
int ycenter;
double radius;

public:
Circle(int cxcenter, int cycenter, double cradius);
void showData();
};
#endif


// File: Circle.cpp
#include "Circle.h"

Circle::Circle(int cxcenter, int cycenter, double cradius)
{
xcenter = cxcenter;
ycenter = cycenter;
radius = cradius;
}

void Circle::showData()
{
cout << "Circle = Center: (" << xcenter << ", " << ycenter << "), Radius: " << radius << endl;
}


// File: Driver.cpp
#include "Time.h"
#include "Date.h"
#include "Circle.h"
#include <iostream>
#include <string>
using namespace std;

int main()
{
Time time(10, 27, 49);
Date date(12, 14, 2015);
Circle circle(3, 6, 5);

time.showData();
date.showData();
circle.showData();

cout << endl;
system("pause");
return 0;
}


Sample Output: