Search:

Type: Posts; User: gonfreecks

Page 1 of 2 1

Search: Search took 0.26 seconds.

by gonfreecks
Replies
1
Views
1,465

i cant really understand this concept

i have this code...

public static int A(int m, int n){

if(m == 0) return n+1;
else if(m > 0 && n ==0) return A(m-1,1);
else if(m > 0 && n > 0) return...

by gonfreecks
Replies
2
Views
486

that helped thank you :)

by gonfreecks
Replies
2
Views
486

public class Recursion {

public static double power(double a, int n){

if(n % 2 == 0){
tmp = power(a, n-1);
result = (tmp*(n/2));
...
4. Thread: help guys.. could you tell me what am i doing wrong?

by gonfreecks
Replies
1
Views
474

help guys.. could you tell me what am i doing wrong?

i am designing this my circle class

i. It should contain three private doubles for x, y and radius.
ii. A constructor that accepts three double parameters for x, y, and radius.
iii. A...

by gonfreecks
Replies
1
Views
412

import java.util.Scanner;
import java.io.*;

public class Part5{

public static int [][] getSubMat(int [][] data, int row, int col, int width, int height){

int [][] newMat = new int...
6. Thread: 1st time using methods

by gonfreecks
Replies
5
Views
449

Re: 1st time using methods

yeah but my homework specifically said that the data should be stored in the reference variable called mat and the size of the method should be the value returned

uhh you said to return the array...
7. Thread: 1st time using methods

by gonfreecks
Replies
5
Views
449

Re: 1st time using methods

public static void printMat(int [][] mat, int size){
for ( int i = 0; i < mat.length; i++ ){
for ( int j = 0; j < mat[i].length; j++ ){
...
8. Thread: 1st time using methods

by gonfreecks
Replies
5
Views
449

1st time using methods

public static int loadMat(int [][] mat) throws Exception{
int size, row, col = 0, num;
Scanner input = new Scanner(System.in);
System.out.print("Enter the size of the...

by gonfreecks
Replies
0
Views
394

10. Thread: finding specified NUMBERS in an array

by gonfreecks
Replies
1
Views
455

finding specified NUMBERS in an array

for (i = 0 ; i < list.length ; i++){
if (list[i] == list2[0])
location = i;
break;

ok i have that code which locates a single number but i cant figure out how to continue...

by gonfreecks
Replies
5
Views
1,159

o ok overlooked the equal sign sorry....
and thank you.. and uhm 1 more thing, how can i align the arrays?
is there a command like printf for arrays?

by gonfreecks
Replies
5
Views
1,159

thanks so much its working now but i dont get why an error keeps popping..

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 10
at lab8.Arrays.main(Arrays.java:35)
...

by gonfreecks
Replies
5
Views
1,159

public class Arrays {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);

int x, y =0;
int [] list;
list = new int [10];
int [] list2;
list2 = new...
14. Thread: help with this, just a question

by gonfreecks
Replies
2
Views
349

Re: help with this, just a question

its still kinda long though can im thinking of using a for loop for this
15. Thread: help with this, just a question

by gonfreecks
Replies
2
Views
349

help with this, just a question

ok we just started arrays yesterday and made us do a program..
this basically prints 2 lists of arrays that has 10 blocks with random numbers in each block (1-99)
it works but does anyone know how...
16. Thread: help... is this right? need some1 to clarify...

by gonfreecks
Replies
2
Views
360

Re: help... is this right? need some1 to clarify...

it works my calculation works fine but when i run the program it doesnt come close to the value of pi which is 3.14 sumthing only up to 2.7 sumthing..

am i doing the calculation wrong?

i did......
17. Thread: help... is this right? need some1 to clarify...

by gonfreecks
Replies
2
Views
360

help... is this right? need some1 to clarify...

double denom = 3;
double pi;
double x = -1;
int i;
double pi2 =0;
double denom2 = 0;
double pi3 = 0;

pi = 4*(1-((double)1/denom));
pi2 = pi;
18. Thread: help im stumped :(

by gonfreecks
Replies
6
Views
463

help im stumped :(

int num;
int i = 2;
int j;
String yn;

do {
System.out.print("Enter number : ");
19. Thread: could you tell me whats wrong....

by gonfreecks
Replies
3
Views
436

Re: could you tell me whats wrong....

yeah nevermind i got it already thank you anyways.... :)
20. Thread: could you tell me whats wrong....

by gonfreecks
Replies
3
Views
436

Re: could you tell me whats wrong....

double denom = 3;
double pi;
double x = -1;
int i;

for (i=1 ; i<=30000 ; i++){
pi = 4*(1-((double)1/denom));
x = x*-1;
21. Thread: could you tell me whats wrong....

by gonfreecks
Replies
3
Views
436

could you tell me whats wrong....

double denom = 3;
double pi;
double x = -1;
int i;

pi = 4*(1-((double)1/denom));

for (i=1 ; i<=30000 ; i++){
x = x*-1;
denom = (double)x*(denom+2);

by gonfreecks
Replies
13
Views
882

Re: help factor

and the posts of penguin is so advanced we havent even tackled some yet... but thanks for the effort though

and the 1st code you posted was an infinite loop :)

by gonfreecks
Replies
13
Views
882

Re: help factor

oh yeah my bad it runs 2 2 2 3 5 but if i run 150 it only runs 2 3 5 while it needs to output 2 3 5 5..

thanks for the help

by gonfreecks
Replies
13
Views
882

help factor

public class Factor {

public static void main(String[] args){
Scanner input=new Scanner (System.in);

String yn;
int number;
int current;
String output = "";
...

by gonfreecks
Replies
3
Views
370

Re: help on this...

uhh ok nevermind i got it thanks :)
Results 1 to 25 of 28
Page 1 of 2 1