Search:

Type: Posts; User: Ubiquitous

Page 1 of 3 1 2 3

Search: Search took 0.11 seconds.

  1. Replies
    17
    Views
    1,584

    [SOLVED] Re: Counting input array

    An arrayList is just a re-sizable array and you are not need to use it.

    When you initialize an array and give it a number


    int[] i = new int[2];

    Think of it as this "Here is a container...
  2. Replies
    11
    Views
    1,212

    Re: Another Array Problem

    myArray in GregBrannon's examply is not 11. When you get .length of an array you are getting the amount of elements found in the array. The elements in his array happens to be Strings not Characters....
  3. Re: Hi there! I have a project and I need your help dear friends :D

    Not to sound like a jerk but most of the answer can be found through a simple google search. You mentioned it is your first year of college so take it one step at a time. It can be very daunting and...
  4. Replies
    14
    Views
    1,257

    Re: Array Problem

    You must iterate through the entire array to compare the elements. When you call a "return" you are returning a value to the method which called the method. In this instance as haski has mentioned...
  5. Replies
    17
    Views
    3,025

    Re: is something wrong with my code? Lab 10.1

    One thing is you initialized t as int t = ; Did you mean to initialize it at 0?

    Another thing you have nested while loops which are infinite loops. while (t <= 12) how is the condition ever...
  6. Replies
    4
    Views
    951

    [SOLVED] Re: Small problem

    Check this portion of your code:

    //loop through alphabet
    for(int j=0;j<alphabet.length;j++){

    if(cTEXT.equals(alphabet[j])){

    if(j<1){
    cTEXT =...
  7. Replies
    5
    Views
    2,511

    Re: Recursion to Print and Count

    There is one improvement I would do on your code GregBrannon as your current code executes at O(n)



    // method odds2() prints and counts the number of odd numbers from the
    // given...
  8. Replies
    132
    Views
    72,297

    Sticky: Re: 500 Ways to Print 1 to 10

    If this is still going how about any of these? Hopefully one of them is new to the list.


    for (int i = 10; i < 20; i++){
    System.out.print(i % 10 + 1 + " ");
    }
    ...
  9. Replies
    3
    Views
    1,417

    Re: i want a solved java programs

    public class SolvedPrograms{
    public static void main(String[] args){
    String valid = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789,'. !";
    String message = "" + valid.charAt(2) + valid.charAt(7) +...
  10. Replies
    3
    Views
    1,284

    Re: Code Experiment - Why the change?

    Are they the same values? They may have been initialized with the same initial value but does it remain like so?

    Do this in your compiler:


    int a = 5;
    System.out.println(a);
    a++;...
  11. Re: Can any one tell me why I am getting an error

    I hope I am mistaken but it appears as if you just copied one of your peers code and commented out to change the appearance of the program. By commenting out the methods in your main class and...
  12. Re: Help with hypotenuse code that uses JOptionPane PLEASE help

    Being out of class is no excuse for lack of effort. I do not mean to sound rude but what have you tried? As anyone with some experience will tell you when it comes to programming practice is what...
  13. Replies
    1
    Views
    1,000

    Re: homework help

    The problem tells you all the information you need.

    What parameters to put, what return type if any is required, what type of data type you will be working with and even the formula you need.
    ...
  14. Re: Methods with parameters and return values help

    What specifically are you having trouble with? Have you tried running the code to see what happens?
  15. Replies
    10
    Views
    1,124

    Re: why is my while loop terminating?

    Difficult to interpret what he is trying to do, but what I take from it is that he wants to call simulateFlight() and then it prints out something like (100, 91, 74, etc...) with one call till it...
  16. Thread: Help Please

    by Ubiquitous
    Replies
    1
    Views
    1,184

    Re: Help Please

    Sure how much are you paying for both of your assignments since this are considered jobs now. All jokes aside no one here is going to give you code. We will assist you in correcting your code and...
  17. Replies
    5
    Views
    1,604

    Re: Variables not initialized?

    Have you tested your code beside compiling it? Just a few issues that you may have fixed already.

    For example in this code block:


    // What are the ints for? The are declared but...
  18. Replies
    5
    Views
    1,490

    Re: Connect 4 Help

    Well onto a potential issue I see. Ok your nested loops do these part on paper.


    // Single chip near the top
    Column 0 - 6
    Row 5
    i = 1 && board.Array[row + i][col].getType()

    // 2 Same chips...
  19. Replies
    5
    Views
    1,303

    Re: Method returns empty stack when called

    Double posted here thread locked due to it being in a different post as well

    As I had asked in that post how are you calling your method? Not only that you are now returning an empty stack and not...
  20. Replies
    6
    Views
    1,178

    Re: I need help developing an algorithm.

    @Norm I wasn't saying to convert them to do the int I was simply wondering if the value for 'A' was 65 and 'Z' was 90. I should have been a little clearer on my confusion since I don't exactly know...
  21. Replies
    8
    Views
    1,329

    Re: Help with boolean logic please!

    I was asking about the main Method because I am don't see isHeavyBook() invoked anywhere in you Book Class I might just be missing it though. I am unsure how it is suppose to be implemented without...
  22. Replies
    3
    Views
    1,173

    Re: My reverse method wont work

    How are you calling the reverse method? Also how are your pop and push methods setup? For example is there a need to create a new node get its value then push and pop or can you do it all in a single...
  23. Replies
    1
    Views
    1,064

    Re: String Manipulations Help

    In both methods you are asking for an input parameter and then you create a String result. In both methods you leave result untouched and just add to the input String passed and the return that same...
  24. Replies
    2
    Views
    1,466

    Re: How to generate random numbers in Java?

    I have never done that with randoms. Perhaps you are complicating it more than it should? I see a solution with an Array and a random value with max size of array.
  25. Replies
    8
    Views
    1,329

    Re: Help with boolean logic please!

    Well the getters you have don't really prove the need for an argument to be passed down to them.
    For example


    Book b = new Book();
    b.setTitle("Some book");
    System.out.println("Title: " +...
Results 1 to 25 of 70
Page 1 of 3 1 2 3