//-------------------------------------------------------------------- // // Convert constructor lab test-convert.cs // // Shell program for the convert constructor using the Logbook and // the singly-linked implementation of the List ADT. // //-------------------------------------------------------------------- using namespace std; #include #include "logbook.h" #include "listlnk2.cpp" //-------------------------------------------------------------------- void main() { int day, // Day chosen for entry entry, // Value for entry month, // Logbook month year, // Logbook year numDays, // Number of days in the logbook month stop; // Flag to control entering data // Create a logbook cout << endl << endl << "Enter the month and year for the logbook month : "; cin >> month >> year; Logbook testLog(month,year); cout << "Logbook created for Month : " << testLog.getMonth() << ", Year : " << testLog.getYear() << endl; cout << "# days in month : " << testLog.getDaysInMonth() << endl; // Populate the logbook stop = 0; while ( !stop ) { cout << endl << "Please data for the logbook." << endl; cout << endl << "Enter day and entry (0 0 to finish) : "; cin >> day >> entry; if ( day == 0 && entry == 0 ) stop = 1; else { testLog.putEntry(day,entry); cout << "Logbook:" << endl; for ( day = 1 ; day <= testLog.getDaysInMonth() ; day++ ) { cout << day << " " << testLog.getEntry(day) << '\t'; if ( day % 5 == 0 ) cout << endl; } cout << endl; } } // Create a list to represent the logbook and display // the log using the singly-linked list. List logList( testLog ); cout << endl << "Now printing same logbook from linked list" << endl; // Insert your code below. It should include the month, year, // number of days in the month, and a printout of the logbook // data from logList identical to the logbook listings above. // All the necessary data from testLog should now be in // logList--do NOT use testLog from here on. }