Visual Basic Help:
Code a program that reads a test score (number) from a text-box, each time a button is clicked. In other words, every time a new score is entered in the text-box, the score should be taken by the program, stored and the text-box should be cleared, so that the user can enter a new score. The program should be able to check that the user is entering a number. If the user enters something different than a number (or leaves the text-box empty), the program should not continue and it should display a warning message to the user. After entering as many scores as wanted, the user should be able to click on a second button to display the two highest scores, among all the ones entered until that point. The program should also display the total number of scores entered by the user. Also, once the user clicks on the button to display the results and the results are displayed, the program should get ready to get a new set of scores and start again. If the user starts writing a new score, the text-boxes with the results should be cleared.
Example: Assume the user enters the following scores: 10, 5, 20. The scores are entered once at the time in the top text-box; when a score is entered, the user presses the button to "Read" the score. The score is taken by the program and the text-box is cleared, so that the next score can be entered. This process can be repeated as many times as the user wants and for as many scores as the user wants. Once all the scores are entered and read(or taken-in)by the program, the user clicks on the second button to display the results. The program should then display the two highest scores, among the ones entered. So, in the example, this would be 10, 20. And it should display the total number of scores entered by the user. In the example, it would be 3.
After that, the user should be able to repeat the process and enter a new set of scores, if wanted. The program should therefore be ready to take in new inputs and start the process again. When the user starts typing the new score, the text-boxes with the previous results (two highest scores and total num. of scores) should get cleared

Answers

Answer 1

Answer:

See text attachment for complete source code (for the answer) where I used comments to explain each line of the program

Explanation:

First, design the form using the following tools (and the accompanying properties) :

1 Label: Property: Text: Score

2 Buttons

Button1: Property: Name: btnAdd; Text: Add

Button2: Property: Name: btnDisplay; Text: Display

1 ListBox: Property: Visible: Hidden

1 TextBox: Property: Name: txtNum1

First, create the following function.

The function (named typecheck) validates input from the user (i.e. integer input only)

Function typecheck(ByVal input As String) As Boolean

       Try

           Convert.ToInt32(input)

           [tex]Return\ True[/tex]

       [tex]Catch\ ex\ As\ Exception[/tex]

           [tex]Return\ False[/tex]

       End Try

   End Function

It returns true if the input is integer and false, if otherwise.

Next, double-click on the "Add" button and write the following lines of code:

Dim num1 As String

       num1 = txtNum1.Text

       If num1 IsNot String.Empty Then

           If typecheck(num1) Then

               [tex]ListBox1.Items.Add(num1)[/tex]

               [tex]txtNum1.Text = String.Empty[/tex]

           Else

               [tex]MsgBox("Only[/tex] [tex]Integer[/tex] [tex]Inpu t")[/tex]

               [tex]txtNum1.Text = String.Empty[/tex]

           [tex]End\ If[/tex]

       Else

           [tex]MsgBox("Box[/tex] [tex]can\ not\ be\ empty")[/tex]

           [tex]txtNum1.Text = String.Empty[/tex]

       [tex]End\ If[/tex]

Next, double-click on the "Display" button and write the following lines of code:

If ListBox1.Items.Count > 0 Then

           [tex]Dim\ max1, max2\ As\ Integer[/tex]

           max1 = Convert.ToInt32(ListBox1.Items(0))

           max2 = Convert.ToInt32(ListBox1.Items(0))

           [tex]For\ count\ = 0\ To\ ListBox1.Items.Count - 1[/tex]

               If Convert.ToInt32(ListBox1.Items([tex]count[/tex])) >= max1 Then

                   max1 = Convert.ToInt32(ListBox1.Items([tex]count[/tex]))

               [tex]End\ If[/tex]

           Next

           [tex]For\ count\ = 0\ To\ ListBox1.Items.Count - 1[/tex]

               If Convert.ToInt32(ListBox1.Items([tex]count[/tex])) >= max2 And Convert.ToInt32(ListBox1.Items([tex]count[/tex])) < max1 Then

                   max2 = Convert.ToInt32(ListBox1.Items([tex]count[/tex]))

               [tex]End\ If[/tex]

           Next

           MsgBox("Highest Scores: " + max1.ToString() + " " + max2.ToString())

           MsgBox("[tex]Total[/tex]: " + ListBox1.Items.Count.ToString())

       [tex]End\ If[/tex]

       ListBox1.Items.Clear()

Visual Basic Help:Code A Program That Reads A Test Score (number) From A Text-box, Each Time A Button
Visual Basic Help:Code A Program That Reads A Test Score (number) From A Text-box, Each Time A Button

Related Questions

Can software work without Hardware? Why?

Answers

Answer:

No

Explanation:

Software requires hardware to run. Think about a computer, you can't have windows without having the computer. Software is programmed to run on hardware.

45. Our goals are a reflection of our:
O values
O standards
O obstacles
O resources
beliefs
values and beliefs

