User Profile

Collapse

Profile Sidebar

Collapse
monkey0525
monkey0525
Last Activity: Feb 14 '11, 04:32 AM
Joined: Apr 16 '10
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • monkey0525
    replied to How to reverse lines using LinkedList?
    in Java
    Ah! Thank you very much. :)
    See more | Go to post

    Leave a comment:


  • monkey0525
    started a topic How to reverse lines using LinkedList?
    in Java

    How to reverse lines using LinkedList?

    Hi, I'm writing a program that reverses the lines of a String using the LinkedList structure, which includes an iterator. I have my code written out, but every time my program runs, it takes a very long time before it outputs the lines. I'm having difficulty proceeding to the next step. If anyone could point me to the right direction on what to do next, I would greatly appreciate it.

    Also note: I'm unable to call the reverse() method...
    See more | Go to post

  • Ah, no. It does exist. I just excluded it from my code to make it as small as possible. I apologize that it exceeds 20 lines.
    See more | Go to post

    Leave a comment:


  • How to output basic arithmetic operations correctly?

    I'm creating a program that adds and subtracts fractions together. That being said however, my program does not seem to be responding correctly. Every time I run the client code, it outputs
    4/4, when I want it to add 1/2 and 1/2 (instead of 1), and 6/36, when I subtract 2/6 and 1/6 (instead of 1/6). My constructor code and client code is as follows:

    Code:
     // Constructor //
    public class RationalNumber
    {
    	int num;
    ...
    See more | Go to post

  • monkey0525
    started a topic Trouble with arrays
    in Java

    Trouble with arrays

    I'm trying to make a program that determines whether the score entered is passing (higher than 70.0) or failing (lower than 70.0). The array I'm using needs to be declared as
    Code:
    double[] scores = new double[50];
    so that every compartment in the array contains a real number between 0.0 and 100.0 inclusive.

    Code:
    public class Test
    {
       public static void main(String[] args)
       { 
          double[]
    ...
    See more | Go to post

  • monkey0525
    started a topic FileRead.java:79: cannot find symbol
    in Java

    FileRead.java:79: cannot find symbol

    I'm writing a program that reads information from three seperate classes. Here is my code:

    Code:
    public class Animal
    {
       protected int id;
       protected String type;
       protected double mass;
     
        //------------------------------------------------------------------------
        //  Sets up an animal with the specified ID number, type and weight.
        //------------------------------------------------------------------------
    ...
    See more | Go to post

  • Distinguishing integer numbers from if statements?

    I'm writing a program that reads information from three seperate classes. Here is my code:
    Code:
    public class Animal
    {
       protected int id;
       protected String type;
       protected double mass;
     
        //------------------------------------------------------------------------
        //  Sets up an animal with the specified ID number, type and weight.
        //------------------------------------------------------------------------
    ...
    See more | Go to post

  • monkey0525
    started a topic Program won't store integer from seperate file
    in Java

    Program won't store integer from seperate file

    As the title of the question states, my program is not able to store an integer from a seperate text file provided. For instance, instead of printing the desired output:

    "$45.00 17 2222 Chuck Taylor All Star"

    It prints:

    "$45.00 17 0 Chuck Taylor All Star"

    So even though I provided the price (double), quantity (integer) and name (string), my program can store all...
    See more | Go to post

  • Pardon my ignorance, but how can I do that?
    See more | Go to post

    Leave a comment:


  • The input is an integer whose value is zero. My program doesn't allow me to add any information in, it just displays the above message.
    See more | Go to post

    Leave a comment:


  • Exception in thread "main" java.util.NoSuchElementException

    Each time I run the ProgTwo program, it displays:

    1. Display one product
    2. Display all products
    3. Add a new CD
    6. Exit

    Enter your choice: Exception in thread "main" java.util.NoSuc hElementExcepti on
    at java.util.Scann er.throwFor(Sca nner.java:838)
    at java.util.Scann er.next(Scanner .java:1461)
    at java.util.Scann er.nextInt(Scan ner.java:2091)
    at java.util.Scann er.nextInt(Scan ner.java:2050)...
    See more | Go to post
No activity results to display
Show More
Working...