Solution to The Department of Computer Science is an independent entity within the University, therefore, the department … - Sikademy
Author Image

Archangel Macsika

The Department of Computer Science is an independent entity within the University, therefore, the department must maintain and manage its own resources. The department must maintain information about four types of resources, namely, physical resources, human resources, intellectual resources and financial resources. Physical resources have the following attributes: ● PR code, PR description and location. Human resources have the following attributes: ● Employment number, HR occupation and office number. Intellectual resources have the following attributes: ● IR code and IR description. Financial resources have the following attributes: ● FR code, FR name, Value. Physical Resources may include the equipment, buildings, inventory and the innovation property( assuming we have many) , Human Resources are employees, Intellectual Resources are the types of business resources which are nonphysical and intangible in nature like patents of the product, brands of the organization, copyright over important materials and even the partnerships and Financial Resources often include cash, credit, and lines of credit along with the ability to have options of stock plans for the employees. You are requested to develop a C++ Menu Driven application to keep track of all such resources for the Department of Computer Science. When your app starts, it must display a list of all possible operations one can perform. This list should always be in display no matter what operation is being carried out. You will need a user-defined data type to cater for each resource; please do not use classes. Be Creative in design and use arrays to store your resources. Design your own menu. Write the following functions and incorporate them into the app: ● The function that add details of each resource, the function that display details of a resource. ● A function that adds details of two different resources. ● A function that compares two different resource and states if they are the same. ● A function that gives the name of the financial resource with the highest value. ● A function that allows swapping of occupations for two employees. ● A function that allows extension in the intellectual resource’ description. E.g if the description in the intellectual resource is “This product cannot be sold to children” and we want to change it to “This product cannot be sold to children under the age of 18”.

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


