• 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

Boolean Method

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is a sample exam question that I struggling with:
Write a boolean method named digit that returns true if the value of its char type parameter is a digit (one of "0", "1", ., "9") and returns false otherwise.
Thanks,
Roger
 
Ranch Hand
Posts: 1376
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Okay, let's see what you've got so far. For example, have you figured out the method signature yet? The method signature includes the name of the method, the type of value returned (if any) and the names and types of the parameters. Have you gotten that far? If so, show us.
Next, can you think what sort of logic you might want to use to do what you need to do? Can you write out in pseudo-code (which is just English) the steps you would take to process this function?
I hope I don't sound pedantic here. What I'm trying to do is walk you through the basic steps of analysis and design, which you need to do before you ever write a line of code.
Joe
 
reply
    Bookmark Topic Watch Topic
  • New Topic