Question: i need help with this program in c++ the skeleton of the program is below: //Include the following #include #include #include //you must include this

i need help with this program in c++
the skeleton of the program is below:
  
//Include the following
#include
#include
#include //you must include this library if you wish to do file i/o
using namespace std;
/*********************************************************
//Following is the declaration of a call record
**********************************************************/
class call_record
{
public:
string cell_number;
int relays;
int call_length;
double net_cost;
double tax_rate;
double call_tax;
double total_cost;
};
//Prototypes for your functions: Input, Output, and Process will go here
void Input(ifstream &,call_record &);
void Output(const call_record &);
void Process(call_record &);
//Function Implementations will go here
///*************************************************************************************
//Name: Input
//Precondition: State what is true before the function is called.
// Example: the varialbes (formal parameters) have not been initialized
//Postcondition: State what is true after the function has executed.
// Example: the varaibles (formal parameters) have been initialized
//Description:
// Example:Get input (values of cell_number, relays, and call_length) from the user and store in call record.
//PURPOSE: SHOW ME THAT YOU KNOW HOW TO READ INPUT AND USE INPUT (CALL BY VALUE) & OUTPUT (CALL BY VALUE) PARAMETERS
//*************************************************************************************
void Input(ifstream & in, call_record & customer_record) // example using the call by reference mechanism in C++ -- call record is passed by reference --note & operator
{
in>>customer_record.cell_number;
in>>customer_record.relays;
in>>customer_record.call_length;
}
///*************************************************************************************
//Name: Output
//Precondition: State what is true before the function is called.
//Postcondition: State what is true after the function has executed.
//Description: Describe what the function does (purpose).
//*************************************************************************************
void Output(const call_record & customer_record)
{
//Use thee following statement to help you format you our output. These statements are called the magic formula.
cout.setf(ios::showpoint);
cout.precision(2);
cout.setf(ios::fixed);
/********************************************/
cout
cout
cout
}
///*************************************************************************************
//Name: Process
//Precondition: The state what is true before the function is called.
//Postcondition: State what is true after the function has executed.
//Description: Describe what the function does (purpose).
//*************************************************************************************
//Note: there is one 1 input/output parameter
void Process(call_record & customer_record)
{
//this is an example of a stub
/*Step 1: put your code here to determine the net_cost using the formula: relays / 50.0 * .40 * call_length;
Step 2: put your if-else statement here to determine the tax rate.
condition 1 if relays
condiion 2 if relays >=6 && relays
and so forth
Step 3:put your code here to determine the total_cost using the formula: total_cost = net_cost + call_tax;
Note store all values in your call record
*/
}
//Here is your driver to test the program
int main( )
{
call_record customer_record;
ifstream in; //declaring an input file stream
in.open("call_data.txt");
if (in.fail())
{
cout
}
else
{
while (!in.eof())
{
Input(in,customer_record);
Process(customer_record);
Output(customer_record);
}
}
in.close();
return 0;
}
 i need help with this program in c++ the skeleton of
the program is below: //Include the following #include #include #include //you must
include this library if you wish to do file i/o using namespace
std; /********************************************************* //Following is the declaration of a call record **********************************************************/ class
1. Read the contents ef a datafilel one record at a time; 2. Process the data that was read frem the datafile one record at a time: 3. Be able to use the fstream library 4. Be able to use records (class with only data); S. Be able to use an ifstream ebject This assignment is an extension of Assignment#1 . You will implement a program call record contains seven fields, which are as follows: 1) a ten digit cell phone number (string, no dashes), 2) the number of relay stations used in making the call (integer), 3) the length of the call in minutes (integer), 4) the net cost of the call (double), 5) the tax rate (doubleL 6) the call tax (double) and 7) the total cost of the call (double). Your program will have 3 functions: Input, Process and Output. Your main program will call each function until the end of the datafile has been read. Following are the descriptions of the functionality of each function: to process customer call records. Each customer 1The void function "h purr, will have two parameters: an input file stream called in", and a customer call record called "call records" The functiorn will read the cell number, relays, and call length, in minutes, into the a call record from the data file. 2. The function "Precess" will calculate the net cost of a call (net cost), the tax on a call (call sax) and the total cost of the call (total cost) using the number of relay stations (relays) and the length in minutes of the call (call length) for a call recoed Please consider the following: The ter rate on a call (call-tox) s simply based on the number of relay stations (relays) used to make the call (-relays50 then call tax-12%) The met cost ef a call is calculated by the following fomula: met cst-rels/50 x 0.40 x call length) b. c. The ax on a call is equal to net cost x call ax/100 d. The total cost of a call (rounded to the nearest hundredth) is calculated by the follow ing formala total cost met cost+ call x. All tax and cost calculations should be rounded to the nearest hundredths 3. The function "Outur" will print every field of a call record. The fields should be printed in the following order: 1) cell phone number, 2) number of relay stations, 3) length of the call in minutes, 4) net cost, 5) tax rate, 6) call tax, 7)total cost of call. See the sections below called "Input Stream" and Format of Output" for more information. See the section "Format of the input data filelinput filename is call data.xr You may implement assignment ASAP and ask questions to make sure you understand what you must do. Remember to follow all style nules and to include all necessary documentation (oonsistent, indentation, proper variable names, pre post condition, program header, function headers, and so forth.) more functions if you find it necessary. Please start the Finally, your input data file (call data txt) should be in the same directory as your program source file (call Satscpph c. The tax on call is equal to net cost xcall tax / 10 d. The total cost of a call (rownded to the nearest hundredth) is calculated by the following formula: sotal cos-net cst+ call fax. All tax and cost calculations should be rounded to the nearest hundredths 3. The function "Output" will print every field of a call record. The fields should be printed in the following order: 1) cell phone number, 2) mumber of relay stations, 3) length of the call in minutes, 4) net cost, 5) tax rate, 6) call tax, 7) total cost of call. See the sections below called "Imput Stream" and "Format of Output" for more information. See the section "Format of the input data file(input filename is "calldata.txf" You may implement assignment ASAP and ask questions to make sure you understand what you must do. Remember to follow all style rules and to include all necessary documentation (consistent, indentation, proper variable names, preipost condition, program header, function headers, and so forth) more functions if you find it necessary Please start the Finally, your input data file (call data.tut) should be in the same directory as your program source file (call Stats cppl Output Format for the Function Ougur Consider the following sample output table when designing and implementing the function "Outpur" The output is in the following order cell phone number, relays, minutes, net cost, tax rate, call tax, total call cost) 9546321555 0 0000 001 0.00 0.00 9546321555 15 30 360 005 01838 9546321555 3 0.10 001 0.00 010 Input Stream: In the assignment you will declare one ifstream to bind your input to the file call data.Ext" Whenever a program performs file ilo you must include the "Istream" library. Add the following statements to your program For source file, "callstats pp" Add-#include " to your # include statements in your source file Add "include to your # include statements in your source file. * 3 of 4 In the assignment you will declare one ifstream to bind your imput to the fike call data.xt"Whenever a program performs file ie you must inclade the library. Add the following statements to your program For source file, "call stats epp Add "ginclude " to your # include statements in your source file Add "include to your # include statements your source Format of the input data ilelimput filename is "call dataof : Do not include celumn titles The order of the columns are as follows: cell phone number, relays, minutes) 5612971340 546321555 5612971340 9544321011 8776219988 7877176590 Format of Output: (cell phone number, relays, minutes, net cost, tax rate, call tax, total call cost) 9546321555 5612971340 0.00 002 200 1.60 001 2 4 of 4 7877176590 Format of Output: (cell phone namber, relays, minutes, net cost, tax rate, call tax, total call cost) 0.00 200 612971340 40.00 57.07 0.16 0 08 0.12 617278899 7.20 0.06 5612971340 54 35 0.12 2266 23.00 47.70 17.92 561727889 Handing in your program Electronically submit the source file "call statscpp" in the Assignments area of blackboard before the due date and time. Remember, no late assignments will be accepted

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!