• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Brackets problem

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im having a serious problems with my brackets (At least i think thats how you spell them.) They were perfectaly fine untill i tried to initiate lives. After that the code has all but fallen apart. I have always had a problem with brackets so if anyone could help that would be awesome. Here is the code.


Im sorry if its a bother but i need some help.
 
Kacey Simeon
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Im sure someone would like to know how i fixed it. on line 380 i had to tab over that bracket, then i had to put a bracket inbetween line 379 and line 380. then i had to delete the last braket in the code. I feel stupid but whatever.
 
Marshal
Posts: 79179
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Surely the answer to no 20 is "he writes down, 'Can I have some sunglasses, please.'"?
I had to divide that question because lines that long make the code difficult to read. Also deleted some blank lines. So your 360 might now be 361.
But it is a disaster to have a method that long. You should have a Quiz object, and read the questions and potential answers from a text file or files.
Never say == true or similar. Not if (crowd == true) ... but if (crowd) ... If you want it false, use if (!boo) rather than if (boo == false). The reason is that == true or similar is poor style and you can get lots of errors if you mistakenly write = instead of ==.
For reasons given here, never use the tab character when writing code. (You can use \t in Strings however).
Your printouts for randomFor5050 should be put into an array, then you can say System.out.println(answersFor5050(randomFor5050));
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic