Trying to create a program. Need help please.

So I'm thinking of creating a program to help me with the gestation period of my dog. I want to be able to have the user input the date the dog was bred using (Month, Day, Year)input and having the output read (Month, Day, Year). Can anyone show me where to start? I am fairly new to the programming world and any help would be greatly appreciated.

I don't follow. What will the program do with that information? You just enter it and it displays it right back and that's it?
I apologize. The user will input the date of breeding and the program will display estimate of date from day 56 to day 62 from the date entered.
C++ has some datetime functionality built in.
See: https://stackoverflow.com/questions/15668638/arithmetics-on-calendar-dates-in-c-or-c-add-n-days-to-given-date

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <ctime>
#include <iostream>

int main()
{        
    // initialize
    int y=1980, m=2, d=5;
    std::tm t = {};
    t.tm_year = y-1900;
    t.tm_mon  = m-1;
    t.tm_mday = d;
    // modify
    t.tm_mday += 40;
    std::mktime(&t);
    // show result
    std::cout << std::asctime(&t); // prints: Sun Mar 16 00:00:00 1980
}


C++20 has more calendar options, if your compiler supports it: https://en.cppreference.com/w/cpp/chrono
Thanks alot. I'll start there.
Topic archived. No new replies allowed.