Search:

Type: Posts; User: gonfreecks

Page 1 of 2 1 2

Search: Search took 0.09 seconds.

  1. Replies
    1
    Views
    2,608

    About the ackermann function...

    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...
  2. Replies
    2
    Views
    1,580

    Re: question about recursion..

    that helped thank you :)
  3. Replies
    2
    Views
    1,580

    question about recursion..

    public class Recursion {

    public static double power(double a, int n){
    double tmp,result,answer;

    if(n % 2 == 0){
    tmp = power(a, n-1);
    result = (tmp*(n/2));
    ...
  4. 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...
  5. Replies
    1
    Views
    1,308

    Help with this please :)

    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. Replies
    5
    Views
    1,645

    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. Replies
    5
    Views
    1,645

    Re: 1st time using methods

    i already tried that code

    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. Replies
    5
    Views
    1,645

    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...
  9. Replies
    0
    Views
    1,240

    2d arrays help

    nevermind already done it
  10. Replies
    1
    Views
    1,379

    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...
  11. Replies
    5
    Views
    2,161

    Re: random numbers in array please help

    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?
  12. Replies
    5
    Views
    2,161

    Re: random numbers in array please help

    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)
    ...
  13. Replies
    5
    Views
    2,161

    random numbers in array please help

    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. Replies
    2
    Views
    1,397

    Re: help with this, just a question

    its still kinda long though can im thinking of using a for loop for this
  15. Replies
    2
    Views
    1,397

    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. 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. 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. Replies
    6
    Views
    1,569

    help im stumped :(

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




    do {
    System.out.print("Enter number : ");
  19. Replies
    3
    Views
    1,393

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

    yeah nevermind i got it already thank you anyways.... :)
  20. Replies
    3
    Views
    1,393

    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. Replies
    3
    Views
    1,393

    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);
  22. Thread: help factor

    by gonfreecks
    Replies
    13
    Views
    1,775

    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 :)
  23. Thread: help factor

    by gonfreecks
    Replies
    13
    Views
    1,775

    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
  24. Thread: help factor

    by gonfreecks
    Replies
    13
    Views
    1,775

    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 = "";
    ...
  25. Replies
    3
    Views
    1,088

    Re: help on this...

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