new at java.......
how do i generate a random number say between 1 and 5
User Profile
Collapse
-
random number.........
-
Is This Correct.
public void add( examplexx a, examplexx b)
{
int carry=0;
int sum=0;
for(int i=0; i<values.length ; i ++)
{
sum=carry + values.length + values.length;
if( sum >=10)
{
sum= sum-10;
carry =1;
}
else
{
carry =0;
}
... -
i need hepl with the addition and subtraction method.above you will see what i did so far.
also how do you declare a class within a class method. example.
the program would be:
example test=new example()
example test2=new example()
example test3=new example()
test.readinfo() ;
test2.readinfo( )
test3(test,test 2) HOW IS THIS REPRESENTED INT THE CLASS METHOD
...Leave a comment:
-
am sorry, but i am.
that is what i came up with for the read statement, now following that i need help in the addition method, note please take a look at the program also.Leave a comment:
-
this is what the program look like.
public class Quest
{
public static void main(String []args)
{
example test= new example (5);
example test2= new example(6);
example test3= new example(7);
test.readinfo() ;
test.printnum() ;
test2.readinfo( );
test2.printnum( );
test3.add(test, test2);
...Leave a comment:
-
could u wirte a method for me to see what it would look like, doing it the "FAIR method. thanksLeave a comment:
-
-
the addition method i need help with must do for example 125895+3567904.
the read statement looks some thing like this
[QUOTE]for ( int i=array.length -1; i >=0; i - -)
array[i]=key.nextInt();
/QUOTE]
Note this is a 1dim array.Leave a comment:
-
THANKS r035198x,
will keep u posted as i progress with this problem.Leave a comment:
-
I NEED UR HELP IN Writing at least one method, thanks
here is the full question;
create a class called large integer that uses an int array to store very large integers and perform arithmetic and logic operations.
given default constructot 40element array to hold large integer and sets the current length of array to 0 and max to 40.
provide methods, to perform addition, subtraction,...Leave a comment:
-
more info on my question, ADDING LARGE INTEGERS, in java arrays
I need help in writing the addition , subtraction etc. method.
eample the add method must add large intergers,
say 2500 + 69587562. each number is entered in the subscript individually.
this is what i have done so far.I created the class,construct ors
public class Example
{
private int[] values;
private int min;
private int max;
... -
am new to java , will appreciate help
Q. Class name largeinteger is a 20 element array to hold large integer. default Constructors are int[]a=40, int length=0, int max=40.
write:
** constructor with int parameter for size of array.
** write method to perform addition , subtracton, output a large integer, compare 2 large integer for equality.
No activity results to display
Show More
Leave a comment: