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

BELOW is THE TYPE OF CODING WE ARE BEING TAUGHT: ( GENERIC PROJECT NOT THE ONE A

ID: 3793700 • Letter: B

Question

BELOW is THE TYPE OF CODING WE ARE BEING TAUGHT: ( GENERIC PROJECT NOT THE ONE ABOVE) ---- I am so confused

Dim strMonths() As String = {"January", "February", "March", "April", _
"May", "June", "July", "August", "September", "October", "November", _
"December"}

Dim intMonths(11) As Integer


Private Sub btnRainfall_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRainfall.Click

'calculate and display monthly rainfall

Dim intCounter As Integer 'loop counter
Dim intRain As Integer 'amount of rain


lstRainfall.Items.Add("Monthly Rainfall Input")
lstRainfall.Items.Add("___________________________")

'get the rain for each month
Do While intCounter = (0 - 11)
lstRainfall.Items.Add((intRain).ToString() & " for " & strMonths(intCounter))
Try
For intRain = CInt(Val(InputBox("Please Enter the amount of Rainfall in Inches for " &
strMonths(intCounter))))

Next intRain
intMonths(intCounter) = intRain
intCounter = (0 - 11)

Catch
MsgBox("Enter a valid numeric value.")

End Try
Loop
End Sub

Private Sub btnDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDisplay.Click
Dim intCounter As Integer
Dim intMax As Integer = intMonths(0)
Dim intMin As Integer = intMonths(0)
Dim dblMonthlyavg As Double
Dim intTotal As Integer = 0
Dim minIndex As Integer = 0
Dim maxIndex As Integer = 0
'calculate maximum

FRANCHISE INVESTMENT Design a ndows Desktop application and write the code that will execute according to the program requirements in Figure 8-106 and the Use Case Definition in Figure 8-107. Before writing the code, create an ning document for each event in the program. The completed program is shown in Figure 8-108. event REQUIREMENTS DOCUMENT January 24, 2017 Date Submitted on Title: Franchise Investment This windows application de the average cost for invasting in a franchise restaurant. Program Procedures in Windows application, use data in a text file to compute the average investment cost for purchasing arestaurant franchise. The file contains the restaurant name and investment cost. (Source: www.entrepreneur.com/franchises) 1. A Windows application displays a title and image. The application opens a gorithms text file named franchise tat from a USB drive (E:). Processing, and 2. The program assigns the text file contents to two arrays that hold Conditions the restaurant name and the investrment cost. The array currently has 10 elements. 3. When the Computc Average Investment button is tapped or chicked, the program displays the average cost of investing in a franchise. 4. The program displays the franchise restaurant names in the first ListBox object and their corresponding investment cost in the second ListBox object. 5. A File menu is displayed with the mcnu ite Clear and Exit the Clear item clears the result from the Form object and the Exit item exits the application. close the opened text file before the program exits. Notes and 1. The franchise, Dkt file is available on CengageB Comments rain com 2. obtain an image for this program from CengageBrain.com. The name of the picture on the Windows form is Franchise, FIGURE 8-106

Explanation / Answer

Franchise Investment.vbproj


<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)$(MSBuildToolsVersion)Microsoft.Common.props')" />
<PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    <ProjectGuid>{5D31CD26-85BA-486A-BDF7-8E76636F0CDE}</ProjectGuid>
    <OutputType>WinExe</OutputType>
    <StartupObject>Franchise_Investment.My.MyApplication</StartupObject>
    <RootNamespace>Franchise_Investment</RootNamespace>
    <AssemblyName>Franchise Investment</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <MyType>WindowsForms</MyType>
    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
    <AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugSymbols>true</DebugSymbols>
    <DebugType>full</DebugType>
    <DefineDebug>true</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <OutputPath>binDebug</OutputPath>
    <DocumentationFile>Franchise Investment.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <PlatformTarget>AnyCPU</PlatformTarget>
    <DebugType>pdbonly</DebugType>
    <DefineDebug>false</DefineDebug>
    <DefineTrace>true</DefineTrace>
    <Optimize>true</Optimize>
    <OutputPath>binRelease</OutputPath>
    <DocumentationFile>Franchise Investment.xml</DocumentationFile>
    <NoWarn>42016,41999,42017,42018,42019,42032,42036,42020,42021,42022</NoWarn>
</PropertyGroup>
<PropertyGroup>
    <OptionExplicit>On</OptionExplicit>
</PropertyGroup>
<PropertyGroup>
    <OptionCompare>Binary</OptionCompare>
</PropertyGroup>
<PropertyGroup>
    <OptionStrict>Off</OptionStrict>
</PropertyGroup>
<PropertyGroup>
    <OptionInfer>On</OptionInfer>
</PropertyGroup>
<ItemGroup>
    <Reference Include="System" />
    <Reference Include="System.Data" />
    <Reference Include="System.Deployment" />
    <Reference Include="System.Drawing" />
    <Reference Include="System.Windows.Forms" />
    <Reference Include="System.Xml" />
    <Reference Include="System.Core" />
    <Reference Include="System.Xml.Linq" />
    <Reference Include="System.Data.DataSetExtensions" />
    <Reference Include="System.Net.Http" />
</ItemGroup>
<ItemGroup>
    <Import Include="Microsoft.VisualBasic" />
    <Import Include="System" />
    <Import Include="System.Collections" />
    <Import Include="System.Collections.Generic" />
    <Import Include="System.Data" />
    <Import Include="System.Drawing" />
    <Import Include="System.Diagnostics" />
    <Import Include="System.Windows.Forms" />
    <Import Include="System.Linq" />
    <Import Include="System.Xml.Linq" />
    <Import Include="System.Threading.Tasks" />
</ItemGroup>
<ItemGroup>
    <Compile Include="frmDisplay.Designer.vb">
      <DependentUpon>frmDisplay.vb</DependentUpon>
    </Compile>
    <Compile Include="frmDisplay.vb">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="frmInvestment.vb">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="frmInvestment.Designer.vb">
      <DependentUpon>frmInvestment.vb</DependentUpon>
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="My ProjectAssemblyInfo.vb" />
    <Compile Include="My ProjectApplication.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Application.myapp</DependentUpon>
    </Compile>
    <Compile Include="My ProjectResources.Designer.vb">
      <AutoGen>True</AutoGen>
      <DesignTime>True</DesignTime>
      <DependentUpon>Resources.resx</DependentUpon>
    </Compile>
    <Compile Include="My ProjectSettings.Designer.vb">
      <AutoGen>True</AutoGen>
      <DependentUpon>Settings.settings</DependentUpon>
      <DesignTimeSharedInput>True</DesignTimeSharedInput>
    </Compile>
</ItemGroup>
<ItemGroup>
    <EmbeddedResource Include="frmDisplay.resx">
      <DependentUpon>frmDisplay.vb</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="frmInvestment.resx">
      <DependentUpon>frmInvestment.vb</DependentUpon>
    </EmbeddedResource>
    <EmbeddedResource Include="My ProjectResources.resx">
      <Generator>VbMyResourcesResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.vb</LastGenOutput>
      <CustomToolNamespace>My.Resources</CustomToolNamespace>
      <SubType>Designer</SubType>
    </EmbeddedResource>
</ItemGroup>
<ItemGroup>
    <None Include="My ProjectApplication.myapp">
      <Generator>MyApplicationCodeGenerator</Generator>
      <LastGenOutput>Application.Designer.vb</LastGenOutput>
    </None>
    <None Include="My ProjectSettings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
      <CustomToolNamespace>My</CustomToolNamespace>
      <LastGenOutput>Settings.Designer.vb</LastGenOutput>
    </None>
    <None Include="App.config" />
</ItemGroup>
<ItemGroup>
    <None Include="ResourcesFranchise.jpg" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)Microsoft.VisualBasic.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
       Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>


