i need help with a vb project anything helps! :)
-
Im completing a project for my VB class and kind of lost at some things.. these are the requirements: Julia really liked the How Big is My Room app but realized it would be much better if she could calculate the cost of ALL of her rooms in the same window. She would keep a similar layout, but change the program to handle a list of rooms, displaying the size and cost of all of the rooms and a total cost to resurface the floors in her entire home. 1. She knows that if she measures the length and width of each room, she can determine the area or square-footage. (roomSize = roomWidth * roomLength) 2. To get the price for each room she multiplies the area of the room times the price of the material (totalCost = roomSize * costOfMaterial) 3. Presents the user with a picture of carpet or other flooring material (you will need to find an images on the World Wide Web and download it. Must be in JPG,PNG,GIF,TIF format) a. b. Present the user the option to enter her first name c. Present the user the option to enter her last name d. Present the user the option to enter the room name e. Present the user the option to enter the room width (in feet) f. Present the user the option to enter the room length (in feet) 1) The picture must change to the corresponding floor type 2) The cost of material must change 3) The cost per room for each room must change and be displayed properly 4) The output totals should reflect the change i. When a user changes a floor type… Present the user the option to choose a floor type using radio buttons. The text of the radio button should reflect the type and cost per sq/ft for that type. g. Present a list of rooms in a list box. Each room in the list box will be indicated by its room name h. i. Use other listboxes to keep track of the length, width and total cost of a room. Presents the user the option to submit the entry with a button by clicking with the mouse or pressing the enter key. j.Check to make sure all boxes are filled in. Warn the user with a message box that states "Please enter something in all boxes" (or a similar message) -- (hint: if textbox1.text <> "" and textbox2.text <> "" then…) i. Check to make sure the user has chosen a floor type. Warn the user with a message that states "Please choose a Floor Type first!" (or a similar message) -- (hint: if radio1.checked = true then…) iii. Enter the room information to the appropriate list boxes a) First Name "Julia" b) Last Name "Anderson" 1) If the user provides the following input iv
-
Im completing a project for my VB class and kind of lost at some things.. these are the requirements: Julia really liked the How Big is My Room app but realized it would be much better if she could calculate the cost of ALL of her rooms in the same window. She would keep a similar layout, but change the program to handle a list of rooms, displaying the size and cost of all of the rooms and a total cost to resurface the floors in her entire home. 1. She knows that if she measures the length and width of each room, she can determine the area or square-footage. (roomSize = roomWidth * roomLength) 2. To get the price for each room she multiplies the area of the room times the price of the material (totalCost = roomSize * costOfMaterial) 3. Presents the user with a picture of carpet or other flooring material (you will need to find an images on the World Wide Web and download it. Must be in JPG,PNG,GIF,TIF format) a. b. Present the user the option to enter her first name c. Present the user the option to enter her last name d. Present the user the option to enter the room name e. Present the user the option to enter the room width (in feet) f. Present the user the option to enter the room length (in feet) 1) The picture must change to the corresponding floor type 2) The cost of material must change 3) The cost per room for each room must change and be displayed properly 4) The output totals should reflect the change i. When a user changes a floor type… Present the user the option to choose a floor type using radio buttons. The text of the radio button should reflect the type and cost per sq/ft for that type. g. Present a list of rooms in a list box. Each room in the list box will be indicated by its room name h. i. Use other listboxes to keep track of the length, width and total cost of a room. Presents the user the option to submit the entry with a button by clicking with the mouse or pressing the enter key. j.Check to make sure all boxes are filled in. Warn the user with a message box that states "Please enter something in all boxes" (or a similar message) -- (hint: if textbox1.text <> "" and textbox2.text <> "" then…) i. Check to make sure the user has chosen a floor type. Warn the user with a message that states "Please choose a Floor Type first!" (or a similar message) -- (hint: if radio1.checked = true then…) iii. Enter the room information to the appropriate list boxes a) First Name "Julia" b) Last Name "Anderson" 1) If the user provides the following input iv
-
Yes I'm having trouble with moving the data from the text box to the list of seperately, when it calculate and move together, I tried the if else but it keep popping up with a error. Thanks
-
Yes I'm having trouble with moving the data from the text box to the list of seperately, when it calculate and move together, I tried the if else but it keep popping up with a error. Thanks
Member 11264383 wrote:
moving the data from the text box to the list of seperately,
Which list is that? You're already adding data from a textbox to a listbox, so that is probably not what you meant.
Member 11264383 wrote:
when it calculate and move together
I'd use a button. You could automatically recalculate whenever one of the entries change, but it is really a lot easier to have a button that says "calculate now". You'd have to foreach each room, and perform the calculation.
Member 11264383 wrote:
I tried the if else but it keep popping up with a error.
What error?
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
-
Member 11264383 wrote:
moving the data from the text box to the list of seperately,
Which list is that? You're already adding data from a textbox to a listbox, so that is probably not what you meant.
Member 11264383 wrote:
when it calculate and move together
I'd use a button. You could automatically recalculate whenever one of the entries change, but it is really a lot easier to have a button that says "calculate now". You'd have to foreach each room, and perform the calculation.
Member 11264383 wrote:
I tried the if else but it keep popping up with a error.
What error?
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]
Eddy is right in the foreach, but for recalculation, I'd have a handler that handles the on change event from each of the boxes, it can all be done in one subroutine
'kinda like this
private sub TextboxChanged(sender as object, e as eventargs) handles txtRoomWidth.changed, txtRoomLength.changed, lstFlooringType.changeddim SquareFootage as single = txtRoomWidth.value * txtRoomLength.value
dim CostPerFoot as single 'Insert code here to get the cost per square foot of the current flooring typedim RoomCost as single = Squarefootage * CostPerFoot
'put code here to insert the cost into the list of costs
dim totalprice as single = 0
foreach RoomPrice as single in RoomPriceList totalprice += RoomPrice next
txtTotalprice.value = "Total cost is $" & totalprice
end sub
I'd have used the names you used, but I can't open both windows at once