/*
 * @topic T00050 Feb 27, 2014 -- Assignment a2, Serial Julian Date prototype
 * @brief <span style="background-color: yellow;">New: </span> an unfinished program with minimal function declarations and definitions
*/

#include <iostream>

void pause()
{
    //----------------------------------------------
    // prevent window from closing before exiting:
    //----------------------------------------------
    char ch; // ch is a variable that holds a character

    // curious \n is a "line feed" control character,
    // it moves the cursor to the next line:
    std::cout << "\nEnter X to Exit: ";

    std::cin.ignore( 1, '\n' ); // extract and discard characters
    std::cin.clear();           // this clears cin state
    std::cin.get( ch ); // this reads a character from the keyboard,
                        // and pauses the program from before exiting
}
// function declarations
int serial_julian_date( int Month, int Day, int Year );
int serial_2_month( int nDate );
int serial_2_day( int nDate );
int serial_2_year( int nDate );

int main()
{
    // TODO: add an endless loop to this program
    int month = 2;
    int day = 27;
    int year = 2014;
    // TODO: ask user to enter the date components

    int serial = serial_julian_date( month, day, year );
    std::cout << "Serial date is " << serial << '\n';
    month = serial_2_month( serial );
    // TODO: similarly, call other functions convert from serial to day and to year
    // day = ...

    std::cout << "Converting back to gregorian date " << month << '/' << day << '/' << year << '\n';
    pause();
    return 0;
}

int serial_julian_date( int Month, int Day, int Year )
{
    // TODO: finish implementation of this function
    int a = (14 - Month) / 12;
    // ...
    return 0;
}

int serial_2_month( int nDate )
{
    // TODO: implement of this function!
    return 0;
}

//TODO: add serial_2_day() and serial_2_year() function implementations