frmDisplay.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmDisplay
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.btnReturn = New System.Windows.Forms.Button()
        Me.picFranchise2 = New System.Windows.Forms.PictureBox()
        Me.lstDisplay = New System.Windows.Forms.ListBox()
        Me.Label1 = New System.Windows.Forms.Label()
        CType(Me.picFranchise2, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'btnReturn
        '
        Me.btnReturn.BackColor = System.Drawing.Color.SlateGray
        Me.btnReturn.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnReturn.ForeColor = System.Drawing.Color.White
        Me.btnReturn.Location = New System.Drawing.Point(169, 319)
        Me.btnReturn.Name = "btnReturn"
        Me.btnReturn.Size = New System.Drawing.Size(230, 47)
        Me.btnReturn.TabIndex = 0
        Me.btnReturn.Text = "Return to Application"
        Me.btnReturn.UseVisualStyleBackColor = False
        '
        'picFranchise2
        '
        Me.picFranchise2.Image = Global.Franchise_Investment.My.Resources.Resources.Franchise
        Me.picFranchise2.Location = New System.Drawing.Point(0, 0)
        Me.picFranchise2.Name = "picFranchise2"
        Me.picFranchise2.Size = New System.Drawing.Size(154, 130)
        Me.picFranchise2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.picFranchise2.TabIndex = 1
        Me.picFranchise2.TabStop = False
        '
        'lstDisplay
        '
        Me.lstDisplay.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lstDisplay.ForeColor = System.Drawing.Color.LightSlateGray
        Me.lstDisplay.FormattingEnabled = True
        Me.lstDisplay.ItemHeight = 24
        Me.lstDisplay.Items.AddRange(New Object() {"Buffalo Wild Wings", "Cold Stone Creamery", "Firehouse Subs", "Genghis Grill", "Mellow Mushroom", "Papa Murphys", "Ritas Italian Ice", "Saladworks", "Scooters Coffee", "Smoothie King", "Qdoba Mexican Grill"})
        Me.lstDisplay.Location = New System.Drawing.Point(169, 97)
        Me.lstDisplay.Name = "lstDisplay"
        Me.lstDisplay.Size = New System.Drawing.Size(230, 196)
        Me.lstDisplay.TabIndex = 2
        '
        'Label1
        '
        Me.Label1.AutoSize = True
        Me.Label1.Font = New System.Drawing.Font("Modern No. 20", 24.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.Label1.ForeColor = System.Drawing.Color.LightSlateGray
        Me.Label1.Location = New System.Drawing.Point(163, 35)
        Me.Label1.Name = "Label1"
        Me.Label1.Size = New System.Drawing.Size(296, 34)
        Me.Label1.TabIndex = 3
        Me.Label1.Text = "Franchise Investment"
        '
        'frmDisplay
        '
        Me.AcceptButton = Me.btnReturn
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.BackColor = System.Drawing.Color.WhiteSmoke
        Me.ClientSize = New System.Drawing.Size(477, 435)
        Me.Controls.Add(Me.Label1)
        Me.Controls.Add(Me.lstDisplay)
        Me.Controls.Add(Me.picFranchise2)
        Me.Controls.Add(Me.btnReturn)
        Me.Name = "frmDisplay"
        Me.Text = "Display"
        CType(Me.picFranchise2, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

    Friend WithEvents btnReturn As Button
    Friend WithEvents picFranchise2 As PictureBox
    Friend WithEvents lstDisplay As ListBox
    Friend WithEvents Label1 As Label
End Class


frmDisplay.vb

' The frmDisplayInventory class is opened by frmDepreciation
' and displays the inventory file in sorted order

Option Strict On


Public Class frmDisplay

    Private Sub frmDisplayInventory_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' The frmDisplayInventory load event is a second forms that
        ' displays the sorted inventory items

    End Sub

    Private Sub btnReturn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReturn.Click
        ' This Sub procedure opens the first form
        Dim frmFirst As New frmInvestment

        Hide()
        frmFirst.ShowDialog()
    End Sub


End Class

frmInvestment.Designer.vb

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmInvestment
    Inherits System.Windows.Forms.Form

    'Form overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()>
    Private Sub InitializeComponent()
        Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
        Me.mnuFile = New System.Windows.Forms.ToolStripMenuItem()
        Me.mnuDisplay = New System.Windows.Forms.ToolStripMenuItem()
        Me.mnuClear = New System.Windows.Forms.ToolStripMenuItem()
        Me.mnuExit = New System.Windows.Forms.ToolStripMenuItem()
        Me.lblTitle = New System.Windows.Forms.Label()
        Me.lstFranchise = New System.Windows.Forms.ListBox()
        Me.lblFranchise = New System.Windows.Forms.Label()
        Me.lblSelectedInvestment = New System.Windows.Forms.Label()
        Me.btnCompute = New System.Windows.Forms.Button()
        Me.lblCost = New System.Windows.Forms.Label()
        Me.picFranchise = New System.Windows.Forms.PictureBox()
        Me.MenuStrip1.SuspendLayout()
        CType(Me.picFranchise, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'MenuStrip1
        '
        Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuFile})
        Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
        Me.MenuStrip1.Name = "MenuStrip1"
        Me.MenuStrip1.Size = New System.Drawing.Size(686, 24)
        Me.MenuStrip1.TabIndex = 0
        Me.MenuStrip1.Text = "MenuStrip1"
        '
        'mnuFile
        '
        Me.mnuFile.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.mnuDisplay, Me.mnuClear, Me.mnuExit})
        Me.mnuFile.Name = "mnuFile"
        Me.mnuFile.Size = New System.Drawing.Size(37, 20)
        Me.mnuFile.Text = "&File"
        '
        'mnuDisplay
        '
        Me.mnuDisplay.Name = "mnuDisplay"
        Me.mnuDisplay.Size = New System.Drawing.Size(333, 22)
        Me.mnuDisplay.Text = "Display Restaurant Names and Investment Values"
        '
        'mnuClear
        '
        Me.mnuClear.Name = "mnuClear"
        Me.mnuClear.Size = New System.Drawing.Size(333, 22)
        Me.mnuClear.Text = "&Clear"
        '
        'mnuExit
        '
        Me.mnuExit.Name = "mnuExit"
        Me.mnuExit.Size = New System.Drawing.Size(333, 22)
        Me.mnuExit.Text = "E&xit"
        '
        'lblTitle
        '
        Me.lblTitle.AutoSize = True
        Me.lblTitle.Font = New System.Drawing.Font("Modern No. 20", 26.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblTitle.ForeColor = System.Drawing.Color.LightSlateGray
        Me.lblTitle.Location = New System.Drawing.Point(168, 24)
        Me.lblTitle.Name = "lblTitle"
        Me.lblTitle.Size = New System.Drawing.Size(322, 36)
        Me.lblTitle.TabIndex = 1
        Me.lblTitle.Text = "Franchise Investment"
        '
        'lstFranchise
        '
        Me.lstFranchise.ForeColor = System.Drawing.Color.LightSlateGray
        Me.lstFranchise.FormattingEnabled = True
        Me.lstFranchise.Location = New System.Drawing.Point(373, 87)
        Me.lstFranchise.Name = "lstFranchise"
        Me.lstFranchise.Size = New System.Drawing.Size(228, 173)
        Me.lstFranchise.TabIndex = 3
        '
        'lblFranchise
        '
        Me.lblFranchise.AutoSize = True
        Me.lblFranchise.Font = New System.Drawing.Font("Microsoft Sans Serif", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblFranchise.ForeColor = System.Drawing.Color.LightSlateGray
        Me.lblFranchise.Location = New System.Drawing.Point(369, 63)
        Me.lblFranchise.Name = "lblFranchise"
        Me.lblFranchise.Size = New System.Drawing.Size(156, 24)
        Me.lblFranchise.TabIndex = 4
        Me.lblFranchise.Text = "Select Franchise:"
        '
        'lblSelectedInvestment
        '
        Me.lblSelectedInvestment.AutoSize = True
        Me.lblSelectedInvestment.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblSelectedInvestment.Location = New System.Drawing.Point(197, 290)
        Me.lblSelectedInvestment.Name = "lblSelectedInvestment"
        Me.lblSelectedInvestment.Size = New System.Drawing.Size(292, 25)
        Me.lblSelectedInvestment.TabIndex = 5
        Me.lblSelectedInvestment.Text = "XXXXXXXXXXXXXXXXXXXX"
        Me.lblSelectedInvestment.Visible = False
        '
        'btnCompute
        '
        Me.btnCompute.BackColor = System.Drawing.Color.SlateGray
        Me.btnCompute.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.btnCompute.ForeColor = System.Drawing.Color.White
        Me.btnCompute.Location = New System.Drawing.Point(192, 327)
        Me.btnCompute.Name = "btnCompute"
        Me.btnCompute.Size = New System.Drawing.Size(297, 39)
        Me.btnCompute.TabIndex = 6
        Me.btnCompute.Text = "Compute Average Investment"
        Me.btnCompute.UseVisualStyleBackColor = False
        '
        'lblCost
        '
        Me.lblCost.AutoSize = True
        Me.lblCost.Font = New System.Drawing.Font("Microsoft Sans Serif", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblCost.Location = New System.Drawing.Point(197, 382)
        Me.lblCost.Name = "lblCost"
        Me.lblCost.Size = New System.Drawing.Size(292, 25)
        Me.lblCost.TabIndex = 7
        Me.lblCost.Text = "XXXXXXXXXXXXXXXXXXXX"
        Me.lblCost.Visible = False
        '
        'picFranchise
        '
        Me.picFranchise.Image = Global.Franchise_Investment.My.Resources.Resources.Franchise
        Me.picFranchise.Location = New System.Drawing.Point(75, 66)
        Me.picFranchise.Name = "picFranchise"
        Me.picFranchise.Size = New System.Drawing.Size(250, 194)
        Me.picFranchise.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
        Me.picFranchise.TabIndex = 2
        Me.picFranchise.TabStop = False
        '
        'frmInvestment
        '
        Me.AcceptButton = Me.btnCompute
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.BackColor = System.Drawing.Color.WhiteSmoke
        Me.ClientSize = New System.Drawing.Size(686, 425)
        Me.Controls.Add(Me.lblCost)
        Me.Controls.Add(Me.btnCompute)
        Me.Controls.Add(Me.lblSelectedInvestment)
        Me.Controls.Add(Me.lblFranchise)
        Me.Controls.Add(Me.lstFranchise)
        Me.Controls.Add(Me.picFranchise)
        Me.Controls.Add(Me.lblTitle)
        Me.Controls.Add(Me.MenuStrip1)
        Me.MainMenuStrip = Me.MenuStrip1
        Me.Name = "frmInvestment"
        Me.Text = "Franchise Investment"
        Me.MenuStrip1.ResumeLayout(False)
        Me.MenuStrip1.PerformLayout()
        CType(Me.picFranchise, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)
        Me.PerformLayout()

    End Sub

    Friend WithEvents MenuStrip1 As MenuStrip
    Friend WithEvents mnuFile As ToolStripMenuItem
    Friend WithEvents mnuDisplay As ToolStripMenuItem
    Friend WithEvents mnuClear As ToolStripMenuItem
    Friend WithEvents mnuExit As ToolStripMenuItem
    Friend WithEvents lblTitle As Label
    Friend WithEvents picFranchise As PictureBox
    Friend WithEvents lstFranchise As ListBox
    Friend WithEvents lblFranchise As Label
    Friend WithEvents lblSelectedInvestment As Label
    Friend WithEvents btnCompute As Button
    Friend WithEvents lblCost As Label
End Class


frmInvestment.vb

Option Strict On

Public Class frmInvestment
    ' Class Level Private variables
    Private _intLifeOfItems As Integer = 6
    Public Shared _intSizeOfArray As Integer = 7
    Public Shared _strInventoryItem(_intSizeOfArray) As String
    Private _strItemId(_intSizeOfArray) As String
    Private _decInitialPrice(_intSizeOfArray) As String
    Private _intQuantity(_intSizeOfArray) As Integer

    Private Sub frmInvestment_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        ' The frmInvestment load event reads the franchise text files and
        ' fills the Listbox object with the inventory items

        ' Initialize an instance of the StreamReader object and declare variables
        Dim objReader As IO.StreamReader
        Dim strLocationAndNameOfFile As String = "C:UsersJetStreamDocumentsBook FilesChapter 08Franchise.txt"
        Dim intCount As Integer = 0
        Dim strFileError As String = "The file is not available. Restart when the file is available."

        'Verify the file exists
        If IO.File.Exists("C: UsersJetStreamDocumentsBook FilesChapter 08Franchise.txt") Then
            objReader = IO.File.OpenText("C:UsersJetStreamDocumentsBook FilesChapter 08Franchise.txt")

            ' Read the file line by line until the file is completed
            Do While objReader.Peek <> -1
                _strInventoryItem(intCount) = objReader.ReadLine()
                _strItemId(intCount) = objReader.ReadLine()
                _decInitialPrice(intCount) = Convert.ToString(objReader.ReadLine())
                _intQuantity(intCount) = Convert.ToInt32(objReader.ReadLine())

            Loop
            objReader.Close()

            ' The Listbox object is filled with the franchise items
            For intFill = 0 To (_strItemId.Length - 1)
                lstFranchise.Items.Add(_strItemId)
            Next

        Else
            MsgBox(strFileError, , "Error")
            Close()
        End If


    End Sub

    Private Sub btnCompute_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute.Click

        'The btnCalculateDepreciation click event calls the depreciation Sub procedures
        ' Declare variables
        Dim intSelectedItemId As Integer
        Dim strMissingSelection As String = "Missing Selection"
        Dim strSelectInventoryItemIdError As String = "Select a Franchise"

        ' If the ListBox and a Depreciation RadioButton object are selected,
        ' call the depreciation procedures
        If lstFranchise.SelectedIndex >= 0 Then
            intSelectedItemId = lstFranchise.SelectedIndex

        Else
            MsgBox(strSelectInventoryItemIdError, , strMissingSelection)

        End If
    End Sub


    Private Sub MakeObjectsVisible()
        ' This procedure displays the objects showing the results
        lblSelectedInvestment.Visible = True
        lblCost.Visible = True

        ' The previous data is removed
        lstFranchise.Items.Clear()


    End Sub


    Private Sub mnuDisplay_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuDisplay.Click
        ' The mnuDisplay click event creates an instance of frmDisplayInventory
        Dim frmSecond As New frmDisplay

        ' Hide this form and show the Display Inventory form
        Hide()
        frmSecond.ShowDialog()
    End Sub


    Private Sub mnuClear_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuClear.Click
        ' The mnuClear click event clears and resets the form
        lstFranchise.Items.Clear()
        lblCost.Visible = False
        lblSelectedInvestment.Visible = False


    End Sub


    Private Sub mnuExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles mnuExit.Click
        ' The mnuExit click event closes the application
        Application.Exit()
    End Sub

End Class