CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Mar 2013
    Posts
    6

    Resolved Homework Help!! Please!!

    I am so lost in this class. I just need to get past my last two assignments in this class and I don't have to worry about VB again. I am going to school for web development/Admin.

    Please help me, I don't even know how to start this code off. Any help would be greatly appreciated!! Here is the assignment....

    Purpose: The purpose of this assignment is to use sub procedures.

    Write a Visual Basic program that calculates the cans of paint required to cover a room.

    Each can of paint covers 500 square feet of surface area.

    Your form should have enough text boxes to calculate the area of 4 walls. Your form should also have a calculate button, a clear button and an exit button. It is required that your calculations use a sub procedure to determine the number of paint cans needed. This sub procedure should be called from the calc button. There must be data passed to the sub procedure with parameters. Note that you should move the data from the text boxes to variables. You should then do calculations using variables. You then take the data from the variables and display it on the form in labels.

    I know this is a piece of cake for you boys, but this class makes me feel like an idiot. I am barely passing

    Thank you boys!!!

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Homework Help!! Please!!

    It is the quote from Announcements you should have already read:
    A special note about Homework
    We have an FAQ about homework questions. If your question is related to a homework assignment, then read this FAQ. It will help you, help yourself!
    Victor Nijegorodov

  3. #3
    Join Date
    Mar 2013
    Posts
    6

    Re: Homework Help!! Please!!

    That did not help VictorN. But thanks sweetie.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Homework Help!! Please!!

    You have to show what you have already done and what problem you currently have that prevent you to go on.
    Only after that you could expect some additional help.
    Victor Nijegorodov

  5. #5
    Join Date
    Mar 2013
    Posts
    6

    Re: Homework Help!! Please!!

    Public Class Form1

    Public Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

    wall1HT.Clear()
    wall1LT.Clear()
    wall2HT.Clear()
    wall2LT.Clear()
    wall3HT.Clear()
    wall3LT.Clear()
    wall4HT.Clear()
    wall4LT.Clear()

    End Sub

    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
    Me.Close()
    End Sub
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim wall1HT As Integer = 0
    Dim wall1LT As Integer = 0
    Dim wall2HT As Integer = 0
    Dim wall2LT As Integer = 0
    Dim wall3HT As Integer = 0
    Dim wall3LT As Integer = 0
    Dim wall4HT As Integer = 0
    Dim wall4LT As Integer = 0
    Dim wall1Total As Integer = 0
    Dim wall2Total As Integer = 0
    Dim wall3Total As Integer = 0
    Dim wall4Total As Integer = 0
    Dim paintCans As Single

    wall1Total = wall1HT * wall1LT
    wall2Total = wall2HT * wall2LT
    wall3Total = wall3HT * wall2LT
    wall4Total = wall4HT * wall4LT

    paintCans = wall1Total + wall2Total + wall3Total + wall4Total

    For paintCans = 0 To 1000 Step 1
    If paintCans <= 500 Then
    paintCans = 1
    Else
    For paintCans = 501 To 1000 Step 1

    Next
    End If
    Next

    paintCans = ansLBL.Text


    End Sub
    End Class

    I am really bad at this. I know this is completely wrong in every aspect. Please dont be mad that i am butchering your language.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Homework Help!! Please!!

    1. You have to use Code tags while posting code snippets. Otherwise your code is unreadable.
    2. What problem with this code (and where) do you have?
    Victor Nijegorodov

  7. #7
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Homework Help!! Please!!

    Also
    She should post in VB.Net forum
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured