2. University AAA has 150 staff which consists of an academic and a non-academic category. Each staff is given an option to select either a PENSION ON 56 YEARS scheme or a PENSION ON 60 YEARS scheme. Display the details of each staff information and the total number of academic staff and non-academic staff that have selected a PENSION ON 56 YEARS scheme and a PENSION ON 60 YEARS scheme. You are required to get an output as shown in Figure B. Staffs' Information Name NOIC Age Category Scheme .. .. Report of selected Scheme Category Academic PENSION 56 : .... PENSION 60 : .... Report of selected Scheme Category Non-Academic PENSION 56 : .... PENSION 60 : ....

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
100%

Help me solve my coding. I almost could run it.

I provided to you the question.

 

#include <iostream>
#include <string>
using namespace std;

struct staff
{
string name;
int ic;
int age;
int category;
int scheme;

};

int *p;
int *q;
int *r;
int *t;
int ac_56, ac_60, nonac_56, nonac_60;

int main ()
{
for(int i=0; i<2; i++)
{
cout << "name: ";
getline(cin, staff[i].name);
cout <<"ic: ";
cin >> staff[i].ic;
cin.ignore();
cout << "age: ";
cin >> staff[i].age;
cin.ignore();
cout << "category (1-academic @ 2-nonacademic): ";
cin >> staff[i].category;
cin.ignore();
cout << "scheme (1-56 @ 2-60): ";
cin.ignore();

if(staff[i].category = 1 && staff[i].scheme = 1)
{
p = ac_56;
p++;
}
else if (staff[i].category = 1 && staff[i].scheme = 2)
{
q = ac_60;
q++;
}
else if (staff[i].category = 2 && staff[i].scheme = 1)
{
r = nonac_56;
r++;
}
else if (staff[i].category = 2 && staff[i].scheme = 2)
{
t = nonac_60;
t++;
}
else
{
cout << "lol tol tol lah.";
}
}

for (int i=0; i<2; i++)
{
cout <<"name"<<"\t\t"<<"ic"<<"\t\t"<<"age"<<"\t\t"<<"category"<<"\t\t"<<"scheme"<<endl;
cout << staff[i].name<<"\t\t"<<staff[i].ic<<"\t\t"<<staff[i].age<<"\t\t"<<staff[i].category<<"\t\t"<<staff[i].scheme<<endl;
}

for (int i=0; i<2; i++)
{
cout << "\n\nreported selected scheme"<<endl;
cout << "\ncategory academic:"<<endl;
cout << "\tpension 56: " << *p << endl;
cout << "\tpension 60: " << *q <<endl;
cout << "\ncategory nonacademic:"<<endl;
cout << "\tpension 56: " << *r << endl;
cout << "\tpension 60: " << *t <<endl;
}
}

2.
University AAA has 150 staff which consists of an academic and a non-academic
category. Each staff is given an option to select either a PENSION ON 56 YEARS
scheme or a PENSION ON 60 YEARS scheme. Display the details of each staff
information and the total number of academic staff and non-academic staff that have
selected a PENSION ON 56 YEARS scheme and a PENSION ON 60 YEARS scheme.
You are required to get an output as shown in Figure B.
Staffs' Information
Name
NOIC
Age
Category
Scheme
...
Report of selected Scheme
Category Academic
PENSION 56 :
PENSION 60 :
Report of selected Scheme
Category Non-Academic
PENSION 56 :
PENSION 60 :
Figure B
Transcribed Image Text:2. University AAA has 150 staff which consists of an academic and a non-academic category. Each staff is given an option to select either a PENSION ON 56 YEARS scheme or a PENSION ON 60 YEARS scheme. Display the details of each staff information and the total number of academic staff and non-academic staff that have selected a PENSION ON 56 YEARS scheme and a PENSION ON 60 YEARS scheme. You are required to get an output as shown in Figure B. Staffs' Information Name NOIC Age Category Scheme ... Report of selected Scheme Category Academic PENSION 56 : PENSION 60 : Report of selected Scheme Category Non-Academic PENSION 56 : PENSION 60 : Figure B
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY