Ask Question
8 December, 19:15

A large Internet merchandise provider determines its shipping charges based on the number of items purchased. As the number increases, the shipping charges proportionally decrease. This is done to encourage more purchases. If a single item is purchased the shipping charge is $2.99. When customers purchase between 2 and 5 items, they are charged the initial $2.99 for the first item and then $1.99 per item for the remaining items. For customers who purchase more than 5 items but less than 15, they are charged the initial $2.99 for the first item, $1.99 per item for items 2 through 5, and $1.49 per item for the remaining items. If they purchase 15 or more items, they are charged the initial $2.99 for the first item, $1.99 per item for items 2 through 5, and $1.49 per item for items 6 through 14 and then just $0.99 per item for the remaining items. Allow the user to enter the number of items purchased. Display the shipping charges.

+5
Answers (1)
  1. 8 December, 22:38
    0
    A C# programming language (console application) was used in this given question. below in the explanation section is the code used in executing the task that was carried out.

    Explanation:

    Solution

    C# Programming language code (Console Application):

    using System;

    using System. Collections. Generic;

    using System. Linq;

    using System. Text;

    using System. Threading. Tasks;

    namespace ShippingProgram

    {

    class Program

    {

    public static double ShippingCharge (int items)

    {

    if (items==1)

    {

    return 2.99;

    }

    else if ((items>=2) && (items<=5))

    {

    return (2.99) + ((items - 1) * 1.99);

    }

    else if ((items>5) && (items<15))

    {

    return (2.99) + (4 * 1.99) + ((items-5) * 1.49);

    }

    else

    {

    return (2.99) + (4 * 1.99) + ((10) * 1.49) + ((items-14) * 0.99);

    }

    }

    static void Main (string[] args)

    {

    System. Console. Write ("Enter the no of items: ");

    int n = Convert. ToInt16 (System. Console. ReadLine ());

    System. Console. WriteLine ("Your shipping charges are: $" + ShippingCharge (n));

    System. Console. ReadLine ();

    }

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “A large Internet merchandise provider determines its shipping charges based on the number of items purchased. As the number increases, the ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers