помогите доделать код
#include"Time.h"
#include<iostream>
#include "iostream"
#include<clocale>
#include<conio.h>
class time
{
private:
int min;
int sec;
public:
time() : min(0), sec(0) {
}
time(int mn, int sc) : min(mn), sec(sc) {
}
void gettime() {
cout << "\nВведите минуты: ";
cin >> min;
cout << "\nВведите секунды: ";
cin >> sec;
}
void showtime() {
cout << min << "мин." << sec << "сек.";
}
time operator+(time) const;
friend bool operator==(const time& t1, const time& t2);
};
time time::operator+(time t2) const {
int m = min + t2.min;
int s = sec + t2.sec;
if (s >= 60) {
s -= 60;
m++;
}
return time(m, s);
}
bool operator==(const time& t1, const time& t2) {
if (t1.min == t2.min && t1.sec == t2.sec)
return true;
else return false;
}
int main() {
setlocale(LC_ALL, "Russian");
time time1, time2, time3, time4;
time1.gettime();
time2.gettime();
time3 = time1 + time2;
time4 = time1 + time2 + time3;
cout << "time1=", time1.showtime();
cout << endl;
cout << "time2=", time2.showtime();
cout << endl;
cout << "time3=", time3.showtime();
cout << endl;
cout << "time4=", time4.showtime();
cout << endl;
if (time1 == time2)
cout << "Временные промежутки равны\n";
else
cout << "Временные промежутки не равны\n";
_getch();
return 0;
}
Создать класс Time для работы с временными интервалами. Интервал должен быть представлен в виде двух полей: минуты типа int и секунды типа int. при выводе минуты отделяются от секунд двоеточием.
Реализовать:
- сложение временных интервалов (учесть, что в минуте не может быть более 60 секунд)
- сравнение временных интервалов (==)
Задание:
- Удалить все записи равные заданному значению.
- Увеличить все записи с заданным значением на 1 минуту 30 секунд.
- Добавить K записей после элемента с заданным номером.
Сложение и сравнение я сделал а дальше возникли трудности