Develop a simple application for the ice-cream games

Assignment Help Visual Basic Programming
Reference no: EM13748956

Objectives

At the end of this lab you should be able to:

- Work with List Boxes. Add and remove items from list boxes during design and runtime.
- Use For Next Loops with List boxes.
- Learn how to write programs using arrays.
- How to declare and manipulate data into one-dimensional arrays.
- Use appropriate repetition structures to process one-dimensional arrays.
- Access individual array elements.

Pre-Lab (before coming to the lab)

i. Read the description of each activity carefully and thoroughly so that you understand what the problem is about i.e. what are the requirements and possible solutions for the given problem.

ii. Once you understand each activity requirement(s), Then design the interface keeping in mind what the user needs to input into the application; tasks that the program needs to perform and what needs to be displayed as output.

Activity 1: Working with List Boxes

Develop a simple application for the Ice-Cream Games, which captures information about athletes and populates a list box.

You program should have the following elements:

- A text box to enter the name for the athlete.

- A list box which lists all the country names which are participating in the events, for the user to choose from.

- A list box which lists the ages from 16 to 25 years.

- A command button called "Add to List" to add the information entered thus far to a third list box.

1. This list box should display the name of the Athlete concatenated with the country chosen from the country list box and Age from the age list box.

2. For example: an item in the list box might read "John Doe, 23 is from Fiji".

- A command button called "Remove from List" which should remove the selected item from the (third) list. Confirm whether the user really wants to delete the selected item or not.

- A command button to exit the program.

Activity 2: Investment Application

Create an application that allows the user to enter an initial investment amount, the percentage return on investment (a decimal e.g. 0.125 for 12.5%) over the year and the number of years of the investment (duration). All these input should be entered in respective textboxes. Have a command button called "Calculate" which should calculate the final value of the investment and display it in a message box.

The return on investment is cumulative in nature.

Hint:

Use a For Next Loop to calculate the final investment. Use the following algorithm.

For Year_1 to Number_Of_Years_Entered

Final_investment = Previous_Final_Investment + Return_On_Investment** Next

**Where Return_On_Investment is calculated as

(Investment * %return on investment). Final_investment is calculated through each pass of the loop should be added to a list box in the format "Year: Final_investment" (excluding the quotes of course)

[Note the above code like syntax is not actually code but pseudo code, so don't attempt to write it into VB as it is. It won't work!]

Activity 3a: An application to analyze Exam Results using arrays

Create a Windows application that uses variable arrays to store the student's name and their mid semester marks.

For example:

Dim strNames() As String = {"Hova", "Nemo", "Zoc", "Lucas", _
"Phuket", "Cindy", "Marlin", "Darla", "Nigel", "Cindrella"}
Dim dblMarks() As Double = {32.5, 88, 90.5, 67.5, 65, 77.5, 85, 78.5, 89.5, 90}

Have a command button that when clicked produces various statistics, such as:
- Average mark
- Highest mark scored and the student who scored it. (* There are no ties)
- Lowest mark scored and the student who scored it (** There are no ties)
- The range (i.e. Highest score - lowest score)

Display the results appropriate labels on your form.

Activity 3b: An application to analyze Exam Results using a structure array

Modify the application for Exercise 3(a) so that the data on student names and marks are stored in an array of type Student Structure.

For example: Declare the following structure at module or class level:

Structure Student

Public strName As String

Public dblMark As String

End Structure

Modify the click event handler of the command button that calculates the statistics by declaring an array of Student structure and populate the array with the same data as in 3b.

An array of Student, the structure

Dim StudentMarks(9) As Student
Populate the array of Student

StudentMarks(0).strName = "Hova"

StudentMarks(0).dblMark = 32.5

StudentMarks(1).strName = "Nemo"

StudentMarks(1).dblMark = 88

StudentMarks(2).strName = "Zoc"

StudentMarks(2).dblMark = 90.5

StudentMarks(3).strName = "Lucas"

StudentMarks(3).dblMark = 67.5

StudentMarks(4).strName = "Phuket"

StudentMarks(4).dblMark = 65

StudentMarks(5).strName = "Cindy"

StudentMarks(5).dblMark = 77.5

StudentMarks(6).strName = "Marlin"

StudentMarks(6).dblMark = 85

StudentMarks(7).strName = "Darla"

StudentMarks(7).dblMark = 78.5

StudentMarks(8).strName = "Nigel"

StudentMarks(8).dblMark = 89.5

StudentMarks(9).strName = "Cindrella"

StudentMarks(9).dblMark = 90

Now in your code for the calculations, everywhere you used dlbMarks, replace that line with StudentMarks(index).dblMark, where index is the loop control variable.

Activity 4: Using arrays to store information

Create a Windows application that allows the user to enter, store and display athlete information. This application therefore should allow the user to enter athlete name in a textbox, choose their home country from a list box and enter their hobbies using input boxes.

Your application should have the following elements for the user interface:

