Question: PROBLEM 1 Write a function called approxDaysLived that will take a parameters: .Birth month * Birth year The function should calculate and return the number

 PROBLEM 1 Write a function called approxDaysLived that will take a

PROBLEM 1 Write a function called approxDaysLived that will take a parameters: .Birth month * Birth year The function should calculate and return the number of days a person born in the given month and year has lived to date. For simplicity, you can assume that all months have 30 days and that all years have 365 days. Also, you don't' need to be precise to the day of the month, only the month. The function will really return a close estimate. For example, somebody born on 12/1992 has lived 25 full years (from 1993 to 2017) and 1 month (Jan of 2018), giving the following result: (25*365) + 30 = 9155 days lived to date Write a main program where you will create three arrays, one for names (strings), one for birth months, and one for birth years. Store the following values in the arrays: Names: Ann, Jen, Tim, Tom, Mike, Ben, Mon, Bob, Brad, Zoe, Ted, Karl, Kim, Jim, Rob, Max. Birth months: 12, 5, 8, 2,7, 5, 8,6,8, 5, 2, 1,6,6, 10, 11. Birth years: 1992, 2007, 1970, 1982, 1981, 1975, 1978, 1966, 1995, 2001, 2004, 2015, 1960, 1916, 1986, 2010 The values stored in these arrays correspond to names, bi should loop through the arrays to calculate the number of days each user has lived to date (using the approxDa lines of output of your program should be: rth months, and birth years of users. Your program ysLived function) and it should display the name and result, one per line. For example, the first two Ann, you have lived approximately 9155 days. Jen, you have lived approximately 3890 days

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!