0

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

This is what I have done so far:

import easyIO.*;

class Menu {

    public static void main(String[] args) {

        int counter = 0;
        while (counter != 4) {
            counter = meny();

            switch (counter) {
            case 1:
                ReigsterBird(1);
                break;
            case 2:
                WriteBirdType(2);
                break;
            case 3:
                WritePlace(3);
                break;
            case 4:
                break;

            default:
                System.out.println("Give a number between 1 and 4");

            }
        }
    }

But I keep getting these errors, and also i'm not sure how I can solve this. Is there something i'm missing?

Menu.java:9: error: cannot find symbol
counter = meny();
               ^
symbol:   method meny()
location: class Menu
loop.java:13: error: cannot find symbol
ReigsterBird(1);
^
symbol:   method ReigsterBird(int)
location: class Menu
Menu.java:16: error: cannot find symbol
WriteBirdType(2);
^
symbol:   method WriteBirdType(int)
location: class Menu
loop.java:19: error: cannot find symbol
WritePlace(3);
^
symbol:   method WritePlace(int)
location: class Menu
4 errors

I would appreciate if someone could help out on this so I could create a menu where you have four options you can choose from.

3
  • 3
    Well the error messages are quite clear. You are calling methods that don't exist. You need to write them. Commented Sep 15, 2013 at 20:53
  • @Brandon hmm. is there any hint or example you could give on how I can create a method from those statements? would appreciate it Commented Sep 16, 2013 at 1:10
  • See Zong's answer below. He shows you how to define the methods. Commented Sep 16, 2013 at 1:39

1 Answer 1

2

You need to add the methods. I know it's confusing as a beginner, so here's what it should look like:

import easyIO.*;

class Menu {

    public static void main(String[] args) {
        ...
    }

    public static int meny() {
        ...
    }

    public static void ReigsterBird(int x) {
        ...
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.