Answer to Question #304535 in C++ for Maneo

Question #304535

I have tried to do the question but it got tricky for me to complete it.


the question is on the following link

https://drive.google.com/file/d/17kEiEoJFVYfc2zLqDdPskPKBD_MTjpKu/view?usp=sharing


what I have done so far is on the following link:

https://drive.google.com/file/d/1N_Y0Fqr0zEbvd0JrYWs1JJWmz_k4bAZC/view?usp=sharing


please assist


1
Expert's answer
2022-03-02T01:17:26-0500
#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;
}

}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog