Consulting

Results 1 to 5 of 5

Thread: Javascript to VB

  1. #1
    VBAX Newbie
    Joined
    Jan 2017
    Posts
    3
    Location

    Javascript to VB

    Can somebody help me convert this to VB?
    I need to multiply two numbers together without using *


    • System.out.println("Enter the first number");
    • BufferedReader obj =newBufferedReader(newInputStreamReader((System.in)));
    • int a=Integer.parseInt(obj.readLine());
    • System.out.println("Enter the Second number");
    • int b=Integer.parseInt(obj.readLine());
    • int c=0;
    • for(int i=0;i<b;i++){
    • c=c+a;
    • }
    • System.out.println("The Product is"+c);
    • }

  2. #2
    VBAX Newbie
    Joined
    Jan 2017
    Posts
    3
    Location
    I believe I got it!

    'Dim intinput1 As Integer
    'Dim intinput2 As Integer
    'Dim inttotal As Integer


    'intinput1 = 10
    'intinput2 = 4


    'Dim intcount As Integer = 0


    'Do Until intcount = intinput2
    ' intcount += 1
    ' inttotal = inttotal + intinput1
    'Loop


    'MessageBox.Show(inttotal)

  3. #3
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    Total = Input1 * Input2
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

  4. #4
    VBAX Newbie
    Joined
    Jan 2017
    Posts
    3
    Location
    Quote Originally Posted by SamT View Post
    Total = Input1 * Input2
    I had to solve this problem without using *. Although it was the first choice for me as well.

  5. #5
    Moderator VBAX Sage SamT's Avatar
    Joined
    Oct 2006
    Location
    Near Columbia
    Posts
    7,814
    Location
    My bad, I totally missed the * in the requirements.

    Glad you didn't
    I expect the student to do their homework and find all the errrors I leeve in.


    Please take the time to read the Forum FAQ

Posting Permissions

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