jeudi 26 novembre 2015

C++ date of birth, more than 100 and less 1 year (if-else)

I was required to solve the following problem in C ++ using if-else with only the "iostream"'s library.

Write a program in C ++ that asks the user to enter from the keyboard the current date and the date of birth of a person. The dates will be represented with three numbers whole (day, month, year). 1) After checking the validity of each of the two dates, the program will calculate and see the age in years of the person. 2) In the case where the date birth date is after the current program display an error message. 3) In case age is more than 100 years, the program will display a message to get your attention. 4) In case a individual less than a year, the program display a message to call attention and it displays the user's age in months and days.

Thanks so much! Greta

Aucun commentaire:

Enregistrer un commentaire