Create a document with a form that registers all non-profit organizations in the area, the number of members they have, and the type of organization. After the user enters data in all the fields and presses the button, your program will create a single text le that saves information for each organization on a separate line. The name of the data file is np.txt. This data file should be created in the same directory as your running program, without hard-coding the file path to ensure portability. In the data file please include the Organization name, Membership, and Type, separated by commas. Membership should only accept numbers, Type should only accept the following strings: Educational, Animal Rescue, Religious, Food Service, and misspellings should not be allowed. The first line of the output will be the headers. You can make up all the names and numbers while you are testing your programs. Sample Output written to a file will look as following: Organization, Membership, Type Meals on Trucks, 123, Food Service The Church of Purple Cross, 34, Religious Kitties and Puppies, 1234, Animal Rescue Solution import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.util.Scanner; public class WriteToFile { private static final String FILENAME = \"np.txt.\"; private static Scanner s; static int mem; static String org, type; static int getMem() { System.out.println(\"Enter Membership Number: \"); return s.nextInt(); } public static void main(String[] args) { try (BufferedWriter bw = new BufferedWriter(new FileWriter(FILENAME))) { boolean isMore = true; s = new Scanner(System.in); String content = \"Organization, Membership, Type\"; bw.write(content); while (isMore) { System.out.println(\"Enter Organization Name: \"); org = s.nextLine(); try { System.out.println(\"Enter Membership Number: \"); mem = s.nextInt(); } catch (Exception e) { System.out.println(\"Membership Should only be of Number Type\"); mem = getMem(); } boolean end = false; do { System.out.println(\"Enter Type Of Organization: \"); type = s.next(); switch (type) { case \"Educational\": break; case \"Animal Rescue\": break; case \"Religious\": break; case \"Food Service\": break; default: { System.out.println( \"Type Name Should be Only Educational, Animal Rescue ,Religious ,Food Service\"); end = true; } } } while (end); String f=org+\",\"+mem+\",\"+type; bw.newLine(); bw.append(f); System.out.println(\"Enter More Enteries?(y/n) :\"); if(s.next().equals(\"n\")) isMore=false; } } catch (IOException e) { e.printStackTrace(); } } }.