I need this is C Visual studio NOT BASIC Internet service pr
I need this is C#, Visual studio, NOT BASIC.
Internet service provider, part 1
An internet service provider offers three subscription packages to its customers, plus a discount for nonprofit organizations:
a. Package A: 10 hours of access for $9.95 a month. Additional Hours are $2.00 per hour
b. Package B: 20 hours of access for $14.95 per month. Additional hours are $1.00 per hour
c. Package C: Unilimited access for $19.95
d/ Nonprofit organizations: The service provider gives all nonprofit organizations 20% discount on all packages.
The user should select the package the customer has purchased (from a set of radio buttons) and enter the number of hours used. A check box captioned Nonprofit Organization should also appear on the form. The application should calculate and display the total amount due. If the user selects the nonprofit organization check box, a 20% discount should be deducted from the final charges. Implementation note: all rates, limits, and discounts must be declared using symbolic constants (using the const keyword)
Solution
For this Solution. You need two files one is the file for UI which is .aspx and the other one is the code behind that file.
The two files with the code are:-
Default.aspx
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
<%@ Page Language=\"C#\" AutoEventWireup=\"true\" CodeBehind=\"Default.aspx.cs\" Inherits=\"WebApplication1._Default\" %>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head runat=\"server\">
<title></title>
</head>
<body>
<form id=\"form1\" runat=\"server\">
<div>
ISP Packages<br />
<asp:RadioButtonList ID=\"rblPackage\" runat=\"server\">
<asp:ListItem Value=\"0\">Package A</asp:ListItem>
<asp:ListItem Value=\"1\">Package B</asp:ListItem>
<asp:ListItem Value=\"2\">Package C</asp:ListItem>
</asp:RadioButtonList>
Enter No. Of Hours
<asp:TextBox ID=\"txtNoOfHours\" runat=\"server\">0</asp:TextBox>
<br />
<asp:CheckBox ID=\"chkNGO\" runat=\"server\" Text=\"Non-Profit Organization\" />
<br />
<br />
<asp:Button ID=\"Button1\" runat=\"server\" OnClick=\"Button1_Click\" Text=\"Submit\" />
<br />
Result: <asp:Label ID=\"lblResult\" runat=\"server\" Text=\"Label\"></asp:Label>
<br />
</div>
</form>
</body>
</html>
----------------------------------------------------------------------------------------------------------------------------------------------------------------------
Default.cs
---------------------------------------------------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication1
{
public partial class _Default : System.Web.UI.Page
{
const int a = 10, b = 20;
const double a_add = 2, b_add = 1, a_cost = 9.95, b_cost = 14.95, c_cost = 19.95;
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
double noOfhours = Convert.ToDouble(txtNoOfHours.Text);
double finalCost = 0;
if (rblPackage.SelectedValue == \"0\")
{
if (noOfhours <= 10)
finalCost = a_cost;
else
{
noOfhours = (noOfhours - a) * a_add;
noOfhours = noOfhours + a_cost;
finalCost = noOfhours;
}
}
else if (rblPackage.SelectedValue == \"1\")
{
if (noOfhours <= 20)
finalCost = b_cost;
else
{
noOfhours = (noOfhours - b) * b_add;
noOfhours = noOfhours + b_cost;
finalCost = noOfhours;
}
}
else if (rblPackage.SelectedValue == \"2\")
{
finalCost = c_cost;
}
if (chkNGO.Checked == true)
{
finalCost = finalCost * 0.8;
}
lblResult.Text = finalCost.ToString();
}
}
}
---------------------------------------------------------------------------------------------------------------------------------------------------------------------


