?
Solved

uploaded is a site with my problem please help asap

Posted on 2003-03-11
8
Medium Priority
?
179 Views
Last Modified: 2010-03-31
http://www.cashquest.biz/javahelp.html

please see question and contact info on this site.
0
Comment
Question by:earthnotes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 2

Expert Comment

by:karlika
ID: 8114785
I would really like to help you, but the code you posted has very few in common with java-code (or it's just VERY incomplete).
It would help if you would post some actual Exception you get.

Marko
0
 
LVL 35

Expert Comment

by:TimYates
ID: 8115468
-----------------------------------------------------------
Contacting you about this question in any way but via this question is against EE user policy, and you are in violation by asking...

Also, you should post your question and any code you have here, NOT on a supplimentary website (unless it is a demonstration of how an applet fails, etc...
-----------------------------------------------------------

Please post your question, and code
0
 

Author Comment

by:earthnotes
ID: 8122144
My problems are as follows

cannot resolve symbol


location: class java.util.ArrayList

the reason this code looks incomplete is because it is to be run by a driver program which I have not been able to use yet. Please help or post a question regarding this proble,

Thank you

http://www.cashquest.biz/javahelp.html
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 35

Accepted Solution

by:
TimYates earned 200 total points
ID: 8123060
QUESTION: (Which you are SUPPOSED to post HERE, not on another site)
------------------------------------------------------
someone please tell me why java won't recognize the mathods I am trying to use in the ArrayList class in the java.util package. I am going to run it with a driver when it runs.

Thank you,
Mike AIM: earth notes int
e-mail: earthnotes@mail.com

import java.util.ArrayList;

public class ArrayManip
{
 private int count, addInt, sum=0;
 private int position, length;
 private String name, pin;

 public ArrayManip()
 {
   System.out.println("What is your name?: ");
   name = Keyboard.readString();
   System.out.println("What is the pin for this set?: ");
   pin = Keyboard.readString();
 }
 //*********************************************************************

 public int inputInts()
 {
   ArrayList manip = new ArrayList();
   System.out.println("How many numbers in this set?: ");
   length = Keyboard.readInt();
   for(int i=0; i < length; i++)
   {
     System.out.println("Enter an Integer: ");
     addInt = Keyboard.readInt();
     manip.add (addInt);
     sum += addInt;
     count++;
   }
   System.out.println();
   System.out.println("Size of set: " + length);
 }

 //*********************************************************************

  public int deleteInt()
  {
    System.out.println("Remove which number?: ");
    int number = Keyboard.readInt();
    int deleteNumber = manip.indexOf (number);
    System.out.println();
    manip.remove (deleteNumber);
    sum -= manip.indexOf (number);
    System.out.println("Size of set: " + length);
  }

  public int displayInts()
  {
    System.out.println("Name: " + name);
    System.out.println();
    System.out.println("PIN: " + pin);
    System.out.println();
    for (int index=0; index < length; index++)
      System.out.println(((index)+1) + ": " + manip.get(index));
  }

  public int keepTotal()
  {
    System.out.println("sum: " + sum);
    System.out.println();
  }
}
 
0
 
LVL 35

Expert Comment

by:TimYates
ID: 8123103
ANSWER:

You need to declare "manip" as a member variable of this class, you also cannot put "int" variables into an ArrayList, as they do not subclass Object, you must wrapper them in an Integer:

I assume Keyboard.readInt() returns an "int"
------------------------------------------------------

import java.util.ArrayList;

public class ArrayManip
{
private int count, addInt, sum=0;
private int position, length;
private String name, pin;
private ArrayList manip ;

public ArrayManip()
{
  System.out.println("What is your name?: ");
  name = Keyboard.readString();
  System.out.println("What is the pin for this set?: ");
  pin = Keyboard.readString();
}
//*********************************************************************

public int inputInts()
{
  manip = new ArrayList();

  System.out.println("How many numbers in this set?: ");
  length = Keyboard.readInt();
  for( int i = 0 ; i < length ; i++ )
  {
    System.out.println("Enter an Integer: ");
    addInt = Keyboard.readInt();
    manip.add( new Integer( addInt ) ) ;
    sum += addInt;
    count++;
  }
  System.out.println();
  System.out.println("Size of set: " + length);
}

//*********************************************************************

 public int deleteInt()
 {
   System.out.println("Remove which number?: ");
   int number = Keyboard.readInt();
   int deleteNumber = manip.indexOf( new Integer( number ) );
   if( deleteNumber > -1 )
   {
     System.out.println();
     manip.remove( deleteNumber ) ;
     sum -= number ;
     length-- ;
     System.out.println( "Size of set: " + length);
   }
 }

 public int displayInts()
 {
   System.out.println("Name: " + name);
   System.out.println();
   System.out.println("PIN: " + pin);
   System.out.println();
   for (int index=0; index < length; index++)
     System.out.println(((index)+1) + ": " + manip.get(index));
 }

 public int keepTotal()
 {
   System.out.println("sum: " + sum);
   System.out.println();
 }
}
0
 
LVL 35

Expert Comment

by:TimYates
ID: 8127076
Hello?

I'm not emailing you...

I'm a good boy, who plays within the rules ;-)
0
 

Expert Comment

by:CleanupPing
ID: 9058768
earthnotes:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 35

Expert Comment

by:girionis
ID: 9700691
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Points to TimYates

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses
Course of the Month10 days, 11 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question