diff_months: 15

Build an interactive program that can manage a list of employees in a company.

Download Solution Now
Added on: 2023-04-29 05:27:43
Order Code: 489417
Question Task Id: 0

Task Description

Data Engineers regularly collect, process and store data. In this task you will develop a deeper understanding of how C programming language can be used for collecting, processing and storing data. In this assignment you get the opportunity to build an interactive program that can manage a list of employees in a company.

The list is stored as an array of employee_t type structures

employee_t employeelist [MAX_COMPANY_SIZE];

The employee_t is a structure typedef for struct employee. The struct employee contains the following fields

  • name - array of MAX_NAME_SIZE chars (string)
  • fte - a float between 0.0 and 1.0
  • level - unsigned integer between 7 and 18
  • birthday - a structure of date_t type as defined below.

The variable fte indicates if an employee works full-time or part-time for a company. The value fte=1.0 (or 0.5) indicates that an employee works full time (or half-time) for the company.  

Note that we now have a struct nested within a struct. The birthday is a structure typedef for struct date. The struct date_t contains the following fields,

  • day - unsigned integer between 1 and 31 (inclusive)
  • month - unsigned integer between 1 and 12 (inclusive)
  • year - unsigned integer between 1800 and 2017

Your program interacts with the nested struct array in your memory (RAM) and simple database file in your hard disk. It should provide the following features:

  1. add employee

Add a new employee to the employeelist through the terminal. You should collect the input by asking multiple questions from the user.

Enter name>
Enter birthday: day>
Enter birthday: month>
Enter birthday: year>
Enter FTE>
Enter level>

  1. delete last employee

Remove the last employee from the employeelist. TIP: you cannot delete an element from an array. Instead consider using an integer to keep count of number of employees.

  1. display employee list

Display the list of employees in the following format as shown in the sample run. Please follow the sample executable for the exact display format, including white spaces.

Name       Birthday   FTE   Level
---------- ---------- ----- -----
bee        01-01-1900 1.000 07

Pay attention to the strict formatting guide:

  • Name - left aligned, 10 chars at most.
  • Date - 2 digit day, 2 digit month, 4 digit year
  • FTE – 3 decimal places for the fractional part
  • level - 2 digits 
  1. save the employee list to the database file

Save the employeelist in the hard disk as a binary/text file named database. You may use your own format to save the data. You should overwrite if database file already exists.

  1. read the employee list from the database file

Read the database file and put the data into employeelist. You may only read the data files created by your own program. You should overwrite the employeelist array you had in memory when loading from the file.

  1. exit the program

Exit the interactive program.

The database file

It is up to you to create your own data storage format for the database file. Your program should be able to read the database that was created by itself. You can create the database as a text or binary file.

You do NOT need to be able to create a database identical to the database of the sample executable. You do NOT need to be able to read the database of the sample executable.

  • Uploaded By : Katthy Wills
  • Posted on : April 29th, 2023
  • Downloads : 0
  • Views : 348

Download Solution Now

Can't find what you're looking for?

Whatsapp Tap to ChatGet instant assistance

Choose a Plan

Premium

80 USD
  • All in Gold, plus:
  • 30-minute live one-to-one session with an expert
    • Understanding Marking Rubric
    • Understanding task requirements
    • Structuring & Formatting
    • Referencing & Citing
Most
Popular

Gold

30 50 USD
  • Get the Full Used Solution
    (Solution is already submitted and 100% plagiarised.
    Can only be used for reference purposes)
Save 33%

Silver

20 USD
  • Journals
  • Peer-Reviewed Articles
  • Books
  • Various other Data Sources – ProQuest, Informit, Scopus, Academic Search Complete, EBSCO, Exerpta Medica Database, and more