• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unexpected output

 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi im a newbie here.... ,
im having a little problems with the output in my program
output:

the whole code is

 
Andrew Robinson
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what is the output supposed to look like? Can you show how the program is supposed to flow like sample input and outputs?
 
R Johnson
Greenhorn
Posts: 28
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It has teh output that you desire when I compile it. Here was my output

Enter The Coins: 1

Bet (Max: 1 - 4 Coins): 2

1 BELL BELL GRAPE

Bet (Max: 1 - 4 Coins): 1

2 BELL CHERRY ------

Bet (Max: 1 - 4 Coins): 4

3 CHERRY BELL GRAPE

Bet (Max: 1 - 4 Coins): 4

4 BELL CHERRY GRAPE

Bet (Max: 1 - 4 Coins):
5 CHERRY ------ ------

4
Bet (Max: 1 - 4 Coins): |

as you can see it may just be a java return character because you show you have two Bets printed before the cursor

Bet (Max: 1 - 4 Coins): Bet (Max: 1 - 4 Coins): //should be here


I am confused though on the importance of the location of the cursor........ once you get too swing applications I feel console cursor placement may be of little or no importance.
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
no sir... in my IDE its printing at the line after the desired location, and the output is two? i mean duplicated... T_T
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
its exactly as this sir
duplicated output and the readLine is ON THE NEXT Line
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've been encountering this kind of output ever since, but no one can explain why, because no one is expriencing that same output like i do, (probably)
they responded the same as your did sir.. they also get the desired output... no problems , no readLine problems. no duplicates..
but when i compile-run it in my IDE, everything is still the same as before,

im using NetBeans IDE 6.7 / jdk1.6_07 update 13
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 11887
203
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What happens if you run it from the command line?

I suspect that this is just a bug with how NetBeans is trying to emulate a terminal - it is not placing the cursor in the right place. When I run it within Eclipse on a Mac, the cursor initially appears at the start of the line (that is, before the "E" in "Enter The Coins"), but as soon as soon as I start typing the number of coins it jumps to the correct place following the colon. However when I run the same application from the command line the cursor is always in the right place.
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir i beg your pardon,, but what is command line?
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jhon max wrote:sir i beg your pardon,, but what is command line?

Command Prompt
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you sir
 
jhon max
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sir andrew.. it works fine in a command line.. but why is does it display wrong in my IDE?
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic