Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Programming Language Expert

have to do a vb application that accepts grade input double type) via an input box and loop until a string ("END") is entered.

The entries cannot be less than 0 or above 100.

I also must calculate highest and lowest score, average score and % above average.

I'm stuck at the loop as I'm not certain how to allow double type and string to be entered in inputbox and how to end the loop

with the string. So far my loop is duplicating entries in the listbox and not giving error message when <0 or >100 is entered

and not ending the loop as "END" is not being accepted.

I have an idea of how the code should be however I'm not sure where I'm going wrong with my code.

Please view my vb application code and guide me as to where I'm going wrong, please!

Thanking you in advance for any assistance rendered.

This is my code copied from VB 2010

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click

End Sub

Private Sub avscoreLabel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles avscoreLabel.Click

End Sub

Private Sub exitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles exitButton.Click

Me.Close()

End Sub

Private Sub clearButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles clearButton.Click

highscoreLabel.Text = String.Empty

lowscoreLabel.Text = String.Empty

avscoreLabel.Text = String.Empty

ab_avgradeLabel.Text = String.Empty

inv_entLabel.Text = String.Empty

gradeListBox.Items.Clear()

End Sub

Private Sub calcButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles calcButton.Click

Dim scoreArray(24) As Double

Dim highest As Double

Dim lowest As Double

For X As Integer = 0 To scoreArray.GetUpperBound(0)

If scoreArray(X) > highest Then

highest = scoreArray(X)

End If

Next

For Y As Integer = 0 To scoreArray.GetUpperBound(0)

If scoreArray(Y) < lowest Then

lowest = scoreArray(Y)

End If

Next

lowscoreLabel.Text = lowest.ToString

highscoreLabel.Text = highest.ToString

End Sub

Private Sub gr_inputButton_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles gr_inputButton.Click

Dim scoreArray(24) As Double

Dim gradeInput As String

Dim gradeA As Integer

Dim gradeB As Integer

Dim gradeC As Integer

Dim gradeD As Integer

Dim gradeF As Integer

Dim gradeInvalid As Integer

Dim i As Integer

gradeListBox.Items.Clear()

gradeInput = InputBox("Please Enter Student Grade", "Enter Grade", , , ) 'priming

Do While gradeInput <> "END" Or i <= 24

scoreArray(i) = gradeInput

i = i + 1

gradeInput = InputBox("Please Enter Student Grade", "Enter Grade", , , ) 'updating

For i = 0 To i - 1

gradeListBox.Items.Add(scoreArray(i))

Next

Select Case gradeInput

Case 90 To 100

gradeA = gradeA + 1

Case 80 To 89

gradeB = gradeB + 1

Case 70 To 79

gradeC = gradeC + 1

Case 60 To 69

gradeD = gradeD + 1

Case Is < 69

gradeF = gradeF + 1

Case Is > 100

MessageBox.Show("Invalid Entry!" & Environment.NewLine & "Please Enter a Student Score between 0 & 100", "Roytec

Examinations", MessageBoxButtons.OK, MessageBoxIcon.Error)

gradeInvalid = gradeInvalid + 1

Case Is < 0

MessageBox.Show("Invalid Entry!" & Environment.NewLine & "Please Enter a Student Score between 0 & 100", "Roytec

Examinations", MessageBoxButtons.OK, MessageBoxIcon.Error)

gradeInvalid = gradeInvalid + 1

End Select

Loop

End Sub

End Class

YOU CAN VIEW THE APPLICATION REQUIREMENTS BELOW FOR YOUR REFERENCE:

You are required to create a Visual Basic application with an appropriate GUI for the Examinations Department. The program

must accept student exam results marked out of 100 via an input box until the value entered is "END". These values must

range between zero (0) and one hundred (100) and must be stored in an array. Invalid values entered must be flagged by a

message box which states "Values must be between 0 and 100". The maximum number of students in any class is 25. While

values are being stored in the array the program must keep track of the number of scores in the

(1) "A" range (90-100)

(2) "B" range (80-89)

(3) "C" range (70-79)

(4) "D" range (60-69)

(5) "F" range (below 60)

Also, the highest score, lowest score, the average (mean) score, the percentage of the grades that fall above the average and

the number of invalid entries must be calculated and displayed in the GUI.

Please Note:

a) You must use a Do loop count the number of grades.

b) You must use a case statement to count how many grades are in each range.

c) The number of grades should be stored as a variable and used in the calculation of the average

 

Programming Language, Programming

  • Category:- Programming Language
  • Reference No.:- M91604222
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Programming Language

Assignmentquestion onegiving the following code snippet

Assignment Question One Giving the following code snippet. What kind of errors you will get and how can you correct it. A. public class HelloJava { public static void main(String args[]) { int x=10; int y=2; System.out.p ...

Question 1 what is a computer program what is structured

Question: 1. What is a Computer program? What is structured programming? 2. What is modular programming? Why we use it? 3. Please evaluate Sin (x) by infinite series. Then write an algorithm to implement it with up to th ...

Extend the adworks applicationi add dialogs to allow the

Extend the AdWorks application I. Add Dialogs to allow the user to Add, Edit, Read and Delete a Customer and refresh the view accordingly. 1. The user should be able to select a specific customer from the DataGrid and cl ...

Task arrays and structsoverviewin this task you will

Task: Arrays and Structs Overview In this task you will continue to work on the knight database to help Camelot keep track of all of their knights. We can now add a kingdom struct to help work with and manage all of the ...

Task silly name testeroverviewcontrol flow allows us to

Task: Silly Name Tester Overview Control flow allows us to alter the order in which our programs execute. Building on our knowledge of variables, we can now use control flow to create programs that perform more than just ...

Overviewthis tasks provides you an opportunity to get

Overview This tasks provides you an opportunity to get feedback on your Learning Summary Report. The Learning Summary Report outlines how the work you have completed demonstrates that you have met all of the unit's learn ...

Question 1 what is hadoop explaining hadoop 2 what is

Question: 1. What is Hadoop (Explaining Hadoop) ? 2. What is HDFS? 3. What is YARN (Yet Another Resource Negotiator)? The response must be typed, single spaced, must be in times new roman font (size 12) and must follow t ...

Structs and enumsoverviewin this task you will create a

Structs and Enums Overview In this task you will create a knight database to help Camelot keep track of all of their knights. Instructions Lets get started. 1. What the topic 5 videos, these will guide you through buildi ...

Assignment - horse race meetingthe assignment will assess

Assignment - Horse Race Meeting The Assignment will assess competencies for ICTPRG524 Develop high level object-oriented class specifications. Summary The assignment is to design the classes that are necessary for the ad ...

Assignment - haskell program for regular expression

Assignment - Haskell Program for Regular Expression Matching Your assignment is to modify the slowgrep.hs Haskell program presented in class and the online notes, according to the instructions below. You may carry out th ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As