Win a copy of High Performance Python for Data Analytics this week in the Python forum!

Fenaj Gordon

Greenhorn
+ Follow
since Nov 02, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
1
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Fenaj Gordon

Hello All,

I have created an application that deals with creating methods to insert vertices, edges, fetch vertices, edges, delete vertices, edges, but I am having trouble with understanding how to implement the updatevertex and updateEdge methods. Here is what I do have so far. Please do comment what you think I can improve about my application. Thanks!

>
3 years ago

Fenaj Gordon wrote:

Carey Brown wrote:[You have a class with those fields called "Listing" which I would have rather seen called "Student". Anyway, take those three parameters and construct a Listing object and then put() that into the hash table.



Could you clarify what you mean by " . . . then put() that into the hash table?"

Do you mean something like this?

Hashtable data= new Hashtable();
    Listing j;
    Listing l1 = new Listing(1234, "Jerry", 4.0);
    Listing l2 = new Listing(4533, "Marty", 2.3);
    Listing l3 = new Listing(3554, "Sean", 2.9);
   
 
  data.put(l1);
  data.get(l1);
  data.remove(l1);
  j = data.get(l1);



3 years ago


Carey Brown wrote:[You have a class with those fields called "Listing" which I would have rather seen called "Student". Anyway, take those three parameters and construct a Listing object and then put() that into the hash table.



Could you clarify what you mean by " . . . then put() that into the hash table?"

Do you mean something like this?

Listing obj1= new Listing(id, name, GPA);

obj1.get();



3 years ago


Carey Brown wrote:[You have a class with those fields called "Listing" which I would have rather seen called "Student". Anyway, take those three parameters and construct a Listing object and then put() that into the hash table.



Could you clarify what you mean by " . . . then put() that into the hash table?"

3 years ago

Fenaj Gordon wrote:

Junilu Lacar wrote:If you take the pattern that Carey passed to split() and pass it to your Scanner's useDelimiter() method, you should be able to call nextInt(), next(), and nextDouble() in whatever order you expect the user to enter the data. You might need to add a call to nextLine() after all those calls to get ready for the next line of input.



@Junilu Lacar-Never mind. I just have broken them down into three different prompts. Like this then:

System.out.println("Enter a Student's ID: ");
      id= input.next();
    System.out.println("Enter a Student's Name: ");
      name= input2.nextLine();

    System.out.printIn("Enter a Student's GPA: ");
      gpa= input3.nextDouble();

My next question is how can I insert this starting student's information into  put() method inside of my do-while loop?  I know that I can take each variable like id, name, and gpa and print back out the information to them, but how will it work for the put() method. Do I have to actually implement a put method within my Hashtable class. I don't think so because isn't the put, remove, get methods all implicit of the Hashtable  class. So this means that I don't have to actually implement what I want to do inside of those methods, right? I can just go ahead and use them right? Please respond back to me. Because I will have more questions.

3 years ago

Junilu Lacar wrote:If you take the pattern that Carey passed to split() and pass it to your Scanner's useDelimiter() method, you should be able to call nextInt(), next(), and nextDouble() in whatever order you expect the user to enter the data. You might need to add a call to nextLine() after all those calls to get ready for the next line of input.



@Junilu Lacar-Can you show me an example of what you really mean?
3 years ago
Hello All,

I am trying to create an hashtable data structures that will be allow a user to insert, fetch, update, and delete student's information. It's need a lot of work, but the first question that I have is how can I save three different datatypes of input for the third prompt in my program. For example, how would I be able to save id, name, and gpa if they were to input all these answers on single line? Is this a tedious process? I know how to save one type of input such as id. You would do something like this id= input.nextInt(); the input object would come from the Scanner class. . Here is my work so far.





3 years ago
I am working on creating a Java application in implement a perfect hash data structure and create its four basic methods. My application should allow a user to enter a stadium ticket number between 2000 and 100,000 and if that don't enter key values between those number, it will output an invalid entry. I got all of that to work, but I am having trouble implementing the insert method, which should preprocess the key if it's a negative value and then insert the key and purchaser's name into the structure. The fetch should return key and name, and the delete should delete the key and name, and the update method should be able to change it from one's person information to another. Here's what I have so far.




3 years ago