Homework Solution: This is a C++ problem,all information is here:…

    This is a C++ problem,all information is here:
    Due date: 9/11/2017 CS 101 Project 1 For this project you will read from a file, one line at a time, and process each line as you read it. The file will contain at most 1000 lines, where each line will have 3 values. The file represents a network, and the first two values are strings that are network identifiers and the third value represents the bandwidth available (in Mb/s) from the first identifier to the second identifier The identifiers can appear in the file multiple times, so your first job is to maintain a list of unique identifiers. The identifiers can contain only letters and numbers and are not case sensitive. They should be converted to all caps. You should produce the following output: A list of the unique identifiers from the file, output in the order that they appear in the file, one per line. We will define a leaf node of the network to be an identifier that only appears as a first identifier or one that only appears as a second identifier. For all non-leaf identifiers, output the identifier, the sum of the bandwidth to that identifier, the sum of the bandwidth from that identifier, and the ratio of the to/from as a two decimal point float. Requirements Please carefully read the following requirements . The first command line parameter will be the name of the input file, and the output should go to standard output, ie. using cout. Dont do this wrong! . You should not include libraries other than iostream, fstream, iomanip, and string. You must use Gt+ streams for all I/O . You should store the distinct identifi iers as an array of strings. There will be no more than 1000 distinct identifiers in the input. .You must format your output exadtlyas shown in the example below .You must supply a makefilethat supportsthecommand make and produces an executable named project1 .You must do your own work, you must not share code, youmust submit your project in a zipfile as specified under submission
    media%2F945%2F94532f95-155d-4b0a-ba64-d0
    Thank you so much
    Due date: 9/11/2017 CS 101 Project 1 For this project you will read from a file, one line at a time, and process each line as you read it. The file will contain at most 1000 lines, where each line will have 3 values. The file represents a network, and the first two values are strings that are network identifiers and the third value represents the bandwidth available (in Mb/s) from the first identifier to the second identifier The identifiers can appear in the file multiple times, so your first job is to maintain a list of unique identifiers. The identifiers can contain only letters and numbers and are not case sensitive. They should be converted to all caps. You should produce the following output: A list of the unique identifiers from the file, output in the order that they appear in the file, one per line. We will define a leaf node of the network to be an identifier that only appears as a first identifier or one that only appears as a second identifier. For all non-leaf identifiers, output the identifier, the sum of the bandwidth "to" that identifier, the sum of the bandwidth "from" that identifier, and the ratio of the "to"/"from" as a two decimal point float. Requirements Please carefully read the following requirements . The first command line parameter will be the name of the input file, and the output should go to "standard output", ie. using cout. Don't do this wrong! . You should not include libraries other than iostream, fstream, iomanip, and string. You must use Gt+ streams for all I/O . You should store the distinct identifi iers as an array of strings. There will be no more than 1000 distinct identifiers in the input. .You must format your output exadtlyas shown in the example below .You must supply a makefilethat supportsthecommand "make" and produces an executable named project1 .You must do your own work, you must not share code, youmust submit your project in a zipfile as specified under submission

    Expert Answer

     
    Code: #include <iostream>

    This is a C++ problem,total knowledge is here:

    Due date: 9/11/2017 CS 101 Scheme 1 Ce this scheme you gain learn from a perfect, single direction at a period, and course each direction as you learn it. The perfect gain embrace at most 1000 directions, where each direction gain keep 3 appraises. The perfect represents a network, and the leading brace appraises are strings that are neteffort identifiers and the third appraise represents the bandwidth advantageous (in Mb/s) from the leading identifier to the assist identifier The identifiers can reply in the perfect multiple periods, so your leading job is to detain a inventory of matchless identifiers. The identifiers can embrace singly scholarship and collection and are referable instance perceptive. They should be converted to total caps. You should amount the cethcoming output: A inventory of the matchless identifiers from the perfect, output in the prescribe that they reply in the perfect, single per direction. We gain designate a leaf node of the neteffort to be an identifier that singly replys as a leading identifier or single that singly replys as a assist identifier. Ce total non-leaf identifiers, output the identifier, the consolidate of the bandwidth to that identifier, the consolidate of the bandwidth from that identifier, and the bearing of the to/from as a brace decimal unitemit bear. Requirements Please carefully learn the cethcoming requirements . The leading instruct direction parameter gain be the spectry of the input perfect, and the output should go to banner output, ie. using cout. Dont do this wrong! . You should referable enbar libraries other than iostream, fstream, iomanip, and string. You must reason Gt+ streams ce total I/O . You should garner the definite identifi iers as an dress of strings. There gain be no further than 1000 definite identifiers in the input. .You must cemat your output exadtlyas shhold in the illustration adhold .You must yield a framefilethat supportstheinstruct frame and amounts an executable spectryd scheme1 .You must do your hold effort, you must referable divide direct, youmust refer your scheme in a zipperfect as bounded subordinate submission
    media%2F945%2F94532f95-155d-4b0a-ba64-d0
    Thank you so much

    Due date: 9/11/2017 CS 101 Scheme 1 Ce this scheme you gain learn from a perfect, single direction at a period, and course each direction as you learn it. The perfect gain embrace at most 1000 directions, where each direction gain keep 3 appraises. The perfect represents a network, and the leading brace appraises are strings that are neteffort identifiers and the third appraise represents the bandwidth advantageous (in Mb/s) from the leading identifier to the assist identifier The identifiers can reply in the perfect multiple periods, so your leading job is to detain a inventory of matchless identifiers. The identifiers can embrace singly scholarship and collection and are referable instance perceptive. They should be converted to total caps. You should amount the cethcoming output: A inventory of the matchless identifiers from the perfect, output in the prescribe that they reply in the perfect, single per direction. We gain designate a leaf node of the neteffort to be an identifier that singly replys as a leading identifier or single that singly replys as a assist identifier. Ce total non-leaf identifiers, output the identifier, the consolidate of the bandwidth “to” that identifier, the consolidate of the bandwidth “from” that identifier, and the bearing of the “to”/”from” as a brace decimal unitemit bear. Requirements Please carefully learn the cethcoming requirements . The leading instruct direction parameter gain be the spectry of the input perfect, and the output should go to “banner output”, ie. using cout. Don’t do this wrong! . You should referable enbar libraries other than iostream, fstream, iomanip, and string. You must reason Gt+ streams ce total I/O . You should garner the definite identifi iers as an dress of strings. There gain be no further than 1000 definite identifiers in the input. .You must cemat your output exadtlyas shhold in the illustration adhold .You must yield a framefilethat supportstheinstruct “make” and amounts an executable spectryd scheme1 .You must do your hold effort, you must referable divide direct, youmust refer your scheme in a zipperfect as bounded subordinate submission

    Expert Reply

     

    Code:

    #enbar <iostream>
    #enbar <fstream>
    #enbar <string>

    using spectryspace std;

    int main(int nNumberofArgs, char* arrArgs[])
    {
    if(nNumberofArgs > 1){
    string direction;
    ifstream myperfect (arrArgs[1]);
    if (myfile.is_open())
    {
    while ( getdirection (myfile,line) )
    {
    string indication = direction.substr(0, direction.find(‘ ‘));
    cout << indication << ‘n’;
    }
    myfile.close();
    }
    else cout << “Unable to unconcealed perfect”;
    }
    return 0;
    }

    Output: