Texts: Why isn't my code outputting? Getting the following errors:
LabProgram.java:18: error: 'else' without 'if'
else if (strokes == par){
^
LabProgram.java:16: error: 'else' without 'if'
else if (strokes <= par - 1){
^
LabProgram.java:26: error: reached end of file while parsing
}
^
3 errors
LabProgram.java
Load default template...
6
int par;
int strokes;
strokes = scnr.nextInt();
par = strokes;
|
8 5 10 11 13 14 15 16 17 18 19 20 21 22
}s=iued3=iJed3E=iJedT System.out.printin"Error");
else if(strokes <= par - 2
System.out.printin("Eagle");
e1seif(strokes<=par-1{
System.out.printin"Birdie");
else ifstrokes==par{
System.out.printin"Par");
else{
System.out.printin("Bogey");
Develop mode
Submit mode
Run your program as often as you'd like, before submitting for grading. Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box
Enter program input (optional)
43
Run program
Input (from above)
LabProgram.java (Your program)
Output (shown below)
Program errors displayed here
hP