/* C programming */ Please do not use // for comments as the platform does not support C++ style…

/* C programming */ Please do not use // for comments as the platform does not support C++ style comments. Expected Output format should be exactly the following format given in the description. please read every instruction to get the proper output. Also follow the function structure I have given after the description. You can copy paste it and start the coding there.

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>

2. 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.

3. 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

4. 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.

5. 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.

6. 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.

Your approach

First step for the assignment should be to read this specification very carefully. Then play with the sample executable. Understand how it works, try different inputs. You will only understand the task fully if you spend a reasonable time experimenting with the executable.

Breakdown the task into small measurable subtasks that can be achieved with functions, and then implement one at a time. Begin by taking small steps. Create a program that does not necessarily do all that is eventually required. Add to it slowly and methodically testing it on each occasion. Do not try to write a program that meets all the requirements in one step – this will not save you time.

TEST TEST TEST! Testing is a core part of programming. You should thoroughly test your program to make sure the behaviour is identical to the sample executable. We will provide you with test cases – think yourself. The more testing you do, higher your chances are to get a good grade for the functionality.

If your program crashes unexpectedly, or it runs but does not give the correct output, then you need to think of using a debugging strategy to determine the nature of the fault. For example, you can place printf() statements at significant points in your source code to print messages enabling you to trace execution of the program. You can also use comment delimiters to temporarily remove parts of the source code from the compilation process.

You will lose marks if you do not follow the instructions in the template file. Do NOT hard-code your solution.

When writing the code, the first step is to define the struct employee and struct date with the fields mentioned above – do NOT add extra fields. Inside the main, you can define the employeelist as an array of employee_t type – do NOT define this array as a global variable. To start with, assume all user input is perfect (within the range, correct datatype). Work on adding an employee, then on displaying the employeelist. You could then progressively work your way through other features.

Do not worry about some months not having dates 29-31 and leap years. That means 30-02-1900 is a real date, although the month of Feb does not have a day 30. Only the range conditions mentioned before apply.

All strings in C should be null-terminated i.e. the last character should always be ‘’. The name field in employee_t should be allocated MAX_NAME_SIZE number of chars. However because the last character is ‘’, the actual length of the name that can be stored is MAX_NAME_SIZE-1. Example:
Enter name>Bee1 *Jayawickrama

The employee.name field will store only the first MAX_NAME_SIZE-1 (=10, if MAX_NAME_SIZE is 11) characters including spaces and any other character: {‘B’,’e’,’e’,’1′,’ ‘,’*’,’J’,’a’,’y’,’a’,’’}

Note that the database file is assumed to be error free. However, your program should handle: “careless users” – a user may enter a value outside the expected range for any interactive input. Example:
Enter your choice>0
Invalid choice.

Or a careless user may try to input 365 as the month the user was born (month should be between 1 and 12). Or try to delete an employee when it is empty, etc.

I suggest initially attempt all features without worrying about careless users and having spaces in names. Then build on top of that if you still have time in hand. Note that you are expected to think yourself how a careless user could break your program – we will not provide test cases.

NOTE: Handling spaces in name is aimed for advanced students. You may need to do your own research, but more than that you may have to be creative. By using incorrect techniques you could very well introduce more bugs in your code and it could be time consuming. The special techniques required for this purpose are not examinable.


* List header files – do NOT use any other header files. Note that stdlib.h is

* included in case you want to use any of the functions in there. However the

* task can be achieved with stdio.h and string.h only.






* List preprocessing directives – you may define your own.



#define MAX_NAME_SIZE 11


* List structs – you may define struct date and struct employee only. Each

* struct definition should have only the fields mentioned in the assignment

* description.



* Function prototypes – do NOT change the given prototypes. However you may

* define your own functions if required.


void printMenu(void);


* Main


int main(void){


char dbFileName[] = “database”;

return 0;



* This function prints the initial menu with all instructions on how to use

* this program.

* inputs:

* – none

* outputs:

* – none


void printMenu(void){


“1. add employeen”

“2. delete last employeen”

“3. display employee listn”

“4. save the employee list to the databasen”

“5. read the employee list from the databasen”

“6. exit the programn”);


Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
The price is based on these factors:
Academic level
Number of pages
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more
error: Content is protected !!