- A text box to enter the name of the athlete.
- A list box that lists the participating countries for the games. (Have at least 5 countries)
- A command button called "Enter Hobbies" that should trigger a Do...Loop Input Box loop where athlete's hobbies are entered one by one. As the hobbies are entered the values are concatenated in a string variable. A blank entry in the input box should trigger the end of the
loop.
- A command button called "Add Athlete" that saves the information, clears the text box and gets ready for the next athlete data. Your application should use:

  o an array of 20 strings for the athlete name (strNames),
  o an array of 20 strings for the country (strCountries), and
  o another array of 20 strings for athlete hobbies (strHobbies) to save the information into
- You would also need an integer variable with module/class scope initialized to 0 to keep track of the position in the array data is to be filled in say _intPosition. That is, data should be stored at index position contained in this variable, and after that this variable should be incremented by

1. After saving the data in the arrays, the name of the athlete concatenated with athlete country (Format: Athlete name: Country) should be added in a list box.

- At any point in time the user can click the Athlete name: Country in the list box and view his/her hobbies in a label.

[Hint: Use a For loop to go through the filled in information in the arrays. The variable declared in the above step (to keep track of the index position data is to be entered in the arrays) should be used to indicate the number of times the loop must repeat.]

Implement the following algorithm using the SelectedIndexChanged event handler for the list box.

1. Extract the Athlete name from the selected item in the list box. (Use the IndexOf() and Substring() string manipulation methods.) Store result in a string variable - strSearchName.

2. For intIndex 0 to mintPosition - 1

a. If strSearchName matches athlete name in strNames array at position intIndex Then

i. Display contents of array strHobbies at position intIndex in a label.

b. End if

3. End for loop

Reference no: EM13748956

Questions Cloud

Pro forma statements of five year projections : Using the sample financial statements, create pro forma statements of five year projections that are clear, concise, and easy to read. Be sure to double check the calculations in your pro forma statements. Make assumptions that support each line i..
Provide the journal entry for the asset revaluation : S. Stephens adn J. Perez are partners in Space designs. Stephens and Perez share income equally. D Fredrick will be admitted to the partnership. Prior to teh admission, equipment was revalued downward by $18,000.  Provide the journal entry for the as..
Present value-pv of multiple cash flows : Tommie Harris is considering an investment that pays 6.5 percent annually. How much must he invest today such that he will have $25,000 in seven years? (Round to the nearest dollar.)
Transaction will consist of a debit to cash : The Sneed Corporation issues 10,000 shares of $50 par value preferred stock for cash at $75 per share. The entry to record the transaction will consist of a debit to Cash for $750,000 and a credit or credits to:
Develop a simple application for the ice-cream games : Develop a simple application for the Ice-Cream Games, which captures information about athletes and populates a list box.
Write a powershell script that contains cmdlets : Assignment : Write a PowerShell script that contains cmdlets (no aliases) that meets the following requirements: Create an script named xyz123_AD.ps1 that accomplished the following: Create user1_StudentID throughuser10_StudentID where StudentID is..
Prior to the revaluation-income equally : S. Stephens adn J. Perez are partners in Space designs. Stephens and Perez share income equally. D Fredrick will be admitted to the partnership. Prior to teh admission, equipment was revalued downward by $18,000. The capital balances of each partner ..
Explain interactions between the europeens and asia : In 1800 words on the meeting and interactions between the europeens and asia. Specifically with china, india and japan.
Identify the extent of social media : Identify the extent of social media, if any, that is used to communicate with customers or prospects to include customer service interaction

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Gas pump - compute the total cost from the number of gallons

Write a program that will help an elementary school student learn multiplication and compute the total cost from the number of gallons entered and the selected grade.

  Table of decimal octal hexadecimal and binary equivalents

write a program that displays in a textbox a table of the binary octal amd hexadecimal equivalents of the decimal

  Effectiveness of the design and proposed program

Evaluate the overall design of the application and draw appropriate conclusions as to the effectiveness of the design and proposed program - Discuss and justify a means of representing the results of the calculations via an appropriate medium/objec..

  Write a program to request a positive integer

Continue this process until the number equals 1. Then display the number of repetitions the program required - write a program to determine when the world's population was under 6 million.

  To demonstrate completing and delivering a prototype rad

to demonstrate completing and delivering a prototype rad system using oops capabilities of vb.net. prepare a vvb boards

  Why is the theory of charisma described as a double-edge

why is the theory of charisma described as a double-edge sword? please identify a leader that used charisma in a

  Note use visual basic 2010visual basicassignment1 nbsp

note use visual basic 2010visual basicassignment1 nbsp nbspticketsellerthis assignment will contain two 2 parts event

  Create a sub procedure that calculates and displays the next

A national Digital service provider would like you to create a Windows application that will display the global growth of smartphones. As of 2013, there 913 million smartphones worldwide.

  Computer-assisted instruction write a program that will

write a program that will help an elementary school student learn multiplication. use a random object to produce two

  Triangle of asterisks write a program that displays the

write a program that displays the following patterns separately one below the other in a textbox. use for...next loops

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Prepare a vb application for the subsequent math application

Prepare a VB application for the subsequent Math Application - The problems displayed for the students into two levels.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd