Question

This is Visual Basic program, thank you for your help In this assignment, you'll start a...

This is Visual Basic program, thank you for your help

In this assignment, you'll start a new Windows Forms application.
Assume we have the data shown below:
Names_first={"jack","marjy","tom","luke","sam","al","joe","miky","lu"}
Name_last={"jones","ety","fan","spence","amin",sid","bud","ant","ben"}
Amounts={234.45,8293.1,943.25,27381.0,271.39,7436.12,2743.0,1639.95,2354.2}

The above will allows us to emulate reading data from a file, which we will learn in the next unit.
For now, we will assume the data above has been read from a file.
We need to process this data in fast way. For that purpose, we need to:

  1. Declare three arrays on the global level, with the names shown above.
  2. Write code for the form load event handler. The handling code simply assigns the arrays to the values shown above.
  3. Write a handler code for a button named Show Balance, that asks the user to type in the client first name into an inputbox (and nothing else), then we search the names array then display the client's balance, or an error message if that client does not exist. Examples of code to search arrays can be found in the textbook.
  4. Write another handler code for another button named Show Bank Assets that displays via messagebox the sum of all balances in the balances array.
  5. Finally write another handler code that shows the client names (first and last name) of all those who have a balance under $500. Each name can appear in a message.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Screenshot

Quick Launch (Ctrl+Q) Help Window Start - deepthi.onganattu - D 1 . 1 BankApplicationInVb - Microsoft Visual Studio File Edit

Design

Quick Launch (Ctrl+Q) - 2 x deepthi.onganattu - D File Test BankApplicationInVb - Microsoft Visual Studio Edit View Project BCode

Public Class frmBankApplication
    'Global array declaration
    Dim Names_first(9) As String
    Dim Name_last(9) As String
    Dim Amounts(9) As Double
    'Form load initailize global array and always point into text box
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'Initialize values into array
        Names_first = {"jack", "marjy", "tom", "luke", "sam", "al", "joe", "miky", "lu"}
        Name_last = {"jones", "ety", "fan", "spence", "amin", "sid", "bud", "ant", "ben"}
        Amounts = {234.45, 8293.1, 943.25, 27381.0, 271.39, 7436.12, 2743.0, 1639.95, 2354.2}
        txtfName.Select()
    End Sub
    'Loop through first name array and compare with text box value
    'If equal display balance
    'Otherwise error message
    Private Sub btnShowBalance_Click(sender As Object, e As EventArgs) Handles btnShowBalance.Click
        For i As Integer = 0 To Names_first.Length - 1
            If Names_first(i).CompareTo(txtfName.Text) = 0 Then
                txtfName.Text = ""
                MessageBox.Show("Balance of " + txtfName.Text + " is $" + CStr(Amounts(i)))
                Return
            End If
        Next
        txtfName.Text = ""
        MessageBox.Show("Error!!!" + txtfName.Text + " not found")
    End Sub
    'Loop through amounts array and find sum of assets in message box
    Private Sub btnBankAssets_Click(sender As Object, e As EventArgs) Handles btnBankAssets.Click
        Dim Balance As Double
        Balance = 0
        For i As Integer = 0 To Amounts.Length - 1
            Balance = Balance + Amounts(i)
        Next
        MessageBox.Show("Bank asset = $" + CStr(Balance))
    End Sub
    'Loop through aounts array to find less than 500 from amounts array
    'Return names of that asset persons
    Private Sub btnLessthan_Click(sender As Object, e As EventArgs) Handles btnLessthan.Click
        Dim names As String
        names = ""
        For i As Integer = 0 To Amounts.Length - 1
            If Amounts(i) < 500 Then
                names += Names_first(i) + " " + Name_last(i) + vbCrLf
            End If
        Next
        MessageBox.Show("First and last names:-" + vbCrLf + names)
    End Sub
    'Exit from application
    Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
        Me.Close()
    End Sub
End Class

Add a comment
Know the answer?
Add Answer to:
This is Visual Basic program, thank you for your help In this assignment, you'll start a...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In Java. Write a GUI contact list application. The program should allow you to input names...

    In Java. Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...

  • Please run the program and show the result with screenshots after. Thank you (Java Eclipse) Customer...

    Please run the program and show the result with screenshots after. Thank you (Java Eclipse) Customer Data: Area Codes Assume you work for a company that tracks customer information, including name, gender and phone numbers Your company has a file called customers.txt which contains the following information: Jiming Wu F 4082123458 James Brown M 8315678432 Leanna Perez F 4087654433 Xing Li M 8313214555 Stacey Cahill O 8312123333 Mohammed Abbas M 4083134444 Kumari Chakrabarti F 4086667777 Shakil Smith M 4082123333 Jung...

  • In this lab assignment, you'll write code that parses an email address and formats the ci and zip...

    Using Microsoft Visual Studio C# In this lab assignment, you'll write code that parses an email address and formats the ci and zip code portion of an address. String Handling Email: [email protected] Parse City: Fresno State: ca Zp code: 93722 Format ให้ 2 Parsed String Formatted String User name: anne Domain name: murach.comm City, State, Zip: Fresno, CA 93722 OK OK Create a new Windows Forms Application named StringHandling and build the form as shown above. 1. Add code to...

  • Im struggling with my final assignment and I don’t know how to start. The code has...

    Im struggling with my final assignment and I don’t know how to start. The code has to be done in python using tkinter module. I would very appreciate the help thank you QUESTION 1 Write a program that counts the number of names on a list. The program must include a class named FinalProjectlastName with the following attributes (class variables) and functions: Name: FinalProjectLastName Attributes: names: list of strings that stores names count: number of names on the list. Functions:...

  • I need help regarding my Visual Basic code ISC/ITE 285 Homework Due: Monday, January 28 by...

    I need help regarding my Visual Basic code ISC/ITE 285 Homework Due: Monday, January 28 by 11:55 pm Create a text file named "Grades.txt" which will contain a list of numeric grades. Save the file in the projects Bin/Debug folder. A sample of the file contents is shown below: 80 96 95 86 54 97 Create a string array that will be populated from the file "Grades.txt" when the array is created (Class-level array). Also create a numeric array that...

  • Parallel Arrays Summary In this lab, you use what you have learned about parallel arrays to...

    Parallel Arrays Summary In this lab, you use what you have learned about parallel arrays to complete a partially completed Java program. The program should either print the name and price for a coffee add-in from the Jumpin’ Jive coffee shop or it should print the message: "Sorry, we do not carry that.". Read the problem description carefully before you begin. The data file provided for this lab includes the necessary variable declarations and input statements. You need to write...

  • CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes...

    CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes the user and displays the purpose of the program. It then prompts the user to enter the name of an input file (such as scores.txt). Assume the file contains the scores of the final exams; each score is preceded by a 5 characters student id. Create the input file: copy and paste the following data into a new text file named scores.txt DH232 89...

  • Tasks Write a program that prints in text mode Project 2 written by YOURNAME And shows...

    Tasks Write a program that prints in text mode Project 2 written by YOURNAME And shows in a graphical way, as shown below, the names stored in a file. The coordinates to print the names will be also read from another file. Here is an example of what your graphic output should look like with the two files that are provided for test purposes. Drawing Panel Adam Bernie Cameron Daniel Fanny Gerard Harold Issac Jackie Raitlyn Note that the colors...

  • C Program In this assignment you'll write a program that encrypts the alphabetic letters in a...

    C Program In this assignment you'll write a program that encrypts the alphabetic letters in a file using the Vigenère cipher. Your program will take two command line parameters containing the names of the file storing the encryption key and the file to be encrypted. The program must generate output to the console (terminal) screen as specified below. Command Line Parameters Your program must compile and run from the command line. The program executable must be named “vigenere” (all lower...

  • Write you code in a class named HighScores, in file named HighScores.java. Write a program that...

    Write you code in a class named HighScores, in file named HighScores.java. Write a program that records high-score data for a fictitious game. The program will ask the user to enter five names, and five scores. It will store the data in memory, and print it back out sorted by score. The output from your program should look approximately like this: Enter the name for score #1: Suzy Enter the score for score #1: 600 Enter the name for score...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT