Results 1 to 11 of 11

Thread: Simple multiplication progran help needed

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    8

    Simple multiplication progran help needed

    Hi I just started playing around with Visual Basics and I tried to make a simple program to work out a price on a square item of steel, but I'm stuck. The program has to multiply the length, width, thickness, the rate, and the mass 8.3 rounded off standard and then decided by 100000 to get rid of all the 0's.

    So If we have a 300 square plate that's 12mm thick the calculation will be 300 x 300 x 12 (thickness) x 12(rate in Rands) x 8.3 (constant) / 1000000 the answer will be 107.568.

    Please help me this is what I have done.

    Code:
    Public Class Form1
    
        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 num1, num2, num3, num4, num5, num6, product As Single
            num1 = TextBox1.Text
            num2 = TextBox2.Text
            num3 = TextBox3.Text
            num4 = TextBox4.Text
            num5 = Val(8.3)
            num6 = Val(1000000)
            product = num1 * num2 * num3 * num4 * num5 / num6
    
    
        End Sub
    Last edited by Siddharth Rout; May 8th, 2013 at 04:06 PM. Reason: Formatted post + Added Code tags

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