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

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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