A Company has contracted you to develop a Java program to determine who is eligible to attend. They have decided to only admit board members who have paid their charity contributions in full and attended at least two subcommittee meetings. Display the contents of the database first. The chairperson of the board, Becky Caldwell, wants an alphabetical list of board members ineligible to enter the board meeting and reason(s) why they cannot attend. The chairperson would also like a printed alphabetized list of board members who were eligible to attend, the total amount that Caldwell Diversified Holdings contributed to charitable organizations, and the amount of pledges owed.
and here is wat i have done so far..
import java.text.DecimalFormat; import java.util.Scanner; public class CHDmeeting { // Declaration of array's private String[] Name1; // Name private int[] Meetings1; //Number of Meetings Atteded private int[] Pledge1; //Pleadge Amount private int[] PBalance1; //Balancce of the Pleadge private int[] Eligible = new int[11]; private int counter = 0; private int[] assign = new int [11]; Scanner keyboard = new Scanner(System.in); /** * Constructor for objects of class CHDmeeting */ public CHDmeeting(String[] n, int[] m, int[] p, int[] b, int[] e) { // array's Name1 = new String[n.length]; Meetings1 = new int[m.length]; Pledge1 = new int[p.length]; PBalance1 = new int[b.length]; Eligible = new int[e.length]; for (int index2 =0; index2 <11; index2++) { Name1[index2] = n[index2]; Meetings1[index2] = m[index2]; Pledge1[index2] = p[index2]; PBalance1[index2] = b[index2]; Eligible[index2] = e[index2]; } } public void CHDmeeting() { for(int index3 = 0; index3 < Name1.length; index3++) { if (PBalance1[index3] == Pledge1[index3] && Meetings1[index3] >= 2) Eligible[index3] = 1; else Eligible[index3] = 2; } } public void display() { for(int index4 =0; index4 < Name1.length; index4++) { if (Eligible[index4] == 1) { System.out.print("Your pledge has been paid in and you have been to 2 or more meetings. You can attend"); System.out.print(Name1[index4]+ " " + Meetings1[index4]+ " " + Pledge1[index4]+ " " + PBalance1[index4]); } if (Eligible[index4] == 2) { System.out.print("You may not attend the meeting due to your pledge not being paid or attend less than 2 meetings"); System.out.print(Name1[index4]+ " " + Meetings1[index4]+ " " + Pledge1[index4]+ " " + PBalance1[index4]); } } // jtaOutput.setText("" + alphaList(dataList)); // public void List() alphaList(ArrayList<Eligible> dataList) // { // Object[] Eligible = new Object[]{Eligible.toArray()}; // List<Object> list = Arrays.asList(dataArray); // Collections.sort(list); // return list; // } //end alphaList } //========================================= // public static void main (String[]args) throws Exception // { // Scanner scan = new Scanner (System.in); // System.out.println("Eligible Board Members:"); // String file1 = scan.nextLine(); // Meetings1 filer = new Meetings1(file1); // System.out.println(filer.displayHead()); // } //========================================= // public static void main(String[] args) { //... 1. Sort strings - or any other Comparable objects. //String[] names = {"Zoe", "Alison", "David"}; //Arrays.sort(names); //System.out.println(Arrays.toString(names)); public void total() { for(int index5 =0; index5 <Pledge1.length; index5 ++) { if(assign[index5] !=0) counter++; } System.out.println("Total Pledge Owed:"+ counter); } } ----------------------------------------------------------------------------- Demo ----------------------------------------------------------------------------- import java.io.*; import java.util.StringTokenizer; public class CHDmeetingDemo { public static void main(String[] args) throws IOException { int stock_holders = 11; String[] Meeting = new String[stock_holders]; String[] Name = new String[stock_holders]; int[] Meetings = new int[stock_holders]; int[] Pledge = new int[stock_holders]; int[] PBalance = new int[stock_holders]; String input; FileReader freader = new FileReader("Readme.txt"); BufferedReader inputFile = new BufferedReader(freader); for (int index =0; index < stock_holders; index++) { Meeting[index] = inputFile.readLine(); } inputFile.close(); for (int index = 0; index < Meeting.length; index++) { StringTokenizer strTokenizer = new StringTokenizer(Meeting[index], " "); { Name[index] = strTokenizer.nextToken(); Meetings[index] = Integer.parseInt(strTokenizer.nextToken()); Pledge[index] = Integer.parseInt(strTokenizer.nextToken()); PBalance[index] = Integer.parseInt(strTokenizer.nextToken()); input = strTokenizer.nextToken(); } } // CHDmeeting = new CHDmeeting(Name, Meetings, Pledge, PBalance, Eligible); System.out.println("StockHolders"); for(int index =0; index < Name.length; index++) { System.out.println(Name[index]+ " " + Meetings[index] + " " + Pledge[index] + " " + PBalance[index]); System.out.println(); } } }