ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 9 Weeks Ago, 1 Day Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 08 May 2017 My Price 8.00

CBO1 and CBO2

Question:

In this assignment, you'll start a new Windows Forms application.
Add 2 comboboxes and name them CBO1 and CBO2, and make them both invisible. Then copy and paste the code below under the form Load handler:

CBO1.Items.add("John One")
CBO1.Items.add("Jack Two")
CBO1.Items.add("John Three")
CBO1.Items.add("Jack Four")
CBO1.Items.add("John Five")
CBO1.Items.add("Jack Six")
CBO1.Items.add("John Seven")
CBO1.Items.add("Jack Eight")

CBO2.Items.add("235.50")
CBO2.Items.add("78943.98")
CBO2.Items.add("230781.10")
CBO2.Items.add("78362.00")
CBO2.Items.add("12097.20")
CBO2.Items.add("89267.34")
CBO2.Items.add("34959.06")
CBO2.Items.add("559284.50")

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 two arrayson the global level, one called names to contain the names shown in CBO1 and the other balances to contain the balances shown in CBO2. The location of the name determines the balance at that same location. Only declare the array but do not size them, assuming we have not gotten the size of the data to go into the arrays.
  2. Write code for the click handler of a button named Get Data. The handling code simply copies each entry from the combo into the proper array element. To do this, you need to size the arrays based on the combo box size using the Redim statement for both arrays. The number of elements in a combobox is based on its .items.count property. Note that if the count is 4, then the array must be declared with the number 3 to have 4 elements. Then using a for loop copy each element from the combo (CBO1 into names and CBO2 into balances). Use one for loop to copy data into both arrays. Each combo item is accessed using the .item property which requires the proper conversion before storing into the arrays.
  3. Write a handler code for a button named Show Balance, that asks the user to type in the client name into aninputbox(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 of all those who have a balance under $5000. You need to accumulate the names as strings using the & operating showing each client name on one line, hence you will need to also & controlchars.CRLF

Please follow the directions above exactly as they are to earn full credit.

Back to Unit 10.

Answers

(11)
Status NEW Posted 08 May 2017 06:05 AM My Price 8.00

-----------

Not Rated(0)