Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Object oriented program is a technique used to help mitigate the complexity of software development. While this class does not deal with OOP directly, structures

Object oriented program is a technique used to help mitigate the complexity of software development. While this class does not deal with OOP directly, structures are the beginning of object orientation. This assignment introduces the concept of structures to the student and allows them to think about logically dividing the data of a program much like they have logically divided the functionality of the program with functions.

This assignment uses a rubric. Please review the rubric prior to beginning the assignment to become familiar with the expectations for successful completion.

Refer to "CST-211 Technical Report" to complete this assignment.

Write a program in MATLAB that processes a series of employees to determine the days until/since a given employees 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 employees 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 employees birthday. Note that this will be a negative number if the employees 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions