English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am taking a Visual Basics course and I am having a hard time writing a code for the follwowing: Design an application that will accept students numerical score and return a letter grade. Please help.

2006-10-08 15:09:04 · 4 answers · asked by DuceDuce 2 in Computers & Internet Programming & Design

4 answers

I'm going to assume you're using VB 2005, and that you do not need to store any other information other than a single grade, and return a single character value that is the person's grade.

From your toolbox, drag a button, a text box, and a label onto your form.

Name the button: btnGetGrade
Name the text box: txtboxGradeInput
Name the label: lblDisplayGrade
You can also add a descriptive label that prompts for the input if need be.

So here's what it should look like:
__________ ______
Input student's grade: |__txtbox___| |__btn__|
Label

Now, double click on the button (btnGetGrade)
And type in the below:

Private Sub btnGetGrade_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGetGrade.Click
Dim studentScore As Integer = CInt(Me.txtboxGrade.Text)

If studentScore > 90 Then
Me.lblDisplayGrade.Text = "Student Grade Letter: A"
Else
If studentScore > 80 Then
Me.lblDisplayGrade.Text = "Student Grade Letter: B"
Else
If studentScore > 70 Then
Me.lblDisplayGrade.Text = "Student Grade Letter: C"
Else
If studentScore > 60 Then
Me.lblDisplayGrade.Text = "Student Grade Letter: D"
Else
Me.lblDisplayGrade.Text = "Student Grade Letter: F"
End If
End If
End If
End If
End Sub

2006-10-08 16:55:01 · answer #1 · answered by addtheninth 2 · 0 0

I disagree on those languages you chosen. i imagine the programming language "Java" because Java has Gui(image person interfaces) and good issues that may help you acomplish this. i'm gaining understand-how of Java myself and that i'd like to study it with someone. I truly have my own internet website I in simple terms began. e-mail in case your in touch. in the different case. in simple terms bypass with JAVA.

2016-12-04 10:26:18 · answer #2 · answered by ? 4 · 0 0

Why not post the code you have done so far? If you listened or read your book you should at least have something down.

2006-10-08 15:12:52 · answer #3 · answered by Mitch B 2 · 0 1

You didnt actually ask a question, therefore we dont know what the problem is. Nor did you provide any coding/algorthims

2006-10-08 15:32:49 · answer #4 · answered by D 4 · 0 1

fedest.com, questions and answers