Groups | Blog | Home
all groups > vj# > february 2005 >

vj# : Need some help please


noir
2/9/2005 8:27:24 AM

can someone write or find a program with
1. convert between data types
2. use an array
3. use a vector
4. use a loop
5. use branching statement

The program does not have to be complicated or big, just a simple one
is okey.
If someone is really that kind please paste the code into this threat
or e - mail me: chotchot_@hotmail.com

Thanks a lot



--
noir
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------
daroo NO[at]SPAM sympatico.ca
2/9/2005 11:48:13 AM
[quoted text, click to view]

Lars-Inge Tønnessen [VJ# MVP]
2/10/2005 5:48:35 PM

What have you done so far ? Please show us you code.


Regards,
Lars-Inge Tønnessen

George Birbilis [MVP J#] [9880]
2/12/2005 10:42:05 PM
[quoted text, click to view]

//convert integer to string
int x=0;
String s=String.valueOf(x);

[quoted text, click to view]

//init an array with numbers 0-9
int a[10];
for(int i=0;i<10;i++) {
a[i]=i;
}

[quoted text, click to view]

//create a Vector and add integer values 0 and 1 to it (as instances of
Integer class)
java.util.Vector v=new java.util.Vector();
v.add(new Integer(0));
v.add(new Integer(1));

[quoted text, click to view]

see case [2] above

[quoted text, click to view]


int x=1;
if (x!=0) {
System.out.println("value is "+x);
//if the above line doesn't compile try "value is "+String.valueOf(x)
instead
} else {
System.out.prinltn("value is zero");
}

to make all these into a program do something like

public static void main(String[] args){
//...put your code here, using "System.out.prinltn(...)" wherever you need
to print out messages/values
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
George Birbilis <birbilis@kagi.com>
Microsoft MVP J# for 2004, 2005
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ QuickTime controls (Delphi & ActiveX: VB, PowerPoint, .NET)
+ Plugs (InterProcess/Internet communication)
+ TranXform (VB6 form to ASP.net WebForm convertion)
http://www.kagi.com/birbilis
+ Robotics
http://www.mech.upatras.gr/~robgroup
.........................................................................

AddThis Social Bookmark Button