How do you print with StdOut.println once at a time with equal probability!

Hello everyone!
I tried finding this in the FAQ, but nothing really came close to my unique situation. I am trying to write a method before the main method to report to the user that their guess is too high, in a game where the computer picks a number from 0 to 1000.
I have four different statements to let the user know that the guess is too high, here is the code:
public static void reportTooHigh() {
StdOut.println("Wow come on.. too high!");
StdOut.println("Too high buster.");
StdOut.println("Too high, LOL.");
StdOut.println("WOOWWAAAWEEWAAHH.. too high!");     When I use this method in my main method by typing ProgramName.reportTooHigh(), it prints out all of the statements. Any suggestions on how to get them to print out one at a time with equal probability?
Thanks!
Edited by: OvechkinRulez on Apr 27, 2008 4:06 PM
Edited by: OvechkinRulez on Apr 27, 2008 4:06 PM
Edited by: OvechkinRulez on Apr 27, 2008 4:07 PM

OvechkinRulez wrote:
Flounder, I tried using an if statement but for some reason it didn't work for me. It still printed out all of the statements. Can you give me a head start, I am sure I can figure out the rest. Do you pick a value from 0 to 1, and then if its below .25 you print out one thing, below .5 but above .25 you print out the other, etc.?If you use the Random class you can get a number from 0 inclusive to 4 exclusive (ie 0,1,2 or 3). If 0 print the first message, if 1 print the second message, etc. Or as pointed out already use the switch statement.

Similar Messages

  • With hp officejet 6500a, how do you print a color webpage in black and white?

    With HP Officejet 6500A, how do you print a color webpage in black and white?

    Autogyro wrote:
    Charles Dyer wrote:
    Apple didn't make the drivers. Apple doesn't make printer drivers and has not done so since they stopped making their own printers. HP made the printer drivers for that device. Apple merely publishes HP's drivers.
    OK, but still, they built the poorly made HP drivers in their OS.
    Ah, no. They published the only drivers HP gave them. If they didn't publish them, then Mac users would be unable to use HP devices at all, except for those devices supported by 3rd parties such as Gutenprint and the HPIJS Project. HP is solely responsible for the state of their drivers. And it's not just Mac drivers which are bad; a lot of Windows drivers stink, too. HP simply has a problem writing drivers. For the most part they have excellent hardware, but truly terrible software.

  • How do you print a playlist with the new itunes?

    How do you print a playlist with the new itunes????

    You can click on the little triangle that's next to the little box at the top left of the new iTunes. It will give you a drop down box which gives you several selections. One of the selections is "Show Menu Bar". Click on that and you get the bar back that was on the previous version. Then in "file" you can print a CD jewel case list just like before!

  • How do you print a photo picture 4x6 with out tab on pcs1315

    How do you print a photo picture 4x6 with out tab on desk jet 1315

    If you have PSE 7 or newer, you'll probably want to use the Smart Brush. There is a good YouTube video on the subject here:
    http://www.youtube.com/watch?v=YSwRWYDhKFI&feature=related
    It if you have an older version of Elements, you can use a Hue/Saturation adjustment layer to do this task. Reduce Saturation to 0% in the Hue/Saturation dialog, then paint using black paint on the mask to bring back desired color area(s).

  • How do you print the reminder list

    How do you print the reminder list?

    With Reminders open and your list you'd like to print select, press command "A". After that copy them (command "C"). After that, open your Text Edit app. Once that is open, paste your copy in there (command "V"). From here you can print like you normally do.

  • How can I print with the black and white cartridge only?

    I am trying to print using the black and white cartridge only because magenta is out of ink but I'm getting the following error message in HP Photosmart C7200 series print dialog:
    The printer is out of ink.
    The following ink cartridges are empty: Magenta. Replace these ink cartridges to resume printing.
    How can I print with the black and white cartridge only?
    Mac OSX 10.7.3
    HP Photosmart C7280 (7200 series)
    This question was solved.
    View Solution.

    I am absolutely disgusted by this; clearly a scam from HP to make more money by selling extra ink cartridges!!  I will make sure to never buy any products from the shoddy rip off merchants at HP ever again!!
    You should be ashamed!!

  • How do you print comments in pages under mavericks?

    How do you print comments in pages under mavericks? Earlier if show comments was checked, all the comments were visible and could be easily printed. Now only those comments are visible on which the cursor is pointed but even those do not get printed! 

    Thanks to all for to the 'older Pages' suggestion. I don't have the last Pages on my mac anymore (although this is probably just me being really, really dumb), but the suggestion inspired me to try another very similar work around - which was also successful. Just in case anyone's in the same situation as me, am sharing it here!
    For absurd reasons I won't bother to explain, I've also got a version of Word for Mac. I prefer writing on Pages, though, so all my documents (and their comments...) are Pages files. In the really unlikely event that you've also ended up with both Pages and Word (I know...) just export to a .docx file, open it with Word, and print from there. It retains all comments, track chages, etc. This seems really obvious, but I hadn't thought of it...
    This can also be a work around for the lack of 'Compare Documents' and/or 'Merge Documents'.
    Of course this would all be much better if it were actually just in Pages...I hope this helps, and thanks!

  • How Do i print with a dell

    i have a Dell Photo AIO Printer 922 and their are no drivers for it. How do i print with it?????

    i have a Dell Photo AIO Printer 922 and their are no drivers for it. How do i print with it?????
    I think that's a printer from 2004 for PC's only. You might be able to use it by running Win XP on your Mac.

  • "How to Web Printing with Microsoft Excel" needed!

    Hi all,
    I desperately need the SAP Howto document "How to Web Printing with Microsoft Excel" for BW 3.5. The document is listed in the Howto section of SDN, but the link is wrong or outdated - I cannot download this document. Could anyone of you provide me with this howto? Please upload it somewhere (could be interesting for other people as well) or send it to me by email ([email protected]). Points will be assigned
    Thanks a lot in advance,
    James

    Hi,
    Here is the How to Web Printing with Excel, download from the Link
    This will expire in 7 days from the posting Date.<a href="http://download.yousendit.com/143673776AFD7E8F">How to Web Printing with Excel</a>
    Cheers.
    Ranga

  • How do you print to a HP Officejet 8500 from an iPad?

    How do you print to a HP Officejet 8500 Pro from an iPad?

    Is it an 8500 or 8500a?  Only the 8500a supports direct printing from an iPad (with no 3rd party printing software).
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • HT3724 how do you print the number margins

    how do you print the numbers in the margin on a NUMBERS spreadsheet

    Make a single column table with numbers for the row headers, or a single row table with letter for the column headers:

  • Trying to print 4x6 photos.  How can I print with no borders on LR5 with my HP OfficeJet 7410?  Even when in Print mode in LR5, my photos show a border.  Page Setup shows "borderless".  Image Settings show "zoom to fill". But cannot print, nor even previe

    Trying to print 4x6 photos.  How can I print with no borders on LR5 with my HP OfficeJet 7410?  Even when in Print mode in LR5, my photos show a border.  Page Setup shows "borderless".  Image Settings show "zoom to fill". But cannot print, nor even preview, without borders.

    JimHess~  Many thanks.  In my short history with LR, it's amazing how many people I've seen ask this question.  I'm nearly embarrassed at how simple the fix was, but grateful that you didn't dismiss such a basic question.  You made my week.  And my friend's photo album...

  • How do you Print from an iPad to an epson workforce 633?

    How do you print from an iPad to an epson workforce 633?

    If your printer is Aiprint capable you only have to go to the share tab, click it and you should see the name of your printer. Most AirPrint printers are very easy to set up. My HP recognized my wireless network when I turned it on and I simply followed the printers prompts to finish the setup. Apple has a list of AirPrint capable printers. Is yours on the list? See list from website
     http://support.apple.com/kb/HT435
    As a alternate you can buy devices like xPrintServer by Lantronix which are supposed to allow you to use your existing printer. The device is hard wired to your printer but communicates wirelessly with your idevice.
    Other options have companies like HP have services that basically allow you to send your material you want to print to HP and they in turn route it to your printer.
    Hope one of these will work for you.

  • How do you print landscape in iwork?

    How do you print landscape in iwork?

    Hi BellaRae,
    Page orientation can be set for each Sheet in a numbers Document. The control is at the bottom left of the document window, beside the number showing the scale of the current view.
    Two windows are open in the image below. The front one shows the 'regular view' with a page icon.
    In the 'back' window, the icon has been clicked, putting the document into Print view, and showing the orientation buttons and the scale slider. Note that the Landscape orientation button is highlighted. (Landscape is the default orientation for a Numbers document). Clicking the (black) Portrait icon switched the page orientation to Portrait (and highlights the Portrait icon).
    Orientation and scale setting apply only in Print View (and when printing). In regular view, the sheet is essentially an infinite page, and 'page breaks' do not apply.
    In Pages, Page orientation is a document property, set in File > Page Setup, or in the Document Inspector.
    Regards,
    Barry

  • How do you print a 4x6 photo

    HOW DO YOU PRINT A 4X6 PHOTO

    Such a vague question, the answer could be with a printer silly, or with a printing service, or well you get he jist.
    In photoshop, you can set the document size using the menu option Image>Image>Size the set the physcal unit to inches and set your width and height to 4 x 6 and set the ppi to 300.
    Another option is to open an image the either reduce the entire size by using the Image>Image size or use the crop tool which will remove portions of the image you don't want.
    Before doing any reductions, plan out what you will be printing on. Does your printer support 4x6 paper? If not you will need to print to a full page 8 1/2 x 11 for example.
    For this example you will create a new document set the image size to the full sheet of paper. Then you can drag the opened 4x6 image to 8.5 x 11 document or use file>place and place your 4x6 images that are already saved on your drive.
    In the 8.5x11 document you can rearrange the 4x6 images how you see fit. When you print the page, you can then cut the prints with sissors or a paper cutter.
    And I am going to quit there as I am sure, I already went overboard with instructions.

Maybe you are looking for