Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: Can someone please help me with creating a menu with while-loops and switch-statements?

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Can someone please help me with creating a menu with while-loops and switch-statements?

    Hello everyone!

    I'm trying to create a menu where you have four options:

    • You can register a bird you have seen in a textfile.
    • You can write the type of a bird you have seen.
    • You can write the place where you have seen the bird.
    • Close the program


    Can someone help me with creating one? I'm a bit stuck and I keep getting errors so I would appreciate if someone could help me program a menu with these four options.

    Also for the first option, registering a bird, this is what i've done.

       import easyIO.*;
     
            class Birds {
     
    	    public static void main(String[] args) {
     
            In press = new In();
            Out birds = new Out("birdfile.txt", true);
     
            birds.out("Birds name: ");
            String biName = press.inLine();
     
            birds.out("Sex: ");
            String biSex = press.inLine();
     
            birds.out("Place for observation: ");
            String plObs = press.inLine();
     
            birds.out("Date of observation: ");
            int date = press.inInt();
     
            System.out.println("Birds name: ")
     
            birds.close();



    I havent started on the other 3 options yet. Was thinkg about getting the menu done first, but got stuck

    Thanks alot for help


  2. #2
    Grand Poobah
    Join Date
    Mar 2011
    Posts
    1,511
    My Mood
    Grumpy
    Thanks
    0
    Thanked 165 Times in 156 Posts

    Default Re: Can someone please help me with creating a menu with while-loops and switch-statements?

    How can I create an option menu with while and switch statements?

    Duplicate post
    Improving the world one idiot at a time!

Similar Threads

  1. How can I create an option menu with while and switch statements?
    By DABBISH in forum What's Wrong With My Code?
    Replies: 4
    Last Post: September 16th, 2013, 06:36 AM
  2. Im very new to java And switch statements
    By RevChe in forum Loops & Control Statements
    Replies: 9
    Last Post: March 17th, 2013, 10:14 AM
  3. IF and SWITCH Statements: How and When to Use Them
    By snowguy13 in forum Java Programming Tutorials
    Replies: 2
    Last Post: January 11th, 2012, 09:46 AM
  4. Help with switch statements
    By suxen in forum Loops & Control Statements
    Replies: 4
    Last Post: February 15th, 2011, 03:55 AM
  5. need help with JButton and switch statements
    By jjoubert in forum AWT / Java Swing
    Replies: 5
    Last Post: October 28th, 2009, 09:13 AM