Question: Does my code look right for this c++ assignment? Please help, if not how can I make it better? #include using namespace std; struct lead

Does my code look right for this c++ assignment? Please help, if not how can I make it better?
#includeusing namespace std; struct lead { string name; bool active; int budget; }; int enterLeads(lead *leads); void display(lead *leads, int n); int main () { lead *leads; int n; cout > n; leads = new lead[n]; int size = enterLeads(leads); display(leads,size); } int enterLeads(lead *leads) { int i = 0; char ch; do { cout > leads[i].name; cout > ch; leads[i].active = ch=='y' || ch =='Y'; cout > leads[i].budget; i++; cout > ch; } while(ch == 'y' || ch == 'Y'); return i; } void display(lead *leads, int n) { char ch; cout > ch; for (int i = 0; i if (((ch == 'y' || ch == 'Y') && leads[i].active) || (ch != 'y' && ch != 'Y')) { cout
Assignment InstructionsA pany to help keep track of current sales leads. This co You have been asked to work for a conm on these leads to call and schedule meetings for their sales reps. They have asked you to create a simple data entry program that will allow them to input their leads into the system and retrieve their leads. mpany relies Here's how it should work: . Please create your struct inside of your main.cpp. don't use a header file to make uploading easy. The leads should be an array or vector of type struct called "Leads". You can size the array as you would like or you can make it a dynamic array/vector asking the user how many leads they have to enter. Your choice. Write a function called enterLead0 that will take a struct and populate its data. This means to assign values to all of the member variables and return the struct to main. Make sure to store the data back inside of the struct array. . The leads should have this data: o string name name of lead or business o boolean active the lead can be active or inactive. (write functionality to interpret "y" and "n" e console as true and false assignments from th o int budget Write a void function called display0 to display each element of the struct at the end of the program, call display and pass it the array of structs. o inside of display ask the user if they would like t all leadsf yes ('y), check each struct element and only display the elements that active is assigned true with. o if N, simply display all leads
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
