Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

eate an application with a list box that displays the population growth for a gi

ID: 3868237 • Letter: E

Question

eate an application with a list box that displays the population growth for a given state ent population of the state is currently of the US during the next 12 years. Assume that the curr 858,900 people and is expected to grow at 5.8% per year for the next 12 years. (45 pts) Use the for... .Next loop, an accumulator and concatenation for the display in the list box Hints . Declare an integer for the current population for that state .Declare another integer for the number of years Use a For.. .next loop for the growth in 12 years Input Box Function 3. Use the code to below to explain the Input Box procedure and how it works using a different narrative than the one used in this example. (25 pts.) The InputBox function displays a dialog box that consists of a message asking for input, an input area, a title, an OK button, and a Cancel button When the user enters the text and taps or clicks the OK button, the InputBox function returns this text as a string If the user taps or clicks the Cancel button, the function returns a null string (") Use the following examples to create an Input Box that will return a text you entered General Format loputBox Function 1

Explanation / Answer

VERSION 5.00
Begin VB.Form Form1
   Caption         =   "Form1"
   ClientHeight    =   5760
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   8250
   LinkTopic       =   "Form1"
   ScaleHeight     =   5760
   ScaleWidth      =   8250
   StartUpPosition =   3 'Windows Default
   Begin VB.CommandButton Command1
      Caption         =   "OK"
      Height          =   735
      Left            =   4200
      TabIndex        =   4
      Top             =   1560
      Width           =   1095
   End
   Begin VB.CheckBox Check3
      Caption         =   "Sports"
      Height          =   615
      Left            =   1080
      TabIndex        =   3
      Top             =   2640
      Width           =   1575
   End
   Begin VB.CheckBox Check2
      Caption         =   "Computer"
      Height          =   615
      Left            =   1080
      TabIndex        =   2
      Top             =   1680
      Width           =   1575
   End
   Begin VB.CheckBox Check1
      Caption         =   "Reading"
      Height          =   375
      Left            =   1080
      TabIndex        =   1
      Top             =   960
      Width           =   1455
   End
   Begin VB.Label Label1
      Alignment       =   2 'Center
      Caption         =   "Please select your topic/s of interest:"
      BeginProperty Font
         Name            =   "Times New Roman"
         Size            =   18
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   0
      Top             =   120
      Width           =   5775
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
If Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 1 Then
MsgBox ("You like reading, computer and sports")
ElseIf Check1.Value = 1 And Check2.Value = 1 And Check3.Value = 0 Then
MsgBox ("You like reading and computer")
ElseIf Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 1 Then
MsgBox ("You like reading and sports")
ElseIf Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 1 Then
MsgBox ("You like computer and sports")
ElseIf Check1.Value = 0 And Check2.Value = 0 And Check3.Value = 1 Then
MsgBox ("You like sports only")
ElseIf Check1.Value = 0 And Check2.Value = 1 And Check3.Value = 0 Then
MsgBox ("You like computer only")
ElseIf Check1.Value = 1 And Check2.Value = 0 And Check3.Value = 0 Then
MsgBox ("You like reading only")
Else
MsgBox ("You have no Hobby")
End If
End Sub