Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

do..while loop

 
prerna boja
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,


I have the following program. I have to get the number of question marks,semicolons.... in the ouput. I am getting the output wrong. Please help me....




Shell1.dat : There are lots of symbols in this file: ..;;??
.,.,.,?::: .


I have to get only 3 question marks but I am getting the ouput as 63.
 
Jeff Jetton
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'll give you a hint:

The ASCII code for a question mark is 63. What line in your code might be printing the numerical representation of a letter by mistake?

- Jeff
 
Jeff Bosch
Ranch Hand
Posts: 805
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps simplifying even further: What line prints?
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Perhaps you can start by showing us the output you get. It will also help if you describe how it differs from what you expect. Then you can use the suggestions above to track down the cause of this difference.

Layne
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic