• 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

Making a text selection?

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey guys. I bought a book the other day on Java because I wanted to try it out and I have been losing sleep over it now. While I always thought it would be boring, I find its like I am practically playing sudoku :P

I am writing a simple program to give me a roofing quote based on the information that I plug in. With the scanner utility I just assign values to variables such as "roof square footage" and "amount of bundles". Anyways I am done most of it except for the part where I must select the shingle type.

Currently I am fooling around with the next.Boolean to assign a true/false when the console prompts "Timberline?" (My first shingle choice). IF Timberline=False then it goes to the next line
"3 Tab?".. and finally if that is false then the next line with a println displaying "Designer Shingle Price Assumed".

However it is not working how I would have hoped, so is there a way that I can make a text selection?

i.e

-Console prompts: "Select Shingle Type (Timberline, 3 Tab, Designer):"

-Type in shingle type, press enter, and it assigns a value to the variable "shingleprice" based on selection.




If I took a screenshot of my code and posted it, would it help?
 
christopher assuncao
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There ya go. Make what ya can out of it -_-
Thanks







 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

christopher assuncao wrote:There ya go. Make what ya can out of it...


Erm...no thanks.

1. It's way too small for my old eyes.
2. It doesn't appear to include all your code.

Have a look at the UseCodeTags page (←click), and post your code inside them. And please read the page carefully, because very long lines cause problems.
Use the 'Preview' button to check what you've done before you post.

However it is not working how I would have hoped...


Another page for you: ItDoesntWorkIsUseless (←click).

If you want us to help you properly, you have to TellTheDetails, and that includes
  • what you tried
  • what you expected to happen
  • what actually happened (including any error messages you got, verbatim)

  • PS: Welcome to JavaRanch.

    Winston
     
    Marshal
    Posts: 79177
    377
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Welcome to the Ranch

    You can’t read screenshots; Winston has already told you what to do so as to ensure we can read your code.
    Are you really using that dreadful construct ==false? You will find it discussed in this thread.
     
    christopher assuncao
    Greenhorn
    Posts: 3
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thanks both of you. I will have to do that in the morni... *yawn* ... In the after sleep and make another post.

    Amazing how much I've learned just from lurking previous posts so I might not have to anyways
    reply
      Bookmark Topic Watch Topic
    • New Topic