Question

In: Computer Science

I encountered this error in unit 5 game zone assignment 4 what do i need to...

I encountered this error in unit 5 game zone assignment 4 what do i need to do?

TwoDice2.java:31: error: reached end of file while parsing
}

^

Solutions

Expert Solution

This error most likely occurs If there was a missing Closing Brace( } ) of a corresponding Opening Brace( { )

For example:

class Example {
   public static void main(String[] args) {
       while(....) {
          
           if(...) {
               .....
               .....
               .....
       }
   }
}


The above program will result in the error: reached end of file while parsing }

Reason:

Observe that for 'if' statement there was a opening brace({) but there is not corresponding closing brace (})

_________________________________________________________________________________________________________________

So with in your program, make sure following two points are checked:

1. Number of opening braces should be equal to number of closing braces.
2. With in while, for, if, else statements if there are more than one statement they should be enclosed in Opening and Closing Braces. ({ .... })



Related Solutions

This is the assignment I have, I need the best game theory problem example for it...
This is the assignment I have, I need the best game theory problem example for it which is difficult. Thank you:) Think of an example of a decision problem or a game theory problem. This time you will have to submit the source of the story. You can take it from a newspaper, from Internet, magazine, book... 1. Submit a photocopy or a printed version of your problem. 2. Simplify the problem and represent it using the concepts of game...
For an assignment I need to write a 5 page essay about any topic. I need...
For an assignment I need to write a 5 page essay about any topic. I need some some thinking of a topic and outlining of the topic.
Assignment Details This assignment has 4 parts. What questions do you have about the overarching Unit...
Assignment Details This assignment has 4 parts. What questions do you have about the overarching Unit 5 assignment? Although not due until the end of the class, it is important that you begin planning for this project early in the course. What are your initial thoughts about how you will approach this assignment? Explain. Using the product you chose in Unit 1 discussion board, List two features of the product and assess how they transform into benefits for you; determine...
What is Type I error? How do we correct for Type I error? What happens when...
What is Type I error? How do we correct for Type I error? What happens when we correct for Type I error? What is Type II error? How do we correct for Type II error? What happens when we correct for Type II error? How can we correct for both Type I and Type II error at the same time? Which error is considered the worst type of error to commit?
What information do you need to find residual standard error?
What information do you need to find residual standard error?
I need step by step instructions on using Excel to do this assignment and the values...
I need step by step instructions on using Excel to do this assignment and the values I need to enter to compute what is being asked of me. I don't know how to use Excel and you tube is no help right now because I can't find specifics of what I need done. I'll post part two of this assignment as a seperate question. I need to get through part one first. Thanks... 1. Exercise 11   Section 3-1 11. Weight...
What do I need to implement this code. I need an ADT //--------------------------------------------- // This would...
What do I need to implement this code. I need an ADT //--------------------------------------------- // This would be the Student.h file //--------------------------------------------- #include <iostream> #include <cassert> using namespace std; // each student have a name, an ID (100000000~999999999), and three grades class Student { private: public: Student(); Student(); setName(); setId(); setGrade (); getName(); getId(); getGrade() ; printAll() ; }; //--------------------------------------------- // This would be the Student.cpp file //--------------------------------------------- //====================== YOUR CODE STARTS HERE ====================== Student::Student() //default constructor { } Student::Student(string aName,...
Why am I getting this error using 000webhost , but I do not get this error...
Why am I getting this error using 000webhost , but I do not get this error running XAMPP? Warning: Cannot modify header information - headers already sent by (output started at /storage/ssd2/006/14881006/public_html/test/index.php:1) in /storage/ssd2/006/14881006/public_html/test/index.php on line 8 Code is below. ******************************************************************************************************************** <!DOCTYPE html> <?php    //Determine if the submit button has been clicked to set the cookie name and value    if (isset($_POST['name'])){            $cookie_name = $_POST['name'];            $cookie_value = $_POST['value'];            setcookie($cookie_name, $cookie_value,...
-4) What are the standard error of the coefficients on skipped and male respectively? -5) What...
-4) What are the standard error of the coefficients on skipped and male respectively? -5) What is the R-square of this regression? And the observation number? -6)What is the 95% confidence interval of the coefficient on male? ------------------------------------------- Number of obs = 141 F(5, 135) = 9.08 Prob > F = 0.0000 R-squared = 0.2355 Root MSE = .10796 ------------------------------------------------------------------------------ | Robust lcolGPA | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- lage | .1096206 .1829797 0.60 0.550 -.2522569...
I need full report for "uncertainties & Error Analysis" included the summarized background, theory, procedure 5...
I need full report for "uncertainties & Error Analysis" included the summarized background, theory, procedure 5 steps, and conclusion"
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT