making a menu driven java file and be able to read and write to it
<p>Hey guys will anyone be able to help me out with this question I was given. I am really new to this topic and have no clue how to start. So if anyone can help me out it will be so awesome! thanks</p>

<hr>

<p>Write a simple menu-driven Java program (named FileManip) that will allow for the creation of and reading from a text file containing floating point numbers. The menu options should be:
Create file
Read file
Exit Program</p>

<p>Menu Item 1 - Create file: when this menu item is chosen the program should create a file called numbers.txt. The program should then prompt the user to enter a series of positive floating point numbers. As the numbers are entered into the keyboard they should be written to the text file. The program should continue reading numbers from the keyboard and writing them to the file until the user wishes to finish.</p>

<p>Menu Item 2 - Read file: when this menu item is chosen the program should read the floating point numbers from the numbers.txt file, displaying each number to the screen, and displaying a total of the numbers read. Your program should only read from the file if the file exists. This is necessary because the user may choose this menu item before menu item 1.</p>

<p>Menu Item 3 - Exit Program: when this menu item is chosen the program should terminate execution.</p>

<p>Ensure that you write appropriate methods as part of your solution which utilise appropriate parameter passing.</p>

<p>Make sure that you use appropriate user prompts and labels for all output to the screen.
Use Eclipse to create your project and class file. When creating the class use the name that was given above.</p>

<p>What I have done
I have done this. but I am not sure if its right. so please help me :(</p>

<pre><code>import java.io.File;
import java.util.*;

//main class
public class prac {

    public static void main(String[] args){

    createOption();
    //option for the menu  

    while (true) {                                          
        showMenu();
        int option = chooseOption();
        if (option == 1) {
        }
        if (option == 2) {
        }
        if (option == 3) {
            System.out.println("Program has shut down! Goodbye!");
            System.exit(0);
        }
    }
}


public static void showMenu( ) {            //option list
    System.out.println("----------------");
    System.out.println("MAIN MENU");
    System.out.println("----------------");
    System.out.println("1. Write File");
    System.out.println("2. Read File");
    System.out.println("3. Exit Program");
}

//choosing my option and show if bad option is chosen
public static int chooseOption() {
    Scanner input = new Scanner(System.in);
    int option;
    while (true) {
        System.out.print("Choose option:");
        option = input.nextInt();
        if (option &gt;= 1 &amp;&amp; option &lt;= 3) {
            break;
        } else {
            System.out.println("Bad option, try again");
        }

    }
    return option;
}

//creating the file using formatter variable

public static void createfile() {

    final Formatter x;

    try{ 
        x = new Formatter("floatnumbers.txt"); //file creating
        System.out.println("You just created a file"); 
    }

    catch(Exception e){
        System.out.println("You got an error");
    }


}}
-----
</code></pre>

<p>Thats what I have done so far</p>

<hr>
