LOGIN
Yousaf Akram
software Engineer
 · MultanPakistan
Edit
Delete
Share
Report
TASK
Open
  ·  Close Task

Find bug

~span~class~_1bcRJhiNTH8jh88VODldlE~#include~span~<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
Share
Robert Lancer
Chief Technology Officer at Collaborizm
 · New YorkU.S.
Edit
Delete
Share
Report

I see

 	Employee b1;

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

1 like 
Saqib Ansari
Enthusiastic Leader
 · KarachiPakistan
Edit
Delete
Share
Report

Employee b1;

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

Employee b1 = new Employee();

2 likes 
Yousaf Akram
software Engineer
 · MultanPakistan
Edit
Delete
Share
Report

error is in cout of case 1,2 and 3

0 like 
Leave a reply...
DISCOVER
CHAT
ALERTS
-2
DISCUSSIONS
-1
FEED