Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need to write overloading function in this c++, feel free to add a any idea that help the idea of this code, plz don't

i need to write overloading function in this c++, feel free to add a any idea that help the idea of this code, plz don't delete or replace any thing just add new function, and write the whole code after the changes

#include #include #include #include #include #include #include using namespace std; const int size = 5 ; string services [size]= {"Robbery ", "Violation ", "Medical ","Fire "};//The menu string search; string Thesrevice; int random; struct Info { string name; string age; string location; string AdditionalNote; }; void Ask(string &z){// Function for Searching in array cout<< " Your emergency?"; cout << endl; cin>> z; for (int i = 0 ; i< size ; i++){ if (services[i].find(z,0)!= string::npos){ cout<< "Your choice is "<< services[i]<> array[0].name>>array[1].age>>array[2].location>> array[3].AdditionalNote; } long int R(){ srand(time(0)); random =rand(); cout <<" "<< "Operation Number: "<

int main(){ string* temp = new string[size]; string tem; Info* Array = new Info[5]; string answer; string repla; cout<< " 911 What's your emergency? " ; cout<< endl; for(int i = 0; i=size) NewIndex=NewIndex % size; temp[NewIndex]= services[i]; ;} cout<< "The new order:"<< endl; for (int i =0; iservices [y]){ tem=services [x]; services [x]=services [y]; services [y]=tem;}}} cout << " Alphabetical order of servisec : "; for (int x = 0; x < size; x++) cout << services [x] << "\t"; cout << endl; Ask(search);} cout<

cout<<"Okay " << Array[0].name << " calm down, we will send you help "; cout<> answer; if (answer == "2"){ string Qrep; string Qrepp; string rep; int repp; int replaa; cout<<"Do you want to replace? Enter Y or N"<< endl; //Adding value cin>> Qrep; if(Qrep == "Y"){ // Updating values cout << "Enter your wrong answer "; cin>> rep; cout << "Write your replacementt:"; cin>> repla; if(Array[0].name== rep) Array[0].name=repla; if(Array[1].age== rep) Array[1].age=repla; if(Array[2].location== rep) Array[2].location=repla; if(Array[3].AdditionalNote== rep) Array[3].AdditionalNote= repla; } if (Qrep == "N"){ R(); } } cout<<"Okay " << Array[0].name << " Your updated data: "; cout<

return 0; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 1 Lncs 13426

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124227, 978-3031124228

More Books

Students also viewed these Databases questions

Question

1-4 How will MIS help my career?

Answered: 1 week ago