Answers

Values hope it helps you

In the early days of the Internet, most access was done via a modem over an ________.
Question 10 options:

Analog telephone line

Fax

Telegram

None of the above

Answers

Answer:

analog telephone line

Explanation:

I hope this helps! :)

☁️☁️☁️☁️☁️☁️☁️☁️☁️

ERIC'S Company sells cement at 30.0 Ghana Cedis per bag. The company

however gives discount of 15% for customers that buy 100 or more bags, and 0% for

customers that buy less than 100 bags.
Write a pseudo code and present a flowchart that

will display the discount percentage when the quantity of bags purchased is entered.​

Answers

Answer:

The pseudocode is as follows:

Input Quantity

Discount = 0%

If Quantity >= 100:

    Discount = 15%

Print Discount

See attachment for flowchart

Explanation:

This line gets the quantity from the user

Input Quantity

This line initializes the discount to 0%

Discount = 0%

This checks if quantity is more than or equal to 100

If Quantity >= 100:

If yes, discount is set to 15%

    Discount = 15%

This prints the discount percentage

Print Discount

See attachment for flowchart

BitTorrent, a P2P protocol for file distribution, depends on a centralized resource allocation mechanism through which peers are able to maximize their download rates.
True or False?

Answers

Answer:

yes. it is true. mark as brainlest

Use the drop-down menus to complete the sentences about the Calendar view Arrange command group.


Under the Calendar view, you will see your calendar as

by default.


When you create an appointment, you are creating an activity that will not send

to other people.


A meeting is an activity where individuals are invited and

are shared.



is an all-day incident placed on the calendar.

Answers

Answer:

Use the drop-down menus to complete the sentences about the Calendar view Arrange command group.

Under the Calendar view, you will see your calendar as  

✔ monthly

by default.

When you create an appointment, you are creating an activity that will not send  

✔ an invitation

to other people.

A meeting is an activity where individuals are invited and  

✔ resources

are shared.

✔ An event

is an all-day incident placed on the calendar.

Explanation:

edge 2021

The complete sentences about the calendar view arrange command group are as follows:

Under the Calendar view, you will see your calendar as monthly by default. When you create an appointment, you are creating an activity that will not send an invitation to other people.A meeting is an activity where individuals are invited and resources are shared. An event is an all-day incident placed on the calendar.

What do you mean by Calender view?

Calendar view may be characterized as a type of feature within calendar software in which the user can choose from various formats in order to view the calendar more accurately and interestingly.

A calendar view lets a user view and interacts with a calendar that they can navigate by month, year, or decade. A user can select a single date or a range of dates. It doesn't have a picker surface and the calendar is always visible.

Command and control functions are performed through an arrangement of personnel, equipment, communications, facilities, and procedures employed by a commander in order to execute its functions.

Therefore, the complete sentences about the calendar view arrange command group are well mentioned above.

To learn more about Calendar view, refer to the link:

https://brainly.com/question/17524242

#SPJ2

Other Questions
There are 90 penguins in a zoo. There are two types - Humboldt and Emperor.52 are female, of these 6 are Emperor penguins.There are 5 male Emperor penguins.Use this information to complete the frequency tree.PLEASE ANSWER I WILL GIVE BRAINLIEST!!! Identify the viet cong What is the difference between a community and a population, and give one example of each? Pls, help me. If u can answer it I'll mark you as the brainiest. But I really need the example of each. Can anybody help me complete this worksheet please? I will mark you as brainliest and will be very happy! can someone help me please j < 0.65 The variable in the inequality is . HELPS ASAP PLZQuestion: If hotdogs are sold in packages of 10 and buns are sold in packages of 8, how many packages of each would you need to buy to get an equal number of hotdogs and buns? 3. Darwin surmised that all life on Earth was connected, like branches on a tree of life. What would the trunk of this tree represent? What is the ratio of x to y?5x = 6y Len has 3 strips of construction paper. Each strip is the same size and a different color-red, yellow, and pink. He tapes the strips together to make a rectangle. Then Len divides the rectangle into sixths so that each sixth is one color. What fraction other than 1/3 names the part of the rectangle that is red? what is the difference between a food chain and a food web? Lisa goes out to eat with her family and spends 42.50. she gives the waiter 15% tip .how much money does she spend in total ? A science classroom has 5 turtles and 7 frogs. What is the ratio of FROGS to TOTAL animals?5:77:125:12 plsssss help its easy!!!!!(one question)wrong answer for points=banned Solve 1 7 + 1 2 in the box below. Show all your steps. Take-off in Long jump in one foot yo pls help me I'm desperate lowkey which of these best characterizes the jazz age? The width of a rectangular room is 80% of its length. If the length of the room is 20 meters, what is the area of the room? A= length x width The measure of Angle 1 is 35 and it is complementary to Angle 2. Themeasure of Angle 2 is 5x. What is the value of x?