write alogrithms for the following  blocks of code... 1st block: void HRM::UpdatePerson(){ int empId; char redo1,redo2; lebel: cout << "ID of employee you are modifying: "; while(!(cin>>empId)) //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. } int flag1=0; for (int i = 0; i < n; ++i) { if (y[i]!=empId) { flag1++; } } /* if (flag1==n){ // cout<<" not matching="<< y[i]; cout<<"Sorry, there is not any employee with requested personal number. Do you want to repeat delete by entering the new personal number (y/n)?:"; cin>>redo1; if(redo1=='Y'||redo1=='y'){ goto lebel; } } */ cout <> choice; if (choice == 1) { cout << " First name: "; e[i].in_FirstName(); } else if (choice == 2) { cout << " Family name: "; e[i].in_FamilyName(); } else if (choice == 3) { cout << " Working hours per week: "; e[i].in_Workinghour(); } else if (choice == 4) { cout << " Payment for one hour: "; e[i].in_Costperhour(); } cout<<"Do you want to update another field (Y/N)="; cin>>redo; } while (redo=='y'||redo=='Y'); } } int a; a=n; cout<<"\nThe employee with the following information has been added to the system:"<

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

write alogrithms for the following  blocks of code...

1st block:

void HRM::UpdatePerson(){

int empId;
char redo1,redo2;

lebel:
cout << "ID of employee you are modifying: ";

while(!(cin>>empId)) //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.
}


int flag1=0;
for (int i = 0; i < n; ++i) {

if (y[i]!=empId) {
flag1++;

}
}
/* if (flag1==n){

// cout<<" not matching="<< y[i];
cout<<"Sorry, there is not any employee with requested personal number. Do you want to repeat delete by entering the new personal number (y/n)?:";
cin>>redo1;
if(redo1=='Y'||redo1=='y'){
goto lebel;
}
} */

cout <<endl;
lebel1:

for (int i = 0; i < n; ++i) {


if (y[i]==empId) {

cout<<"matching="<< y[i];

flag=true;
int choice = 0;
char redo;

do {
cout << endl << endl;
cout << "Please enter the number related to the change you are trying to make: " << endl;
cout <<"1. First name" << endl;
cout << "2. Family name" << endl;
cout << "3. Working hours per week" << endl;
cout << "4. Payment for one hour" << endl;
cout << std::endl;

cin >> choice;
if (choice == 1) {
cout << " First name: ";
e[i].in_FirstName();
}
else if (choice == 2) {
cout << " Family name: ";
e[i].in_FamilyName();
}
else if (choice == 3) {
cout << " Working hours per week: ";
e[i].in_Workinghour();
}
else if (choice == 4) {
cout << " Payment for one hour: ";
e[i].in_Costperhour();
}
cout<<"Do you want to update another field (Y/N)=";
cin>>redo;
} while (redo=='y'||redo=='Y');
}
}
int a;
a=n;
cout<<"\nThe employee with the following information has been added to the system:"<<endl;
cout<<"\nFirst Name Last Name Personal ID Salary per year (USD)";
cout<<"\n-------------- -------------- ------------ -------------------------"<<endl;
for(int i=0; i<a; i++){
e[i].get_FieldName();

cout<<"hahahahah="<<n<<endl;

}
}

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Concept of pointer parameter
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education