i am making a age calculator that you type in a date like 09/10/89
and it puts out how old you are in years days hrs and minutes...
i have the formula all ready but i dont know how to do this without putting in the dates one by one this is complicated and i haven't even tried to attempt coding a program in idk like 5 months (maybe less), ill give you my code (it is not much at all and i havent thought the variables through too much) so please help.
1 2 3 4 5 6 7 8 9 10 11 12
#include <iostream> // cin and cout (main funct for that lib)
#include <std_lib_facilities> // libs like cmath and algorithem
usingnamespace std;
double y,d,h,m; // y = year, d = days, h = hours, m = minutes
double mo,yr,dy; // yr = year, mo = month, dy = day
int main ()
{
cout << "Age Calc" << \n;
cout << "Type in the date you were born and you will-" << /n;
cout << "see your age in years, days, and minutes!" << /n;
{
int
well wait no, i want to use the current date and the user to type in the date they were born then it will come out with how long they have been alive ie. 36 years , 168 days and 8 hrs , 3 minutes.
i can do this with math and variables but i would have to type out the vars 1 by 1. Im new to C++
but i know batch really well and i am trying to learn a real language... i know a formula to do this but i think this would not be worth my time if i did it with math and variables.