Jeff
08-30-2008, 02:53 AM
Guys, I need some help! Here is the assignment -
Students at a certain University pay $90.00 per credit hour for all credit hours less than 12. If they enroll in 12 or more credit hours, thus becoming a full-time student, they pay a flat rate of $1100.00. All full-time students pay a $100.00 technology fee, and a $125.00 debt service fee. Students who are dependents of employees receive a 50-percent reduction on their basic fees but not on the additional fees.
Design an ASP.NET web page that accepts the number of credit hours and a Yes/No answer as to whether the student is a dependent and displays all fees separately and the total amount of fees due with appropriate labels. Include a printed message to those who receive a reduction in fees.
Include a CALCULATE button and a CLEAR button
Here is my code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
Number of credit hours
<asp:TextBox ID="CreditHours" runat="server" Height="23px" Width="33px"></asp:TextBox>
<div>
Are you a dependant student?
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
</div>
<asp:Button ID="Calculate" runat="server" Text="Calculate"/>
<asp:Button ID="Clear" runat="server" Text="Clear" />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label><p>
</p>
</form>
</body>
</html>
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Calculate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calculate.Click
Dim tuition As Integer
Dim totalfees As Integer
Dim hours As Integer
Dim techfee = 100
Dim debtfee = 250
Dim Label1
hours = CInt(CreditHours.Text)
tuition = 1100
If hours < 12 Then
tuition = hours * 90
End If
If DropDownList1.SelectedValue = "Yes" Then
tuition = tuition * 0.5
End If
totalfees = tuition + techfee + debtfee
Document.write("Technical Fees: $100")
Document.write("Debt Services Fee: 250")
Document.write("Total Fees and Tuition: " & totalfees.ToString)
Label1.Text = "Total tuition and fees: " & totalfees.ToString
End Sub
End Class
Students at a certain University pay $90.00 per credit hour for all credit hours less than 12. If they enroll in 12 or more credit hours, thus becoming a full-time student, they pay a flat rate of $1100.00. All full-time students pay a $100.00 technology fee, and a $125.00 debt service fee. Students who are dependents of employees receive a 50-percent reduction on their basic fees but not on the additional fees.
Design an ASP.NET web page that accepts the number of credit hours and a Yes/No answer as to whether the student is a dependent and displays all fees separately and the total amount of fees due with appropriate labels. Include a printed message to those who receive a reduction in fees.
Include a CALCULATE button and a CLEAR button
Here is my code
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_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>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
Number of credit hours
<asp:TextBox ID="CreditHours" runat="server" Height="23px" Width="33px"></asp:TextBox>
<div>
Are you a dependant student?
<asp:DropDownList ID="DropDownList1" runat="server">
<asp:ListItem>Yes</asp:ListItem>
<asp:ListItem>No</asp:ListItem>
</asp:DropDownList>
</div>
<asp:Button ID="Calculate" runat="server" Text="Calculate"/>
<asp:Button ID="Clear" runat="server" Text="Clear" />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label><p>
</p>
</form>
</body>
</html>
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Calculate_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Calculate.Click
Dim tuition As Integer
Dim totalfees As Integer
Dim hours As Integer
Dim techfee = 100
Dim debtfee = 250
Dim Label1
hours = CInt(CreditHours.Text)
tuition = 1100
If hours < 12 Then
tuition = hours * 90
End If
If DropDownList1.SelectedValue = "Yes" Then
tuition = tuition * 0.5
End If
totalfees = tuition + techfee + debtfee
Document.write("Technical Fees: $100")
Document.write("Debt Services Fee: 250")
Document.write("Total Fees and Tuition: " & totalfees.ToString)
Label1.Text = "Total tuition and fees: " & totalfees.ToString
End Sub
End Class