LOGIN
software Engineer
 · MultanPakistan
Share
Report
Get Link
TASK
Open
Reward › Contribution Review

Find bug

#include<iostream>
using namespace std;
class Employee
{
	public:
		string nme,dgs;
		int rank;
		void emply_data()
		{
		cout<<"Enter your Name"; 
		cin>>nme; 
		cout<<"Enter your Rank";
		cin>>rank;
		cout<<"Enter your Designation";
		cin>>dgs;
		}
	void clcultion()
	{
    switch(rank) 
 {
     case 1:
         cout <<nme,dgs,10000 << endl;
         break;
  
     case 2:
         cout <<nme,dgs,20000 << endl;
         break;
  
     case 3:
         cout << nme,dgs,30000 << endl;
         break;
  
     default:
         cout << "Invalid Input!" << endl;
         break; 
 }
 }
 };
 main()	
 {
 	Employee b1;
 	b1.emply_data();
 	b1.clcultion();
 }
1 like 
Like
Award Contribution
Robert Lancer
49
Community Expert
Chief Technology Officer at Collaborizm
 · New YorkU.S.
Share
Report
Get Link

I see

 	Employee b1;

But no new instance creation of an Employee assigned to b1.

Like
1 like 
Award Contribution
Enthusiastic Leader
 · KarachiPakistan
Share
Report
Get Link

Employee b1;

b1 must be initialize with new Employee() e.g.

Employee b1 = new Employee();

Like
2 likes 
Award Contribution
software Engineer
 · MultanPakistan
Share
Report
Get Link

error is in cout of case 1,2 and 3

Like
0 like 
Award Contribution
JOIN TASK
LEAVE A REPLY
DISCOVER
CHAT
HIRE
ACTIVITY
FEED
New Post
Help
Start Project
Online Users
Share Link