Assignment No. 3
Semester: Fall 2019
CS201 – Introduction to Programming Total Marks: 20
Due Date: 15-01-2020
Please read the following instructions carefully before submitting assignment:
It should be clear that your assignment will not get any credit if:
o Assignment is submitted after due date.
o Submitted assignment does not open or file is corrupt.
o Assignment is copied (From internet/students).
Software allowed to develop Assignment
- Dev C++
In this assignment, the students will learn:
• How to make Class while dealing with real life problems
• How to associate functions with Class.
• How to implement switch statement for Class based functions.
• How to deal with file handling.
• How to manipulate already created file.
Assignment Submission Instructions
You are required to submit only .cpp file on the assignments interface of CS201 at VU-LMS.
Assignment submitted in any other format will not be accepted and will be graded with zero marks.
Write a console-based employee management system through binary File Handling (In order to observe data security, we use binary file format so that data cannot be read directly from the TXT file) which will perform management actions of Employee by taking input from user by showing following three options:
- Press 1 to ADD AN EMPLOYEE.
- Press 2 to DISPLAY FILE DATA.
- Press 3 to INCREASE EMPLOYEE SALARY.
After dealing with each option, show prompt to user and continue the program until user press other than ‘y’
Instructions to write C++ program:
Use Class Employee to declare all Employee’s belongings.
Make a EMPLOYEE.TXT file for saving Employee records
Each time program runs, check and delete EMPLOYEE.TXT file if already exists.
Switch statement will be implemented to perform multiple conditions and to perform different actions based on the conditions. i.e. Option 1, 2 and 3.
Write functions to perform tasks given in options.
Screenshots for Guidance:
1 Initially when program executes, following screen will show to user to get input from the user.
2 If user press any other option then 1 at the first time i.e. without creating any file for Employees, then show error to user.
3 If User press 1, then take Employee credentials from user using prompt statements as follows and save that data in binary file named EMPLOYEE:
4 If User Press 2, then show all Employee Records to user by reading data from the file, which is depicted as follows:
5 If User press 3, then ask Employee code from user and then take amount of salary to be increased and update record of that Employee. depicted as follows:
Lectures Covered: This assignment covers Lecture # 15-30.
Deadline: The deadline to submit your assignment solution is 15-01-2020. Your assignment must be submitted within the due date through VU-LMS. No assignment will be accepted through email after the due date.