#include <iostream> using namespace std; //universal declaration int x ,y, choice; char PRcode[10], PRdescription[10], location[10], employ[10], hroc[20],ircode[10], irdes[50], frcode[10],frname[20], offnum[10], irdes2[10]; float value; char opt1=1; char opt2=2; char opt3=3; char opt4=4; char opt5=5; char opt6=6; int main(); void choices(); void again(); void conetwo(); void compare(); void highest(); void exit(); void fr(); void dis(); void addanddisplay(); void swap(); void addanddisplay (){ //if a user chooses 1 //requesting information cout<<"Add Details Of Each Resource,\n\n"<<endl; cout<<"1. Physical Resources(may include the equipment, buildings, inventory and the innovation property)\n"<<endl; cout<<"Enter Product Code"<<endl; cin>>PRcode; cout<<"Enter Product Description"<<endl; cin>>PRdescription; cout<<"Enter Product Location"<<endl; cin>>location; cout<<"\n\n"; cout<<"2. Human resources(Employees)\n"<<endl; cout<<"Employment number,"<<endl; cin>>employ; cout<<"HR occupation"<<endl; cin>>hroc; cout<<"Office Number, "<<endl; cin>>offnum; cout<<"\n\n"; cout<<"3. Intellectual resources(business resources which are nonphysical and intangible in nature like patents of the product,\n brands of the organization, copyright over important materials and even the partnerships)\n"<<endl; cout<<"Intellectual resources code,"<<endl; cin>>ircode; cout<<"Intellectual resources description."<<endl; cin>>irdes; cout<<"\n\n"; cout<<"4. Financial resources(cash, credit, and lines of credit)\n"<<endl; cout<<"Finacial Resource code,,"<<endl; cin>>frcode; cout<<"Finacial Resource name,"<<endl; cin>>frname; cout<<"Value, "<<endl; cin>>value; cout<<"\n\n\n"; dis(); } void dis(){ //displaying cout<<"Display\n\n"<<endl; cout<<"--Physical Resources--"<<endl; cout<<"Product Code: "<<PRcode<<endl; cout<<"Product Description: "<<PRdescription<<endl; cout<<"Product Location: "<<location<<endl; cout<<"\n"; cout<<"--Human resources--"<<endl; cout<<"Employment number,: "<<employ<<endl; cout<<"HR occupation: "<<hroc<<endl; cout<<"office number.: "<<offnum<<endl; cout<<"\n"; cout<<"--Intellectual resources--"<<endl; cout<<"IR code: "<<ircode<<endl; cout<<"IR description.: "<<irdes<<endl; cout<<"\n"; cout<<"---Financial resources--"<<endl; cout<<"FR code: "<<frcode<<endl; cout<<"FR name: "<<frname<<endl; cout<<"Value: "<<value<<endl; again(); cout<<"--------------------------------------------------------------------------------------"; } void exit(){ cout<<"Goodbye"; main(); } void again(){ //reapperaing menu cout << "\n\nwhat option would you like to do again?\n\n"; //menu/functions to choose from again cout << "1. Add details of each resource, then display such details" << endl; cout<<"2. Adds details of two different resources\n"; cout<<"3. Compares two different resource and states if they are the same\n"; cout<<"4. Show the name of the financial resource with the highest value\n"; cout<<"5. Swap occupations for two employees\n"; cout<<"6. Edit the intellectual resource’ description\n"; cout<<"7. Exit\n\n"; cout<<"--------------------------------------------------------------------------------------selection= "; string choice; do { if ( choice == "1" ) { addanddisplay(); } if (choice == "2") { choices(); } if (choice == "3") { compare(); } if (choice == "4") { highest(); } if (choice == "5") { swap(); } if (choice == "6") { interll(); } if (choice == "7") { exit(); } cin >> choice; }while (choice != "8"); cout << "Wrong asnwer!" << endl; } char asdf=1; char sdfg=2; char abcd=3; char abcde=4; void choices() //A function that adds details of two different resources. { cout << "Select two different resources to add details.\n"; cout<<"1. Physical Resources\n"; cout<<"2. Human Resources\n"; cout<<"3. Intellectual Resources\n"; cout<<"4. Financial Resources\n\n"; //combinations{1,2},{1,3},{1,4},{2,3},{2,4},{3,4} cout << "Enter your first choice: "; cin>>x; cout << "Enter your second choice: "; cin>>y; if ( x == 1 && y==2 || x==2 && y==1) { onetwo(); again(); } if (x==1 && y==3 || y==1 && x==3) { onethree(); again(); } if (x==1 && y==4 || y==1 && x==4) { onefour(); again(); } if (x==2 && y==3 || x==3 && y==2) { twothree(); again(); } if (x==2 && y==4 || x==4 && y==2) { twofour(); again(); } if (x==3 && y==4 || y==3 && x==4) { threefour(); again(); } if (x>=5 && y>=5) { cout<<"------------------------------------------------------------------------------\n"; cout<<"wrong choice, try again\n"; cout<<"------------------------------------------------------------------------------\n"; compare(); } if (x==y) { cout<<"------------------------------------------------------------------------------\n"; cout<<"they must be different, try again\n"; cout<<"------------------------------------------------------------------------------\n"; compare(); } } int main() //menu of all resources { cout<<"\n\nGreetings, This application keeps all track of the following resources for the Department of Computer Science\n"; cout<<"* Physical resources\n"; cout<<"* Human Hesources\n"; cout<<"* Intellectual Resources\n"; cout<<"* Financial Resources\n\n"; cout << "what option would you like to do today?\n"; //menu/functions to choose from cout << "1. Add details of each resource, then display such details" << endl; cout<<"2. Adds details of two different resources\n"; cout<<"3. Compares two different resource and states if they are the same\n"; cout<<"4. Show the name of the financial resource with the highest value\n"; cout<<"5. Swap occupations for two employees\n"; cout<<"6. Edit the intellectual resource’ description\n"; cout<<"7. Exit\n\n"; cout<<"--------------------------------------------------------------------------------------selection= "; string choice; do { if ( choice == "1" ) { addanddisplay(); } if (choice == "2") { choices(); } if (choice == "3") { compare(); } if (choice == "4") { highest(); } if (choice == "5") { swap(); } if (choice == "6") { interll(); } if (choice == "7") { exit(); } cin >> choice; }while (choice != "6"); cout << "Wrong asnwer!" << endl; } }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1042-qpid-38