• Post Reply Bookmark Topic Watch Topic
  • New Topic

Outputting an error message  RSS feed

 
Akira belliveau
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've literally been working for hours on this surfing across the web and forums but I can't find an answer! My professor wants us to set it up so when someone enters a negative number for any of the inputs it still lets you enter the rest of them but at the end, the program outputs a message that says "ALL NUMERICAL NUMBERS MUST BE POSITIVE!". I understand the if-then-else statements but I just don't know how to make the program JUST send out the message and not do the calculations if the number is negative. Also, how would I make it so "The monthly payment is: " not even show up, this is what I was trying to do in the beginning, and just put out the error message just once at the very end where it show the monthly payment, that's what my professors looking for.Someone please help!


My goal is to try to get it to look like this

but it looks like this....
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That cannot be the output from the code you have posted - for example, the second error message does not end with the exclamation mark character.

Are you sure you have rebuilt your code before executing it?
 
Akira belliveau
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
SMH..thats so stupiddd. I spent hours working on this code and all I needed to do was copy and paste it into a new project....F
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Akira, is your problem solved now?
 
Campbell Ritchie
Marshal
Posts: 56553
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
…and welcome to the Ranch
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!