Post a New Question

Programming Languages- NEED HELP!!

posted by on .

Create a program that determine the shipping cost for an order based on the following table:

From
$0.00
$20.00
$50.00
$75.00


To
$19.99
$49.99
$79.99
$1000.00

Price
$2.95
$3.95
$4.95
Free

  • Programming Languages- NEED HELP!! - ,

    here's some perl. Modify to suit your needs:

    @cost = (0.00,0.00,20.00,50.00,75.00);
    @ship = (0.00,2.95,3.95,4.95,0.00);
    while (1) {
    print "Enter order amount: \$";
    $c = <STDIN>;
    for ($i = $#cost ; $i > 0 ; $i--) {
    last if $c >= $cost[$i];
    }
    printf "Shipping: \$%4.2f\n",$ship[$i];
    }

  • Programming Languages- NEED HELP!! - ,

    My teacher said this is not the right. Were doing Raptor Program.

Answer This Question

First Name:
School Subject:
Answer:

Related Questions

More Related Questions

Post a New Question