In: Computer Science
#include <iostream>
#include <fstream>
using namespace std;
Class Program()
{
Public:
int
date
[200]
,
a=
0
,
x
,
date_read[30];
char answer;
void message()
{
std::cout << "
Welcome to the Event
Scheduling program
";
}
void date_display(int date[10], int& mon , int& year[10])
{
for(i=0;i<10;i++)
{
year[i] = date[i] / 10000;
date[i] %= 10000;
month [i]= date[i] / 100;
}
for(i=0;i<10;i++)
{
cout << endl << "Year: " << year[i]
<< endl << "Day : " << day[i]
<< endl << "Month:" << mon[i];
}
}
void file_write ()
{
fstream file_op;
file_op ("file_date", ios::out | ios::in );
fstream file;
date = 22102020
cout << "Write date in file." << endl;
cin.getline(date, sizeof(date));
// Writing on file
File_op << date << endl;
}
void file_read()
{
// check that array is not already full
while (a < date_read[30] && is >> x)
// read integer from file
Date_read[a++] = x;
// print the integers stored in the array
cout<<"The dates are:"<<"\n";
for (int i = 0; i < a; i++) {
cout << read_date[i] <<' ';
}
//close the file
is.close();
}
int main()
{
// create object of program class
Program prog;
while(true)
{
cout<<"Do you want to continue?(Y/N)"<<endl;
cin >> answer;
if(answer == 'Y'|| answer =='y'){
return true;
}
else if(choice =='N'||choice =='n')
{
return false;
}
else
{
Print(“Enter right choice”)
}
return 0;
}