Answer:
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.
Step-by-step 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();
}
}
}