Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Visual Basic Chapter 5 Programming Challenge 6 Bar Chart. I need help writing this code. I have one but it's wrong. I know that there's

Visual Basic Chapter 5 Programming Challenge 6 Bar Chart. I need help writing this code. I have one but it's wrong. I know that there's something that is suppose to come after the For and then have a Next. But I'm just confused now. Here's the program I need help with:

Bar Chart

Create an application that prompts the user to enter today's sales for five stores. The program should then display a simple bar graph comparing each store's sales. Create each bar in the bar graph by displaying a row of astericks (***) in a list box. Each asterisk in a bar represents $100 in sales.

So, I created the form with a List box and 2 buttons, one Display Chart and the other is Exit. Here's the code I have so far (which is wrong).

Private Sub ListBxChart_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ListBxChart.SelectedIndexChanged 'Clear List Box Items ListBxChart.Items.Clear() 'Counter to keep track of number of stores that have been entered Dim n As Integer = 0 For n = 1 To 5 'Something needs to go HERE!!!!!!!!!! Next 'Sales for the Store Dim store As Integer = CInt(InputBox("Enter the sales for store #" & n, "Sales Amount Needed")) 'Counter to determine the number of asterisks to use Dim asteriskCount As Integer = 0 'Inner Do while loop Do While store > 0 store -= 100 asteriskCount += 1 Loop 'Add a new string to the ListBox consisting of the char * 'Repeat asteriskCount times ListBxChart.Items.Add("Store" + n.ToString() + ":" + New String("*"c, asteriskCount))

End Sub End Class

PLEASE HELP!!!!!!!!!!!!!!!!!!!!!!!

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_2

Step: 3

blur-text-image_3

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

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

Students also viewed these Databases questions

Question

Describe the two major forms of workforce diversity. AppendixLO1

Answered: 1 week ago