Design an Employee Information System for employees of Super Shoppy
The employee master should keep employee specific information.
For each employee, details of all dependent family members are also maintained.
There may be one or more family members for an employee.
The menu base program should provide following options…
 Insert, delete and updating on employee master, Family Member table
 List all entries of the master table in the order of either Employee code or Employee name as per
the user’s choice.
 List all employee details including family members information for given employee
 List employees according to the descending order of their seniority in the shoppy
List all kids below N yrs employee wise. Accept value of N.
(Files: Employee Master, Family Master)

Recommended Answers

All 14 Replies

if you know how to solve this problem please send me the C++ code
before 6th of june . i will really appretiate it .

It is not that i haven't tried the problem myself. i am sending the code which i wrote & now i am stuck on how to move further that's why i need help.

#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
void menu1();
void view();
void modify();
void name();
void code();
void insert();
void remove();
void update();


void menu1()
{
	int ch=0;
	while(ch!=3)
	{
		clrscr();
		cout<<"\t\tMain Menu\n";
		cout<<"\t1.VIEW DETAILS\n";
		cout<<"\t2.MODIFY DETAILS\n";
		cout<<"\t3.EXIT\n";
		cout<<"\n\nEnter your choice please=> ";
		cin>>ch;

		switch(ch)
		{
			case 1: view();
					break;
			case 2: modify();
					break;
			case 3: cout<<"Have a good day";
					exit(0);
		}
	}
}


void view()
{
	int ch;
	while(ch!=3)
	{
		clrscr();
		cout<<"Type of View SORTED BY\n";
		cout<<"\t1.Employee Name\n";
		cout<<"\t2.Employee Code\n";
		cout<<"\t3.Back to Main Menu";
		cin>>ch;

		switch(ch)
		{
			case 1: name();
					break;
			case 2: code();
					break;
			case 3: menu1();
					break;
			default:cout<<"Invalid choice. Please re-enter\n";
					view();
					break;
		}
	}
}


void modify()
{
	int ch;
	while(ch!=4)
	{
		cout<<"Modify the Details by\n";
		cout<<"\t1.Inserting new emloyee\n";
		cout<<"\t2.Deleting existing employee\n";
		cout<<"\t3.Updating existing employee\n";
		cout<<"\t4.Back to Main Menu\n";
		cin>>ch;

		switch(ch)
		{
			case 1: insert();
					break;
			case 2: remove();
					break;
			case 3: update();
					break;
			case 4: menu1();
					break;
			default:cout<<"Invalid choice. Please re-enter\n";
					modify();
					break;
		}
	}
}

void insert()
{
	char nm[20],nm1[20];
	int code,no,no1,age;
	clrscr();
	ofstream emp("e:\\ tc\\c_plus\\project\\employee master");
	cout<<"\nEnter Employee name\t";
	gets(nm);
	emp<<"Employee name=>"<<nm;
	cout<<"Enter Employee Code\t";
	cin>>code;
	emp<<"Employee code=>"<<code;
	emp.close();

	ofstream family("e:\\ tc\\c_plus\\project\\family master");
	cout<<"Enter number of family members\t";
	cin>>no;
	family<<"No of Family members=>"<<no;
	cout<<"Enter number of dependent family members\t";
	cin>>no1;
	family<<"No of Dependent Family members=>"<<no1;
	for(int i=0;i<no1;i++)
	{
		cout<<"Name of dependent family member\t";
		gets(nm1);
		family<<"Dependent's name=>"<<nm1;
		cout<<"Enter dependent's age\t";
		cin>>age;
		family<<"Dependent's age=>"<<age;
	}
	family.close();
}

void remove()
{

Oh man! Did anyone told you that you should have been using the post tags:

[code=cplusplus] //paste the code here

[/code]

Anyways, your code is awful. I am sure you would be programming in a Old-style compiler (perhaps TC++ ). Read this:http://cppdb.blogspot.com/2008/10/why-you-shouldnt-use-you-use-old-c.html
You have not coded the main() function yet.

[Please, anyone, who can explain him what is wrong with his code. I am too frustrated to do so. And yes, please do so before 6th June. LOL ;)]

Yea, siddhantes, I'm also tired of doing that, but I'll give it a shot:

  • [B]clrscr();[/B] is unportable rubbish :)
  • gets(nm); , use cin for that!
  • Use of old-style headers:
    #include<fstream.h>
    #include<conio.h>
    #include<stdio.h>
    #include<string.h>
    #include<stdlib.h>

    conio is not part of standard C++ ...
    For I/O, use the iostream classes !

  • As I see so much void functions in your code, your main function will be void as well, in that case: make it int main()
  • Indent your code, it's a real crap now!

tux4life i don't get anything you wrote but i realize that you are learned in programming . so i would request u to please help me in removing the data from the file created in my program please.

tux4life i don't get anything you wrote but i realize that you are learned in programming . so i would request u to please help me in removing the data from the file created in my program please.

In that case we'll need your whole code :)

this is the whole code that i have been able make.

this is the whole code that i have been able make.

You're wrong, there are missing some parts, for example a main function, and the rest of the 'remove()' function, and maybe some other stuff too :P

hiscasio: also tell us what compiler you are using. And are you on *nix, MS-Windows, or something else?

i am usin turbo C in window XP

>i am usin turbo C in window XP
I am sorry, your code is rusted. That is not a surprise since you are using such a crappy compiler.
I have written a guide to help people like you in long run. Although it is not complete, but it will serve you good. Read it at:
http://siddhant3s.googlepages.com/how_to_tell_rusted_cpp.html

commented: ++ link to excellent blog :) +36
commented: Nice link, but Stroustrup needs better spelling in several places. +33
commented: There was need to something like this +8

This is vc++

try codeproject

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.