Explore BrainMass
Share

Explore BrainMass

    PERL Programming

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Write a program called tripper.cgi that will ask the user the number of miles he has driven and the amount of gas he used. In the tripper script, write a subroutine called mileage that will calculate and return the user's mileage (miles per gallon). The number of miles driven and the amount of gas used will be passed as arguments. All variables should be my variables. Print the results. Prototype tripper.

    © BrainMass Inc. brainmass.com October 9, 2019, 6:30 pm ad1c9bdddf
    https://brainmass.com/computer-science/perl/perl-programming-script-89683

    Solution Preview

    #!/usr/bin/perl
    #===============================================================================
    #
    # FILE: tripper.pl
    #
    # USAGE: ./tripper.pl
    #
    # DESCRIPTION: Ask the user for miles driven and amount of gas consumed,
    # ...

    Solution Summary

    Write a program called tripper.cgi that will ask the user the number of miles he has driven and the amount of gas he used.

    $2.19