Can you help me to fix the red line in the spider project? And write a test prog
ID: 3756930 • Letter: C
Question
Can you help me to fix the red line in the spider project?
And write a test program to go through these class.
eclipse-workspace CSE116 Project 1/src/spider/littleSpiderAddcard.java tclipse Eile Edit Soue Relactor Navigate Seach rojet un Wirdow Help Quick Access|: |4, o d .littleSpiderAddca R Project Explorer CSE115 a se litt eso de Remove littlespidersetupyava .littleSpidervalue ava n«Deckja a f CardJava Pileja a Plejaa CardTest-Java 1 package spider; G CSE115 2018 3 import java.util.frrayList; csc1 16 CSF116 Projert1 publicClass littleSpiderAddCard { spider 8public void tableauPilesAddCard(Card card, Arrayl ist cCard> pile) Cald.java for (ArrayList littlespiderValuejava pile.java JRE System Library [test] Java test ArrayList nenList- neN ArrayLists> newl ist.add(card) for Card listCard: tableauPile) { neuList.add(listcard); lab5 project! Project2 tableauPileist; JRE System Library Itest tode Card.java Deckjava tests CardTest.java > DeckTestjava Dummy.txt > ''inutes Updates are available for your software. Clitk to review and install updates Sct up Writable Smart Insert 11:58 2018/9/29Explanation / Answer
These errors need lot more information to completely answer or make it running correctly. You can revert back to me by commenting if you need more help. Here is what I can help you based on the information provided in the screenshots.
Screenshot #1
You are using tablaeuPiles object as an ArrayList object without creating or declaring it in the program. Also the class doesn't seem to be extending any other class as well. So there's no chance it is declared in any other class as well. So you need to first declare or create the arraylist named tablauePiles before using it.
As a result of this, you are not able to get individual element named tablaeuPile within the loop. Also, you are trying to call a method named get(index) on Card object which is not present in it's class.
Screenshot #2
Same, you are trying to use an object (arraylist) which you haven't defined or created in the first place.
Screenshot #3
There are 2 mistakes here. Deck is a class and you are trying to invoke a method using class name which means that the method should be static. 2nd mistake is that there's no method named get() defined in Deck class.
Screenshot #4
2 mistakes here again. First of all, you haven't imported the class CardRankings ( and I think this class is not even present), secondly, you are trying to invoke a method on unknown/undeclared object. Solution is to first import the class and then create an object of it or if it is a static class, just importing the class will work. Whatever is the case, make sure the method exists in the class CardRankings.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.