1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
marishachu [46]
3 years ago
15

Visual Basic Help:

Computers and Technology
1 answer:
Cerrena [4.2K]3 years ago
3 0

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: <em>Property: </em>Text: Score

2 Buttons

<em>Button1: Property: </em>Name: btnAdd; Text: Add

<em>Button2: Property: </em>Name: btnDisplay; Text: Display

1 ListBox: <em>Property: </em>Visible: Hidden

1 TextBox: <em>Property: </em>Name: txtNum1

First, create the following function.

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

<em>Function typecheck(ByVal input As String) As Boolean</em>

<em>        Try</em>

<em>            Convert.ToInt32(input)</em>

<em>            </em>Return\ True<em />

<em>        </em>Catch\ ex\ As\ Exception<em />

<em>            </em>Return\ False<em />

<em>        End Try</em>

<em>    End Function</em>

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:

<em>Dim num1 As String</em>

<em>        num1 = txtNum1.Text</em>

<em>        If num1 IsNot String.Empty Then</em>

<em>            If typecheck(num1) Then</em>

<em>                </em>ListBox1.Items.Add(num1)<em />

<em>                </em>txtNum1.Text = String.Empty<em />

<em>            Else</em>

<em>                </em>MsgBox("Only<em> </em>Integer<em> </em>Inpu t")<em />

<em>                </em>txtNum1.Text = String.Empty<em />

<em>            </em>End\ If<em />

<em>        Else</em>

<em>            </em>MsgBox("Box can\ not\ be\ empty")

<em>            </em>txtNum1.Text = String.Empty<em />

<em>        </em>End\ If<em />

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

<em>If ListBox1.Items.Count > 0 Then</em>

<em>            </em>Dim\ max1, max2\ As\ Integer<em />

<em>            max1 = Convert.ToInt32(ListBox1.Items(0))</em>

<em>            max2 = Convert.ToInt32(ListBox1.Items(0))</em>

<em>            </em>For\ count\ = 0\ To\ ListBox1.Items.Count - 1<em />

<em>                If Convert.ToInt32(ListBox1.Items(</em>count<em>)) >= max1 Then</em>

<em>                    max1 = Convert.ToInt32(ListBox1.Items(</em>count<em>))</em>

<em>                </em>End\ If<em />

<em>            Next</em>

<em>            </em>For\ count\ = 0\ To\ ListBox1.Items.Count - 1<em />

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

<em>                    max2 = Convert.ToInt32(ListBox1.Items(</em>count<em>))</em>

<em>                </em>End\ If<em />

<em>            Next</em>

<em>            MsgBox("Highest Scores: " + max1.ToString() + " " + max2.ToString())</em>

<em>            MsgBox("</em>Total<em>: " + ListBox1.Items.Count.ToString())</em>

<em>        </em>End\ If<em />

<em>        ListBox1.Items.Clear()</em>

You might be interested in
Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In 1–2 sentences, descri
Tresset [83]

Carlos Should use a Security Camera to keep track of his physical hardware. Carlos can then use a computer to monitor the security cameras.

7 0
4 years ago
Read 2 more answers
Type you all suck if you want to be my freind
Nina [5.8K]

Answer:

you all suck

Explanation:

;)

4 0
4 years ago
Read 2 more answers
A poem for coduction
Nataly_w [17]
I don't know if you want a poem about conduction but if so here ya go

no matter how the heat
different temperatures meet
hot to cold how it's done
4 0
4 years ago
Read 2 more answers
The Copyright Act of 1976 statute extends protection to owners of _____________________, but this act by itself does not prevent
Debora [2.8K]

Answer:

The Copyright Act of 1976 statute extends protection to owners of the <u>artistic work.</u>

Explanation:

The Copyright Act of 1976 is a copyright law of the United States of America. This act came into effect on January 1, 1978. The copyright act states the basic rights of the copyright holders and extends protection to the original artistic works of authorship such as graphic work, literary work, musical work, graphic work, motion pictures etc.

3 0
4 years ago
After discovering a security incident and removing the affected files, an administrator disabled an unneeded service that led to
patriot [66]

Answer:

A. Containment

Explanation:

  • This Containment is important before an incident or damage to resources. Most events require control, so it is important when handling each event. Containment provides time to develop a solution strategy that is prevalent.
  • Decisions Making decisions to facilitate an event is much easier if the decision is involved in predetermined strategies and processes. Organizations must define acceptable risks in dealing with events and develop strategies accordingly.
  • Network prevention is a fast and powerful tool designed to give security administrators the power they need to detect and prevent threats.
5 0
4 years ago
Other questions:
  • In which of the following scenarios would it be best to use a for loop?
    6·1 answer
  • Help pleaseeeeeeeeeeeee
    13·2 answers
  • How can a signature be added to an email message? Check all that apply.
    10·2 answers
  • Which of the following is an easy steps to take to avoid ESSD well working on your computer?
    5·1 answer
  • What happens if none of the selector values match selector in a simple case expression in pl/sql
    6·1 answer
  • What type of program is Microsoft® Excel®?
    9·2 answers
  • One way to use contiguous allocation of the disk and not suffer from holes is to compact the disk every time a file is removed.
    13·1 answer
  • Choose the best answer from the drop-down menu. A ______ allows multiple connections to a single signal. Without a ______, conne
    7·2 answers
  • Cloud architects have been largely replaced by ScrumMasters.<br><br> True<br><br> False
    15·2 answers
  • Taking control of admin functionality and misusing sensitive data that are unauthorized to access are due to.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!