write alogrithms for the following blocks of code... 2nd Block: int main() { //-------defining variables and initializing them------------- HRM info ; int c; char operation,ch; //--------Printing my name on screen---------------- cout<< "Welcome to XYZ HR System Management by Kaiser, James."<>c)) //Reciving vaiables from input : is it no/character ? { cout << "Please enter a number! Try again: "; cin.clear (); cin.ignore (1000, '\n'); // Skip to next newline or 1000 chars, // whichever comes first. } switch(c) { case 1: cout<<"\nEnter the information of the new employee"<>ch; } while(ch=='y'||ch=='Y'); system("pause"); return 0; }
write alogrithms for the following blocks of code...
2nd Block:
int main()
{
//-------defining variables and initializing them-------------
HRM info ;
int c;
char operation,ch;
//--------Printing my name on screen----------------
cout<< "Welcome to XYZ HR System Management by Kaiser, James."<<endl;
cout<<"**************************************************************************"<<endl;
cout<<endl<<endl<<endl;
do
{
cout<<"Welcome to Human Resource Management (HRM) Software of Company XYZ.";
cout<<"To do specific task please choose one of the following commands."<<endl<<endl<<endl;
cout<<" 1. Add new employee"<<endl;
cout<<" 2. Delete employee information"<<endl;
cout<<" 3. Update employee information"<<endl;
cout<<" 4. Make reports based on specific field"<<endl;
cout<<" 5. Search employee"<<endl;
cout<<" 6. Quit"<<endl<<endl;
while(!(cin>>c)) //Reciving vaiables from input : is it no/character ?
{
cout << "Please enter a number! Try again: ";
cin.clear ();
cin.ignore (1000, '\n'); // Skip to next newline or 1000 chars,
// whichever comes first.
}
switch(c)
{
case 1:
cout<<"\nEnter the information of the new employee"<<endl;
info.AddPerson();
break;
case 2:
info.DeletePerson();
break;
case 3:
cout<<"\nEnter an item to deletion";
info.UpdatePerson();
break;
case 4:
cout<<"\nEnter an element to search";
info.ReportList();
break;
case 5:
info.SearchPerson();
break;
default :
cout<<"\nInvalid option try again";
}
cout<<"\nDo you want to continue";
cin>>ch;
}
while(ch=='y'||ch=='Y');
system("pause");
return 0;
}

Step by step
Solved in 2 steps









