subject

Various websites like Wikipedia or IMDB list not just a person's birthdate but also the person's current age. Given a person's birthdate and current date, output the person's age in years. Write a method that, given a person's birthdate and current date, returns the person's age in years. The custom is to round down. If the input is 7 1 2000 2 15 2015, the output is 14 (because the person hasn't yet reached their 15th birthday). A person less than 1 has age 0. Input Format: 7 1 2000 2 15 2015 => BirthMonth BirthDay BirthYear CurrentMonth CurrentDay CurrentYear

Hints:

Start by computing currAge just as the difference in years. Then, use an if-else statement to determine whether to decrement currAge.

One reason to decrement is if the current month is less than the birth month (no birthday yet this year).

Another reason to decrement is if the current month equals the birth month, but the current day is less than the birth day.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 21:00
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
Answers: 3
question
Computers and Technology, 23.06.2019 11:30
Auser is given read permission to a file stored on an ntfs-formatted volume. the file is then copied to a folder on the same ntfs-formatted volume where the user has been given full control permission for that folder. when the user logs on to the computer holding the file and accesses its new location via a drive letter, what is the user's effective permission to the file? a. read b. full control c. no access d. modify e. none of the above
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
Write and test a python program to find and print the largest number in a set of real (floating point) numbers. the program should first read a single positive integer number from the user, which will be how many numbers to read and search through. after reading in all of the numbers, the largest of the numbers input (not considering the count input) should be printed.
Answers: 1
question
Computers and Technology, 24.06.2019 11:20
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput.find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
You know the right answer?
Various websites like Wikipedia or IMDB list not just a person's birthdate but also the person's cur...
Questions
question
Mathematics, 12.12.2020 16:40
question
Mathematics, 12.12.2020 16:40
question
Mathematics, 12.12.2020 16:40
question
Mathematics, 12.12.2020 16:40
Questions on the website: 13722362