• Post Reply Bookmark Topic Watch Topic
  • New Topic

quadratatic equation program  RSS feed

 
Jesus Rod Valenzuela
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is there something wrong with this code?

 
Junilu Lacar
Sheriff
Posts: 11494
180
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When posting code, please UseCodeTags (← click that link) [edit: the post has now been corrected]

When you ask if "there's something wrong" with your code, in what sense? I could say that there's something wrong with it because it's very hard to read but that's probably not what you meant. Have you tried to test it with different inputs? Did it give you the expected results? If not, what data did you provide, what did you expect the results to be, and what were the actual results?
 
fred rosenberger
lowercase baba
Bartender
Posts: 12565
49
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
do YOU think there is something wrong with it?

i mean, it's not formatted well.  this looks wrong:



having an && followed by a pipe.  (edit - my mistake. I now see that's a lowercase 'L', not a pipe)

it ends with an if statement, but no body for it...

that's a quick glance at it.

What are YOU seeing?
 
Liutauras Vilda
Sheriff
Posts: 4927
334
BSD
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe you could explain a bit more about your exercise. That would help.

Also, you got all if statements. Maybe if/else if would do the job better for you?
if a == 4 is true, then probably not much point to check if a is also == 8.
 
Knute Snortum
Sheriff
Posts: 4284
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I edited your post.  It looks like you tried to use code tags.  The trick is to surround the code with the tags, like HTML.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!