Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

C++ Code Cleanup/Fix- Can\'t Get Through the Errors. Help please. #include <iost

ID: 3828587 • Letter: C

Question

C++ Code Cleanup/Fix- Can't Get Through the Errors. Help please.

#include <iostream>

using namespace std;

class COP
{
public:
COP();
Node();
Node(const sender+orig);
Node(const reciever + orig);
sendmsg::sendmsg (string*Server)
{
m_sServer=Server;
}
sendmsg::sendmsg (string*from,string*to,string*subject,string*body);
Node::Node(const Node+origin)
{
next=original*next;
value=original*value
}
COP::COP()
bool COP ::hasmsg()
{
if(msg!=null)
return true;
else
return false;
}
void Node ::setmsg(node*new)
{
if (newmsg==null)
next =null;
else
next=newNext>next;
}
int Node ::getvalue()
{
return value();
}
};

int main()
{
srand(time(null));
int size = (rand()/500)+1;
int total = 0;
int counter = 0;
cout<<"Total msg:"<<size << endl;
cout<<head >getNext>getValue();
Node*current=head
while (current!=Null)
{
counter + =current>getvalue();
current=current>getNext();
total++;
}
cout<<"Tracked"<<total<<"nodes with a total count of"<<counter<<endl;
}

That's the code I have so far, this is the initial problem:

Cell phone data is accumulated through COP, the civilian observation program, 24-7. Create a simulation that consists of 1) a list of communication nodes that are sender/receivers. Randomly choose a number of nodes and mark them with a bool AGENT as true, all others are false. THEN randomly choose source and destination nodes from that list, display that pair, and if at least one of the two nodes is AGENT=true, add that data pair to a multimap of those ids. This is the NSA listening to us. If there are 500 nodes in the initial list, Display how many data pairs must be generated until ALL nodes with the bool AGENT=true is mapped? (Who talks to them is not important, only that they are contacted). Then Display all the communications to the AGENT nodes, who they are to and who they are from. All other communications can be ignored.

These are the errors I get, if anyone can fix it so it works, please do so! As long as it works and fits the questions parameters, change it as much as you want.

|10|error: 'sender' does not name a type|
|10|error: expected ',' or '...' before '+' token|
|11|error: 'reciever' does not name a type|
|11|error: expected ',' or '...' before '+' token|
|11|error: 'int COP::Node(int)' cannot be overloaded|
|10|error: with 'int COP::Node(int)'|
|12|error: 'sendmsg' does not name a type|
|16|error: 'sendmsg' does not name a type|
|17|error: 'Node' does not name a type|
|22|error: extra qualification 'COP::' on member 'COP' [-fpermissive]|
|22|error: expected ';' at end of member declaration|
|22|error: 'COP::COP()' cannot be overloaded|
|8|error: with 'COP::COP()'|
|23|error: extra qualification 'COP::' on member 'hasmsg' [-fpermissive]|
|30|error: 'Node' is not a class, namespace, or enumeration|
|30|error: 'node' has not been declared|
|30|error: expected ',' or '...' before 'new'|
|37|error: 'Node' is not a class, namespace, or enumeration|
||In member function 'bool COP::hasmsg()':|
|25|error: 'msg' was not declared in this scope|
|25|error: 'null' was not declared in this scope|
||In member function 'void COP::setmsg(int*)':|
|32|error: 'newmsg' was not declared in this scope|
|32|error: 'null' was not declared in this scope|
|35|error: 'newNext' was not declared in this scope|
||In member function 'int COP::getvalue()':|
|39|error: 'value' was not declared in this scope|
||In function 'int main()':|
|45|error: 'null' was not declared in this scope|
|45|error: 'time' was not declared in this scope|
|45|error: 'srand' was not declared in this scope|
|46|error: 'rand' was not declared in this scope|
|50|error: 'head' was not declared in this scope|
|50|error: 'getNext' was not declared in this scope|
|50|error: 'getValue' was not declared in this scope|
|51|error: 'Node' was not declared in this scope|
|51|error: 'current' was not declared in this scope|   

Explanation / Answer

#include <iostream>

using namespace std;

class COP
{
public:
COP();
Node();
Node(const sender+orig);
Node(const reciever + orig);
sendmsg::sendmsg (string*Server)
{
m_sServer=Server;
}
sendmsg::sendmsg (string*from,string*to,string*subject,string*body);
Node::Node(const Node+origin)
{
next=original*next;
value=original*value
}
COP::COP()
bool COP ::hasmsg()
{
if(msg!=null)
return true;
else
return false;
}
void Node ::setmsg(node*new)
{
if (newmsg==null)
next =null;
else
next=newNext>next;
}
int Node ::getvalue()
{
return value();
}
};

int main()
{
srand(time(null));
int size = (rand()/500)+1;
int total = 0;
int counter = 0;
cout<<"Total msg:"<<size << endl;
cout<<head >getNext>getValue();
Node*current=head
while (current!=Null)
{
counter + =current>getvalue();
current=current>getNext();
total++;
}
cout<<"Tracked"<<total<<" nodes with a total count of"<<counter<<endl;
}