Need help on VB 2003.Net

Question 1

Create an application that displays a letter grade based on the average of three test scores entered by Professor John. Each test is worth 100 points. Verify that the test scores entered by the professor are numeric. Use the following information to complete the application:

Test Average

Grade

90-100

A

80-89

B

70-79

C

60-69

D

Below 60

F

 

 

I'm lost anyone can help please? Crying 

 

0
LinkZ
9/4/2007 3:08:14 PM
asp.net.vs2002-vs2003 3502 articles. 0 followers. Follow

2 Replies
550 Views

Similar Articles

[PageSpeed] 14

 The required aspx is

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Sum.aspx.cs" Inherits="Sum" %>
<!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>Score Grader</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
      <table>
        <tr>
          <td>Score 1</td>
          <td><asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
          <td>Score 2</td>
          <td><asp:TextBox ID="TextBox2" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
          <td>Score 3</td>
          <td><asp:TextBox ID="TextBox3" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
          <td>&nbsp;</td>
          <td><asp:Button ID="cmdCalculate" runat="server" Text="Calculate" OnClick="cmdCalculate_Click" /></td>
        </tr> 
        <tr>
          <td>Grade</td>
          <td runat="server" id="tddResult"></td>
        </tr> 
      </table>
    </div>
  </form>
</body>
</html>

The code behind is:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Sum : System.Web.UI.Page
{
  private const string FILTER_INTEGER = "0123456789-";
  protected void Page_Load(object sender, EventArgs e)
  {
  }
  protected void cmdCalculate_Click(object sender, EventArgs e)
  {
    int iSum = System.Convert.ToInt32("0" + FilterInteger(TextBox1.Text))
      + System.Convert.ToInt32("0" + FilterInteger(TextBox2.Text))
      + System.Convert.ToInt32("0" + FilterInteger(TextBox3.Text));
    tddResult.InnerText = "F";
    if (iSum >= 180) tddResult.InnerText = "D";
    if (iSum >= 210) tddResult.InnerText = "C";
    if (iSum >= 240) tddResult.InnerText = "B";
    if (iSum >= 270) tddResult.InnerText = "A";
  }
  public string FilterInteger(string sIn)
  {
    bool bDataDropped = false;
    return FilterWorker(sIn, FILTER_INTEGER, ref bDataDropped);
  }
  private string FilterWorker(string sIn, string sValid, ref bool bDataDropped)
  {
    try
    {
      bDataDropped = false;
      if (sIn.Length == 0) return sIn;
      string sOutput = "";
      for (int iLoop = 0; iLoop < sIn.Length; iLoop++)
      {
        string sValue = sIn.Substring(iLoop, 1);
        if (sValid.IndexOf(sValue) >= 0) // sValue is valid!
          sOutput += sValue;
        else
          bDataDropped = true;
      }
      return sOutput;
    }
    catch (Exception ex)
    {
      return sIn;
    }
  }
}


Don't forget to click "Mark as Answer" on the post that helped you.
This credits that member, earns you a point and marks your thread as Resolved so we will all know you have been helped.
0
TATWORTH
9/4/2007 8:42:05 PM
Thanks mate! Cheers
0
LinkZ
9/5/2007 12:28:45 AM
Reply:

Similar Artilces:

Upgrade VB.net 2002 to VB.net 2003
Hi, i want to upgrade VB.net 2002 to VB.net 2003.what is the procedure?Uninstall 2002 and Install 2003 or something else? VB.net 2003 includes Framework 1.1 or i will install it separately?thanx in advance ...

converting vb.net 2003 files to vb.net 2005
Hi, i am beginner..i watch videos about vb.net..they made on vs.net 2003 when i wrote these codes in 2005 ,it gives errors..is there any program which convert the code automatically?   thanks,Thanks,Speranza What videos are you talking about?  There are lots of great, up-to-date ASP.NET Videos on this site for free.Darrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! i am talking about learnvisualstudio.net videos..Thanks,Speranza Speranza:they made on vs.net 2003 when i wrote these codes in 2005 ,it gives errors..is there a...

Sending SMS using vb.net or C#.net using vb.net or c#.net
Hi  My requirement is I hav one csv file with these fields id,mobilenum,messgae,status.intiallu staus is 0. once i read the all fileds and take that mobile number.using tat mobile number  i need to send sms .after sending sms i shuld change status as 1 How to send sms thru coding (please dont provide any links.if it is provide also please give working links becox i checked codeproject .i didnt get any nice link. and also provide the how to update the status field im csv file   Thank ssandhya   To send SMS, you need some third party SMS providers. if you consul...

Converting Web Site from Vb.Net 2003 to Vb.Net 2005
I have a web site in vb.net 2003 that I what to convert to vb.net 2005. I open my web site in the visual studio 2005 by Local IIS option. I follow the steps of the visual studio conversion wizard.In the conversion report I received the following warning 'Referencepath' settings have not been converted.  Can anyone tell what I have to do to make this warning disappear? Best regards,Sérgio 'Referencepath'  is a property you can set with with VS2003 project file, sothat when ever you to do Add reference this path is serached for class libraries.  We do not  have that ...

Can I buy VB .NET 2003 instead of VS .NET 2003?
Hi if I code my web applications using just Visual Basic can I buy Visual Basic .NET 2003 instead of having to buy the whole Visual Studio .NET 2003?  Will that work the same?  Thanks Hi,     When I got VB.NET 2003, it included VS.NET 2003 (Standard Edition).  I don't think there is a version of VB.NET 2003 that doesn't include VS.NET as the IDE.  While there are some projects templates that are not include in the standard edition, you still have the ASP.NET web application, web service, win forms, etc..., projects available.  If you are asking...

upgrading vb.net to vb.net 2003 crystal report viewer problem.
I have a vb.net web. app that has several pages each with a different crystal report on it. It works perfectly under vb.net. I've since installed vb.net 2003. After I open the solution in 2003 & it does its upgrade, all of the crystal report viewer controls are corrupted. If I try to run it as is I get the following error: "The base class includes the field 'myname' but its type (CrystalDecisions.Web.CrystalReportViewer) is not compatible with the type of control(CrystalDecisions.Web.CrystalReportViewer). So I tried deleting the control and adding back on. & when I ru...

Problem VB.NET 2003 and DataWindows.net
Greetings: When trying to add manually DataWindows.net 2.0 control to my Vb.Net 2003 studio I get the following message: DataWindowInterop.dll is not a Microsoft.Net module I get the same error when trying to add DataWindow.dll Can someone advise how to resolve this problem? Thanks Hello, I am having the exact same problem. Is it even possible to use Datawindow 2.0 in Vb.Net 2003? If so what's the trick? DW .NET installed fine but the controls on the tool box don't show up. I tried adding DLL's both ways as a .NET and a COM component but neither worked. Any ...

Type.GetType does not work in VB.NET but works in C#. VB.NET gurus Please help
Friends,   I am an experienced C# programmer who is working on a VB.NET project now. I am writing different methods covering the following functionalities 1) Take a datareader as input and return an arraylist of class object2) Take an xmlnode (received from a webservice) as input and return an arraylist of class object. The methods are generic methods which take datareader/xmlnode as first parameter and classname (string) as the second parameter. This way it will work trivially. The schema of class object matches with the input (datareader or xmlnode)In C# I used to do th...

Upgrading vb.net 2003 to vb.net 2008 the name '__o' is not declared
Hi I had an application in vb.net 2003. I chose to upgrade it to vb.net 2008. Now I have 153 errors telling me that the name '__o' is not declared. In one page where I get this error, It's on a <tr> statement. I searched in google and I saw that we could put <%=""%> at the beginning of the page, but I still have the error message. Any idea? Hi myriam_giroux,I think you need to be more specific information. When you are receiving errors during compilation in Visual Studio or Visual Web Developer, the Error list window will indicate the line in the sour...

I need help in VB.NET
Can someone explain me the objects: public , Private , Protected , Property , Get and set, and how I'm using them and when i'm using them. Thanks :]. you can find useful info from this link: http://www.vbtutor.net/vbtutor.html They didn't real explaint how I am using it and for what... =\ Or I just didn't see it O.o help? These are not objects. public, private and protected are "protection levels", which can be assigned to a class, property or method. Property: A property is a controled way of retrieving and setting values of a class level variable. You u...

I NEED HELP...about vb.net!!!!
  Server Error in '/ShoppingCart' Application. IErrorInfo.GetDescription failed with E_FAIL(0x80004005). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Data.OleDb.OleDbException: IErrorInfo.GetDescription failed with E_FAIL(0x80004005).Source Error: Line 119: Dim dr As OleDbDataReader Line 120: cnn1.Open() Line 121: cmd1.ExecuteNonQuery() Line 122: dr = cmd1.ExecuteRe...

converting to vb.net from c#.net authorize.net
authorize.net offered me some sample code when I signed up with them the only problem is the sample code is in c#.net but my page that they type all of their credit card into is vb.net <code><%@ Import Namespace="System.Net" %> <%@ Import Namespace="System.IO" %> <script language="C#" runat="server"> void Page_Load(Object Src, EventArgs E) { myPage.Text = readHtmlPage("https://certification.authorize.net/gateway/transact.dll"); } private String readHtmlPage(string url) { ...

Linq defaulting to VB.net, need C#.net
Hi All, I have made my database mapping layer in Visual Studio and afterwards realized it wrote everything behind the scenes (in the dbml designer) in VB and not C#.  I tried creating a small dbml and selected C# as the language and it still created a VB designer.  This is the one thing I have left before I publish the ASP 3.5 version and the new mapping layer to production. Any idea's?  I couldn't find anything on the internet about this, Thanks in advance!!!Tim...

Need help with Jscript to VB.Net
I have some code that is converting from ASP to ASP.NET intPreg = new Number(intPreg); What would the VB.net code look like? Thx   I not very familiar with ASP, but my guess would be the following:     Dim intPreg As Integer Then, you can give it a value     intPreg = 9 Or, if you want to define a starting value, you can do the following:     Dim intPreg As Integer = 9 Alister...

Web resources about - Need help on VB 2003.Net - asp.net.vs2002-vs2003

Nearly 1,000 'security risks' denied entry to France since Paris attacks
Nearly 1,000 people thought to pose security risks have been denied entry into France since stepped-up border controls were imposed ahead of ...

‘Fantastic Beasts’ Stars Afraid To Give Away Spoilers: Here’s What’s Been Revealed So Far
Fantastic Beasts and Where to Find Them is currently being filmed in the UK, but they have run into a bit of a snag. It seems that while they ...

It Is Time To Rethink Donald Trump’s Candidacy
From the very beginning of his campaign (and perhaps before), Donald Trump has gathered a following of supporters using his blunt, no-holds-barred ...

Russia should nuke enemy number one Turkey as tensions continue to escalate - Latest News - Breaking ...
RUSSIA is ready to "use nuclear weapons on enemy number one" Turkey, one of the country's leading politicians has announced.

‘Rabid Dogs’ No More? Ben Carson Meets With Syrian Refugees In Jordan
As part of a “fact finding” endeavor to learn more about the plight of Syrian refugees, Republican presidential candidate Ben Carson departed ...

Pro tip: Access all your cloud accounts from one location on Android
Tired of navigating between various cloud apps on your Android device? If so, Jack Wallen shows how to centralize all your cloud accounts with ...

California may be a leader on climate change, but it still has plenty of work to do
When Gov. Jerry Brown arrives in Paris next week for a major international conference on climate change, he will showcase one of the world’s ...

Seriously, People Are Upset This Year’s Reese’s Peanut Butter Christmas Trees Don’t Look Enough Like ...
As if the Starbucks’ red cup controversy and whether to say “Merry Christmas” or “Happy Holidays” isn’t enough for you, now, there’s something ...

Pope Francis visits Ugandan shrine amid gay rights debate
Reuters Pope Francis visits Ugandan shrine amid gay rights debate Reuters NAMUGONGO, Uganda Pope Francis traveled to Uganda's holiest shrine ...

Adele 2016 Tour Unveiled à La Harry Potter As ’25’ Tops Sales & Album Download List: Why U.S. Fans Wail ...
Adele announced her 2016 tour by borrowing from Harry Potter. And while Adele even had a magic wand to wave in making her 2016 tour announcement, ...

Resources last updated: 11/28/2015 12:09:36 PM