Question

I have encountered these 2 errors doing the unit 6 game zone involving PigDiceGame.java, what do...

I have encountered these 2 errors doing the unit 6 game zone involving PigDiceGame.java, what do i need to change?


jGRASP exec: javac -g PigDiceGame.java

PigDiceGame.java:16: error: cannot find symbol
Die newDie = new Die();
^
symbol: class Die
location: class PigDiceGame
PigDiceGame.java:16: error: cannot find symbol
Die newDie = new Die();
^
symbol: class Die
location: class PigDiceGame
2 errors

Homework Answers

Answer #1

Solution : -
When external classes or interfaces is used in the current program you need to import those classes (that can be user defined or built-in) in your current program using the import keyword, But when program gives Cannot find symbol error it may be due to below reasons,
1) If the path of class or interface imported are not available to Java Virtual Machine (JVM).
2) If the absolute class name mentioned in import statement is not correct (i.e, packages name, class name).
3) If not imported the class or interface used.

Your program not identifing Die as a class so it is giving error as Cannot find symbol.

To make it working try after including below lines of code to the program
package dieGames;
import javax.swing.JOptionPane;

===========================END======================================
comment if any query.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
I have encountered these problems doing the unit 6 game zone involving quiz.java, what do i...
I have encountered these problems doing the unit 6 game zone involving quiz.java, what do i need to change? ----jGRASP exec: javac -g Quiz.java Quiz.java:101: error: -> expected System.out.println(questions[i].getQuestion(()); ^ Quiz.java:101: error: ')' expected System.out.println(questions[i].getQuestion(()); ^ Quiz.java:101: error: ')' expected System.out.println(questions[i].getQuestion(()); ^ Quiz.java:103: error: -> expected System.out.println(questions[i].getChoices(()); ^ Quiz.java:103: error: ')' expected System.out.println(questions[i].getChoices(()); ^ Quiz.java:103: error: ')' expected System.out.println(questions[i].getChoices(()); ^ Quiz.java:109: error: illegal start of expression if(questions[i].getAnswer().equals(userinput))); ^ Quiz.java:129: error: ';' expected System.out.println("No. The correct answer is" +questions[i].getAnswer())); ^ Quiz.java:121:...
Homework Draw class diagrams for your HW4 - the Tetris Game shown below: Part 1: UML...
Homework Draw class diagrams for your HW4 - the Tetris Game shown below: Part 1: UML As a review, Here are some links to some explanations of UML diagrams if you need them. • https://courses.cs.washington.edu/courses/cse403/11sp/lectures/lecture08-uml1.pdf (Links to an external site.) • http://creately.com/blog/diagrams/class-diagram-relationships/ (Links to an external site.) • http://www.cs.bsu.edu/homepages/pvg/misc/uml/ (Links to an external site.) However you ended up creating the UML from HW4, your class diagram probably had some or all of these features: • Class variables: names, types, and...
I've posted this question like 3 times now and I can't seem to find someone that...
I've posted this question like 3 times now and I can't seem to find someone that is able to answer it. Please can someone help me code this? Thank you!! Programming Project #4 – Programmer Jones and the Temple of Gloom Part 1 The stack data structure plays a pivotal role in the design of computer games. Any algorithm that requires the user to retrace their steps is a perfect candidate for using a stack. In this simple game you...
I need the actual code for this... I found a similar response but it was not...
I need the actual code for this... I found a similar response but it was not thorough enough. Problem Prerequisites: None Suppose that a scientist is doing some important research work that requires her to use rabbits in her experiments. She starts out with one adult male rabbit and one adult female rabbit. At the end of each month, a pair of adult rabbits produces one pair of offspring, a male and a female. These new offspring will take one...
1. Which is statement is true? I. A single-price monopolist charges a price equal to the...
1. Which is statement is true? I. A single-price monopolist charges a price equal to the marginal cost of the last unit sold. II. A monopolist with positive marginal costs and facing a linear demand curve always sets a quantity (or price) such that it sells on the elastic section of the demand curve. III. A monopolist regulated by marginal-cost pricing regulation sells at a price that covers its variable and fixed costs of production, but it still causes a...
1) Describe an example of each of the following that may be found of your kitchen:...
1) Describe an example of each of the following that may be found of your kitchen: Explain how your choice falls into this category, and if there is a chemical name or symbol for it, provide that as well. Provide a photo of your example with your ID card in it. a) a compound b) a heterogeneous mixture c) an element (symbol) Moving to the Caves… Lechuguilla Caves specifically. Check out this picture of crystals of gypsum left behind in...
Laboratory 4: Black Jack! Java API ArrayList Lab 04 Documentation Included matrix package "external" documentation Included...
Laboratory 4: Black Jack! Java API ArrayList Lab 04 Documentation Included matrix package "external" documentation Included Download Lab04.zip for all of the additional supporting files that you will need to compile and run. Extract the files into your working directory You can find the rules of blackjack all over the Internet. To get an idea of what you are trying to accomplish in this lab, I’ll demonstrate the final solution. The dealer stands on all 17s. Doubling after splitting is...
1. What is an ISP (Integrated Service Provider) for supply chains? (1 point) A. A consultant...
1. What is an ISP (Integrated Service Provider) for supply chains? (1 point) A. A consultant agency which integrates the supply chain for companies B. A 2 PL or a 3PL, but not a 4PL C. A company supplying transportation and warehousing services D. A logistics service company specialized in suppling VAS (value added services) 2. What characterizes a 4 PL? (1 point) A. They are non-asset based and provides integrated services primarily supplied by asset based providers, for example...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary...
Please answer the following Case analysis questions 1-How is New Balance performing compared to its primary rivals? How will the acquisition of Reebok by Adidas impact the structure of the athletic shoe industry? Is this likely to be favorable or unfavorable for New Balance? 2- What issues does New Balance management need to address? 3-What recommendations would you make to New Balance Management? What does New Balance need to do to continue to be successful? Should management continue to invest...
What tools could AA leaders have used to increase their awareness of internal and external issues?...
What tools could AA leaders have used to increase their awareness of internal and external issues? ???ALASKA AIRLINES: NAVIGATING CHANGE In the autumn of 2007, Alaska Airlines executives adjourned at the end of a long and stressful day in the midst of a multi-day strategic planning session. Most headed outside to relax, unwind and enjoy a bonfire on the shore of Semiahmoo Spit, outside the meeting venue in Blaine, a seaport town in northwest Washington state. Meanwhile, several members of...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT