In: Mechanical Engineering
Write a program in MATLAB that processes a series of employees to determine the days until/since a given employee’s birthday as follows: To populate the employees' data, read in a comma separated file containing First Name, Last Name, Birthday Month, Birthday Day, and Salary. Use the file uploaded in Loud Cloud as an example. Build up an array of employee records (i.e., structures) where each record contains the employee's first name, last name, birthday (stored as an integer representing days from January 1st), and salary. Create a function that takes two numbers (month and day) as input and returns a single number (days since January 1st). This function will be used to "translate" the birthday format from that of the input file to that required for the data structures. 1. Create an array containing 12 values in which each number represents the days in each month of the year (i.e., 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31). 2. Subtract 1 from the input month and iterate over the array, adding in the value until you have the days in (month-1) months. 3. Add to this the number of the birthday day. Prompt the user to supply an employee’s first name. Using the result, search through the array of structures to find the requested employee. Display the number of days between the current date and the employee’s birthday. Note that this will be a negative number if the employee’s birthday has already passed. File: Donald,Trump,6,14,400000 Mickey,Mouse,11,18,10000 Ada,Lovelace,12,10,5000 Justin,Bieber,3,1,125000 Benjamin,Franklin,1,17,15000 Angela,Merkel,7,17,234400