void GetDay()
{ int i = 0;
cout << "Input the Day: ";
cin >> Today.day;
cout << "Input tomorrow’s day: ";
cin >> Tomorrow.day;
// A while loop can be used to input and store values in the array of structures
while (i < 10) {
cout << "Input a Day: " << endl;
cin >> SomeDate[i].day; //Input the day member of the i th element of the structure array
++i; // increment loop counter
}
return;
}
void GetYear()
{
cout << "Input the Year: ";
cin >> Today.year;
return;
}
void PrintToday()
{
cout << Today.month << " " << Today.day << ", " << Today.year << endl;
cout << Tomorrow.month << " " << Tomorrow.day << ", " << Today.year << endl;
return;
}
int main( )
{
GetDay();
GetMonth();
GetYear();
PrintToday();
return 0;
}
//Assignment: An array of structure variables can be very useful, especially in maintaining records.
//You see above how to declare such an array. Your assignment is to modify this program to implement
//an array of structured variables that store 5 dates: The day before yesterday, yesterday, today,
//tomorrow, and the day after tomorrow. Then modify (or implement a new) function to print the 5 dates.
//Note: you may do this assignment anyway you wish and with any number of functions you wish.
NEED ASSIGNMENT HELP?
We guarantee plagiarism-free and AI-free writing services. Every assignment is crafted with originality, precision, and care to meet your academic needs.
Ready to get started? Place your order directly on this post!
Let us help you achieve excellence—authentic work, every time.


Leave a Reply