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

create a C++ program using Visual Studio where you design a PhoneCall class that

ID: 3561477 • Letter: C

Question

create a C++ program using Visual Studio where you design a PhoneCall class that holds a phone number to which a call is placed, the length of the call in minutes, and the rate charged per minute. Overload extraction and insertion operators for the class. In this program, overload the == operator to compare two PhoneCalls. Consider one PhoneCall to be equal to another if both calls are placed to the same number. Also, create a main() function that allows you to enter ten PhoneCalls into an array. If a PhoneCall has already been placed to a number, do not allow a second PhoneCall to the same number. Save the file as PhoneCall.cpp. Compile this application using Visual Studio and run it to make sure it is error free. Please attach your project folder in a zip file when submitting.

GRADING RUBRIC:

- define a class named PhoneCall

- private fields for the phone number to which a call is placed, the length of the call in minutes, and the rate charged per minute

- public function(s) setting the private fields

- public function that displays a PhoneCall's data

- overload extraction (>>) operator, insertion (<<) operator, == operator

- main() function in which you declare 10 PhoneCall using user-entered values, exclude entries with existing phone numbers, and display the 10 valid PhoneCall objects

Explanation / Answer

#include #include using namespace std; class PhoneCall { private: string phonenumber; double perminuterate; double calldurationminutes; public: bool operator==( const PhoneCall &n ) const; friend ostream & operator( istream &f, PhoneCall &n ); }; bool PhoneCall::operator==( const PhoneCall &n ) const { return phonenumber == n.phonenumber; }; ostream & operator