d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Help!
Add Reply New Topic New Poll
Member
Posts: 7,490
Joined: Jun 22 2007
Gold: 5.00
Sep 24 2012 07:55pm
I need to make a VB script that allows you to put in the dimensions of an area and will spit out the area of that area. Example: a room is ten by ten, plug in these numbers and it will give me one hundred. I'll donate to anyone that helps! Thanks.
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Sep 24 2012 09:12pm
function multiply(byval one as integer, byval two as integer)
multiply = one * two
end function

something like that?
Member
Posts: 24,101
Joined: Nov 8 2007
Gold: 5,561.70
Sep 24 2012 09:32pm
Quote (carteblanche @ Sep 24 2012 11:12pm)
function multiply(byval one as integer, byval two as integer)
multiply = one * two
end function

something like that?


Code
public int area(int length, in width){
  return area * width; //or use System.out.println(area * width); if you want it to print it
}


Or if you want the user to input the variables themselves, put this in main

scanner sc = scanner.in();
int length= sc.nextInt();
int width = sc.nextInt();
area(length width);

Woops thought this was java, same type of thing just different syntax I assume.

This post was edited by lopelurag on Sep 24 2012 09:33pm
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll