Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

create a c + + program Make an Employee class. It has two attributes o id as unsigned int o name as a character array

create a c++ program Make an Employee class.
It has two attributes
o id as unsigned int
o name as a character array of size 100.
o total as static integer to show total number of employees
o Set the initial value of total equals to 0.
Make no argument constructor
o Increment total.
o Set id equals to total and name equals to empty sting.
Make a destructor and decrement total inside the destructor.
Also, show id and name of the Employee object that is being
destroyed.
Make void get_data() functions to get name with spaces from user.
Hint: use cin.getline(array_name, size).
Make void show_data() function to display id and name on screen.
Make static void show_total() to show total number of employees.
Make main() function
o Call show_total() using class name.
o Make an Employee Object by name and get data from user
using keyboard.
o Call show_total() using class name.
o Now Make an Employee Object Dynamically using Employee
pointer.
o Call show_total()
o Destroy the this employee object.
o Again call show_total() using class name.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions