1. Engineering
  2. Computer Science
  3. i need help with this program in c please make...

Question: i need help with this program in c please make...

Question details
i need help with this program in c++ please make it work with microsoft visual studio
i have a skeleton that’s not finish below:

//Include the following

#include <iostream>
#include <string>
using namespace std;

//Prototypes for your functions: Input, Output, and Process will go here

void Input(string & cell_number, int & relays, int & call_length);
void Output(const string cell_number, const int relays, const int call_length, const double & net_cost, const double & call_tax, const double & total_cost_of_call);
void Process(const int relays, const int call_length, double & net_cost, double & call_tax, double & total_cost_of_call);     

//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.

//PURPOSE: SHOW ME THAT YOU KNOW HOW TO READ INPUT AND USE INPUT (CALL BY REFERENCE) & OUTPUT (CALL BY VALUE) PARAMETERS
//FORMAL PARAMETERS ARE: cell_number (string), relays (integer), call_length (integer)
//*************************************************************************************
void Input(string & cell_number, int & relays, int & call_length) // example of all formal parameter using the call by reference mechanism in C++
{
        cout<<"Enter your Cell Phone Number: ";
        cin>>cell_number;
        cout<<"Enter the number of relay stations: ";
        cin>>relays;
        cout<<"Enter the length of the call in minutes: ";
        cin>>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).
//*************************************************************************************

//NOTE: ALL FORMAL PARAMETERS ARE BEING PASSED BY VALUE. ALSO WE USED CONST TO MAKE SURE THEY WOULD NOT BE CHANGED BY MISTAKE
//      USED THE SAMPLE OUTPUT TO HELP YOU FORMAT YOU OUTPUT
void Output(const string cell_number, const int relays, const int call_length, const double & net_cost, const double & call_tax, const double & total_cost_of_call)
{
        //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);
        /********************************************/
        

}

///*************************************************************************************
//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 are 3 input parameter and 3 output parameters
void Process(const int relays, const int call_length, double & net_cost, double & call_tax, double & total_cost_of_call)
{
        //this is an example of a stub
        /*Step 1: put your code here to determine the cnet_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 <= 1  && relays <= 5 then  tax_rate is .01 and call_tax = net_cost * tax_rate
         condiion  2 if relays >=6 && relays <=1 then tax_rate is .03 and call_tax = net_cost * tax
         and so forth

         Step 3:put your code here to determine the total_cost using the formula: total_cost = net_cost + call_tax;

        */
}

//Here is your driver to test the program
int main( )
{
        string cell_number;
        int relays;
        int  call_length;
        double net_cost;
        double call_tax;
        double total_cost_of_call;

        

        Input(cell_number, relays, call_length);
        Process(relays, call_length, net_cost, call_tax, total_cost_of_call);
        Output(cell_number, relays, call_length, net_cost, call_tax, total_cost_of_call);


        return 0;
}

In this assignment you will implement a program called call infocpp that uses three functions, input, output, and process. You must use input and output parameters when implementing this program. The funetion input will get the input from the user, the function process will perform the necessary calculations required by your algorithm, and the function output will print the results and any output that needs to be printed. The program call infacpp will calculate the net cost of a call (net cost), the tax on a call (call lax) and the total cost of the call (total cost) The program should accept cell phone number (cell-num), the number of relay stations(relays), and the length in minutes of the cal (call length. Please consider the following I) The tax rate (in percent) on a call (call rate) is simply based on the number of relay stations (relays) used to make the call (eas5 then ax rate l%; 6e relays c-l l ten iar-rate-3%. I 2c-relays <-20 then aa_ rate- 5%; 21<-relays <=50 then Mx-rate-8%; relays >50 then tux-rate-12%) 2) The met cost of a call is calculated by the following formula: met cost-( relays /50.0 040call length. 3) The tax on a call is calculated by the following formula: call tax net cost tax rate/100 4). The total cost of a call (rounded to the nearest hundredth) is calculated by the following formula: total cost net cost + call tax All ta and cost cakculations should be rounded to the nearest hundredths. Use the following format information to print the variables: see next page.. Field Format Cell Phone Number of Relay Stations XxxxNX Minutes Used Net Cost Call Tax Total Cost of Cal XXNNNx.xx XXNxxxX.XX Handing in your program Electronically submit call infa.cpp in the Assignments area of Canvas before the due date and time. Remember, no late assignments will be graded Input Example: (Your pregram should prompt the user for input) Enter your Cell Phone Number: 9548267184 Enter the number of relay stations: 40
Minutes Used Net Cost Call Tax Total Cost of Call XXXXxX Handing in your program Electronically submit call infocpp in the Assignments area of Canvas before the due date and time. Remember, no late assignments will be graded. Input Example: (Your program should prompt the user for input Enter your Cell Phone Number: 9548267184 Enter the number of relay stations: 40 Enter the length of the call in minutes: 56 Output Example: (Your output should look lit this) Cell Phone Numbr: 9548267184 Number of Relay Stations: Length of Call in Minutes: Net Cost of Call 17.92 Tax of Call: 40 56 143 Total Cost of Call: 19.35 Ask the user if more calculations are necessary with the following prompt:
Handing in your program Electronically submit call info.cpp in the Assignments area of Canvas before the due date and time. Remember, no late assignments will be graded. Input Example: (Your program should prompt the user for input) Enter your Cell Phone Number: 9548267184 Enter the number of relay stations: 40 Enter the length of the call in minutes: 56 Output Example: (Your output should look lit this) Cell Phone Number: 9548267184 Number of Relay Stations: 40 Length of Call in Minutes: 56 Net Cost of Call: 17.92 Tax of Call 1.43 Total Cost of Call: 19.35 Ask the user if more calculations are necessary with the following prompt:
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution