Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help troubleshoot this project. The application needs to take a name and hour input from a user and record the results in a list

Please help troubleshoot this project. The application needs to take a name and hour input from a user and record the results in a list array that displays a running total for each selected mission. This application is designed in Visual Studio using .NET framework. Please provide the form design code changes in text, the program code changes in text, and useful code comments for each subclass. Thank you.

Current Form Design

Partial Class Assignment4 Inherits System.Windows.Forms.Form

'Form overrides dispose to clean up the component list. 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. Private Sub InitializeComponent() Me.txtAmount = New System.Windows.Forms.TextBox() Me.lstMissions = New System.Windows.Forms.ListView() Me.btnAddDonation = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button() Me.lstTotals = New System.Windows.Forms.ListView() Me.txtName = New System.Windows.Forms.TextBox() Me.lblMission1Display = New System.Windows.Forms.Label() Me.lblMission2Display = New System.Windows.Forms.Label() Me.lblMission3Display = New System.Windows.Forms.Label() Me.lblMission4 = New System.Windows.Forms.Label() Me.lbl1 = New System.Windows.Forms.Label() Me.lbl2 = New System.Windows.Forms.Label() Me.SuspendLayout() ' 'txtAmount ' Me.txtAmount.Location = New System.Drawing.Point(110, 153) Me.txtAmount.Name = "txtAmount" Me.txtAmount.Size = New System.Drawing.Size(100, 22) Me.txtAmount.TabIndex = 1 ' 'lstMissions ' Me.lstMissions.HideSelection = False Me.lstMissions.Location = New System.Drawing.Point(76, 192) Me.lstMissions.Name = "lstMissions" Me.lstMissions.Size = New System.Drawing.Size(153, 167) Me.lstMissions.TabIndex = 2 Me.lstMissions.UseCompatibleStateImageBehavior = False ' 'btnAddDonation ' Me.btnAddDonation.Location = New System.Drawing.Point(110, 381) Me.btnAddDonation.Name = "btnAddDonation" Me.btnAddDonation.Size = New System.Drawing.Size(76, 46) Me.btnAddDonation.TabIndex = 3 Me.btnAddDonation.Text = "Add Hours" Me.btnAddDonation.UseVisualStyleBackColor = True ' 'btnClose ' Me.btnClose.Location = New System.Drawing.Point(520, 381) Me.btnClose.Name = "btnClose" Me.btnClose.Size = New System.Drawing.Size(76, 46) Me.btnClose.TabIndex = 6 Me.btnClose.Text = "Close" Me.btnClose.UseVisualStyleBackColor = True ' 'lstTotals ' Me.lstTotals.HideSelection = False Me.lstTotals.Location = New System.Drawing.Point(436, 72) Me.lstTotals.Name = "lstTotals" Me.lstTotals.Size = New System.Drawing.Size(237, 287) Me.lstTotals.TabIndex = 7 Me.lstTotals.UseCompatibleStateImageBehavior = False ' 'txtName ' Me.txtName.Location = New System.Drawing.Point(63, 91) Me.txtName.Name = "txtName" Me.txtName.Size = New System.Drawing.Size(181, 22) Me.txtName.TabIndex = 8 ' 'lblMission1Display ' Me.lblMission1Display.AutoSize = True Me.lblMission1Display.Location = New System.Drawing.Point(810, 91) Me.lblMission1Display.Name = "lblMission1Display" Me.lblMission1Display.Size = New System.Drawing.Size(63, 16) Me.lblMission1Display.TabIndex = 9 Me.lblMission1Display.Text = "Mission 1" ' 'lblMission2Display ' Me.lblMission2Display.AutoSize = True Me.lblMission2Display.Location = New System.Drawing.Point(810, 182) Me.lblMission2Display.Name = "lblMission2Display" Me.lblMission2Display.Size = New System.Drawing.Size(63, 16) Me.lblMission2Display.TabIndex = 10 Me.lblMission2Display.Text = "Mission 2" ' 'lblMission3Display ' Me.lblMission3Display.AutoSize = True Me.lblMission3Display.Location = New System.Drawing.Point(810, 283) Me.lblMission3Display.Name = "lblMission3Display" Me.lblMission3Display.Size = New System.Drawing.Size(63, 16) Me.lblMission3Display.TabIndex = 11 Me.lblMission3Display.Text = "Mission 3" ' 'lblMission4 ' Me.lblMission4.AutoSize = True Me.lblMission4.Location = New System.Drawing.Point(810, 381) Me.lblMission4.Name = "lblMission4" Me.lblMission4.Size = New System.Drawing.Size(63, 16) Me.lblMission4.TabIndex = 12 Me.lblMission4.Text = "Mission 4" ' 'lbl1 ' Me.lbl1.AutoSize = True Me.lbl1.Location = New System.Drawing.Point(73, 72) Me.lbl1.Name = "lbl1" Me.lbl1.Size = New System.Drawing.Size(171, 16) Me.lbl1.TabIndex = 13 Me.lbl1.Text = "Volunteer Name (Last, First)" ' 'lbl2 ' Me.lbl2.AutoSize = True Me.lbl2.Location = New System.Drawing.Point(143, 134) Me.lbl2.Name = "lbl2" Me.lbl2.Size = New System.Drawing.Size(43, 16) Me.lbl2.TabIndex = 14 Me.lbl2.Text = "Hours" ' 'Assignment4 ' Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.BackColor = System.Drawing.Color.LightGreen Me.ClientSize = New System.Drawing.Size(994, 498) Me.Controls.Add(Me.lbl2) Me.Controls.Add(Me.lbl1) Me.Controls.Add(Me.lblMission4) Me.Controls.Add(Me.lblMission3Display) Me.Controls.Add(Me.lblMission2Display) Me.Controls.Add(Me.lblMission1Display) Me.Controls.Add(Me.txtName) Me.Controls.Add(Me.lstTotals) Me.Controls.Add(Me.btnClose) Me.Controls.Add(Me.btnAddDonation) Me.Controls.Add(Me.lstMissions) Me.Controls.Add(Me.txtAmount) Me.Name = "Assignment4" Me.Text = "String Manipulation and Arrays Programming Assignment" Me.ResumeLayout(False) Me.PerformLayout()

End Sub Friend WithEvents txtAmount As TextBox Friend WithEvents lstMissions As ListView Friend WithEvents btnAddDonation As Button Friend WithEvents btnClose As Button Friend WithEvents lstTotals As ListView Friend WithEvents txtName As TextBox Friend WithEvents lblMission1Display As Label Friend WithEvents lblMission2Display As Label Friend WithEvents lblMission3Display As Label Friend WithEvents lblMission4 As Label Friend WithEvents lbl1 As Label Friend WithEvents lbl2 As Label End Class

Instructions

This module we are going to take the programs we created in three and utilize arrays. You are going to create a program to store the hours for each mission. The application is going to create an array to store 4 different areas of missions. The user is going to enter a name, the number of hours, select a mission, and the information will be displayed and the the totals for the number of hours will be displayed. The totals for the number of hours will be a running total.

1. Form Setup a. Design your screen to look like the one below. b. Update the backcolor to the color of your choice. c. Use appropriate naming conventions for controls and variables.

i. Txt for textbox ii. Lbl for label iii. Frm for form iv. Lst for listbox

d. Tab Control must flow in order from number of hours, lstmissions, Hours, Close. e. All buttons have access keys f. Lock the controls on your form. g. The list box to display the donations must be cleared before written to. h. The amounts will be stored in labels with borders.

2. Code a. Create a comment section at the beginning of the code with the name of the assignment, purpose of the assignment, and your name. Comments must be throughout each sub of the application. b. Remove any subs that are not utilized by the program c. A string array will be created to hold the 5 types of mission entry points.

3. Form Load a. Clear the donation listbox b. Load the mission list array into the listbox c. Display the current Date for the donations d. Display your name

4. Add Donation Button a. The information that was entered should be checked to make sure there are values entered. If the user entry contains null values, the user should be so advised, and the user should be directed to the text box that contains the error. Make sure your error messages are meaningful. b. A static one-dimensional array to hold 4 values is created to hold the number of hours. c. Add the number of hours value into the array in the appropriate place holder based on the selected index d. Display all hour totals in the corresponding labels e. Utilize an input box to get the name from the user. f. Call a function to return back just the last name g. Display the name and the amount donated in the listbox which displays a running total of the amounts entered. h. After the display, clear the selected index of the donation listbox, and amount text box. i. Make sure all spacing is accurate

5. Proper Order Function a. Receives the name b. Uses the substring method to parse out the last name c. Returns the last name

6. Close Button a. The application quits when the button is pressed

End Application Design

image text in transcribed

Mission Hours Assignment 4 Mission Hours Mission 3 6 Masion 4 Close

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions