Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Objective: Calculate how many days old I will be on the due date of this lab.
- //Name: Ian Chess
- //Course: COMSC-110-8215
- //Compiler: MS Visual Studio 2013
- //Editor: JNotePad
- //libraries
- #include <iostream>
- #include <string>
- using namespace std;
- //Programmer defined data types
- //NONE
- //Special compiler dependent definitions
- //NONE
- //global constants/variables
- //NONE
- //Programmer defined functions
- //NONE
- //main program
- int main()
- {
- // output my name and objective and program information
- cout << "Objective:.Calculate how many days old I will be on the due date of this lab.\n";
- cout << "Programmer: Ian Chess\n";
- cout << "Editor(s) used: Notepad\n";
- cout << "Compiler(s) used: VC++ 2013 Express\n";
- cout << "File: " << __FILE__ << endl;
- cout << "Complied: " << __DATE__ << " at " << __TIME__ << endl << endl;
- //variables
- int days = yearsOld * 365 + leapYears + (365 - daysToEndOfYear); // number of days how old I am on the day this lab is due
- int yearsOld = 28; // number of years old I am
- int leapYears = yearsOld/4;; // number of leap years from birth year to this year
- int julianBirthdate = 10227; // number of days up to and including my birthday in my birth year
- int daysToEndOfYear = 334; // number of days from lab due date until the end of the year
- int julianDueDate = "February 1st, 2015"; // date of the due date
- string DOB = "January 27th, 1987"; // My date of birth
- dueDate = "February 1st, 2015"; // due date of the lab
- string dateOfBirth = "Date of Birth:"; //label for date of birth
- string dueDate = "Due Date:"; // label for due date
- string ageInDays "Age In Days:"; // label for age in days
- cout <<
- cout << dateOfBirth << endl;
- cout << DOB << endl;
- cout << dueDate << endl;
- cout << julianDueDate << endl;
- cout << ageInDays << endl;
- cout << days << endl;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement