Design an application

Assignment Help Programming Languages
Reference no: EM13933332

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

 

Reference no: EM13933332

Questions Cloud

What is the pretax cost of debt-aftertax cost of debt : Jiminy’s Cricket Farm issued a bond with 25 years to maturity and a semiannual coupon rate of 12 percent 3 years ago. The bond currently sells for 94 percent of its face value. The company’s tax rate is 35 percent. What is the pretax cost of debt? Wh..
Prepare an income statement and balance sheet : Open appropriate ledger T-accounts, and record the events in the accounts.
Cmpanys business model : Consider a local business who's service I use frequently.  What are the main components of this companys business model? I have to write a 400 to 500 wotd response in which the following has to be included describe business ad commercr, business as o..
Collected partial payment : Prepare an income statement, balance sheet, and statement of cash flows.
Design an application : The entries cannot be less than 0 or above 100.
How can organizational behavior aid : How can organizational behavior aid in decison-making and problem-solving
Amortization amount changes : discuss whether or not the amortization amount changes every cash interest payment with each method.
Examples of roles that are filled by employees : What are specific examples of roles that are filled by employees and others that are filled by independent contractors? Use examples from your employer, industry, or an employer or industry with which you are familiar. What do the employees and indep..
Determine the geometric mean for the given values : Determine the Geometric mean for the following values. Calculate mean. median and mode from the following frequency distribution of marks at a test in English.

Reviews

Write a Review

Programming Languages Questions & Answers

  Modularizing code and sorting techniques

Modularizing Code and Sorting Techniques-Imagine you are a part of a team that is tasked with writing a mobile application (app) that will allow users to send pictures to their friends

  Design gui application with jframe to enter series of names

Design  GUI application with JFrame which permits user to enter series of friends' names and phone numbers. Each time user clicks the button, data entered must be written to sequential access file.

  Write program to asks user to enter temperatures

Write down the C++ program which asks the user to enter 12 temperatures for each month in year and store them in one-dimensional array called "temps".

  Write a method named maxelement

Write a method named maxElement, which returns the largest value in an array that is passed as an argument. The method should use recursion to find the largest element. Demonstrate the method in a program.

  Write a method occuson that checks the appointment

Implement a superclass Appointment and subclasses Onrtime, Daily and Monthly. An appointment has a description ( for example " See the dentist") and a date. Write a method occusOn(int year,int month, int day) that checks whether the appointment oc..

  Linux directory log

Linux Directory Log, Directions: As you complete each of the following steps, keep track of what occurs at each point, including what you type, the output given, and if you experience any errors. Record the occurrences in the following matrix.

  Create new method public to create and return new picture

Create a new method public Picture frame (int frameSize, Color frameColor) this method will create and return a new picture object.

  Write an assembly program that computes factorial

Write an assembly program that computes f(1), f(2), f(3),..., and f(10). Note that n! is defined as follows: or . Also, note that 1! = 0! = 1.

  Write down a program that will loop continuously to get

write a program that will loop continuously to get user input of positive numbers and total them out. the loop will

  Develop procedure to returns recent order information

Develop a procedure that returns the most recent order information for aparticular basket. This procedure must determine most recent stage entry from the BB_BASKETSTATUS table

  Programming language for a new point-of-sale system

You are the lead programmer for a new software project and have been assigned to choose the programming language for a new point-of-sale system

  Visual basic programming

Write a 1- to 2-page paper discussing what online groups or sites you will follow to get insight into using Visual Basic® programming in your work or career?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd