Answer To: Java Programming Assignment IIT/IIT G Java 2018 S1 r1 - Adapted from Trish Crowther Java Programming...
Snehil answered on Apr 16 2020
Population Calculator/.classpath
Population Calculator/.project
Population Calculator
org.eclipse.jdt.core.javabuilder
org.eclipse.jdt.core.javanature
Population Calculator/.settings/org.eclipse.jdt.core.prefs
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8
Population Calculator/bin/com/pop/calc/PopData.class
package com.pop.calc;
public synchronized class PopData {
private String sSpeciesName;
private String sHabitat;
private int iStartingPopulation;
private int[] iaGrowthRates;
public void PopData(String, String, int, int[]);
public String getSpeciesName();
public void setSpeciesName(String);
public String getHabitat();
public void setHabitat(String);
public int getStartingPopulation();
public void setStartingPopulation(int);
public int[] getGrowthRates();
public void setGrowthRates(int[]);
}
Population Calculator/bin/com/pop/calc/Stage1.class
package com.pop.calc;
public synchronized class Stage1 {
static final int MAX_CAPACITY = 5000;
static final int NUM_GEN = 10;
public void Stage1();
public static void main(String[]);
static void calculateFixedRateGrowth(int, int, int);
static void calculateVariableRateGrowth(int, int[]);
}
Population Calculator/bin/com/pop/calc/Stage2GUI$1.class
package com.pop.calc;
synchronized class Stage2GUI$1 implements Runnable {
void Stage2GUI$1();
public void run();
}
Population Calculator/bin/com/pop/calc/Stage2GUI$2.class
package com.pop.calc;
synchronized class Stage2GUI$2 implements java.awt.event.ActionListener {
void Stage2GUI$2(Stage2GUI);
public void actionPerformed(java.awt.event.ActionEvent);
}
Population Calculator/bin/com/pop/calc/Stage2GUI$3.class
package com.pop.calc;
synchronized class Stage2GUI$3 implements java.awt.event.ActionListener {
void Stage2GUI$3(Stage2GUI);
public void actionPerformed(java.awt.event.ActionEvent);
}
Population Calculator/bin/com/pop/calc/Stage2GUI$4.class
package com.pop.calc;
synchronized class Stage2GUI$4 implements java.awt.event.ActionListener {
void Stage2GUI$4(Stage2GUI);
public void actionPerformed(java.awt.event.ActionEvent);
}
Population Calculator/bin/com/pop/calc/Stage2GUI$5.class
package com.pop.calc;
synchronized class Stage2GUI$5 implements java.awt.event.ActionListener {
void Stage2GUI$5(Stage2GUI);
public void actionPerformed(java.awt.event.ActionEvent);
}
Population Calculator/bin/com/pop/calc/Stage2GUI$6.class
package com.pop.calc;
synchronized class Stage2GUI$6 implements java.awt.event.ActionListener {
void Stage2GUI$6(Stage2GUI);
public void actionPerformed(java.awt.event.ActionEvent);
}
Population Calculator/bin/com/pop/calc/Stage2GUI.class
package com.pop.calc;
public synchronized class Stage2GUI {
private final int MAX_POP;
private final int NUM_GEN;
private javax.swing.JFrame jFrame_MainFrame;
private javax.swing.JTextField jTextField_StartingPopulation;
private javax.swing.JTextField jTextField_NumGenerations;
private javax.swing.JTextField jTextField_FixedRate;
private javax.swing.JTextField[] jTextFieldArray_VariableGrowthRates;
private final javax.swing.ButtonGroup buttonGroup_RateChoice;
private javax.swing.JRadioButton jRadioButton_FixedGrowth;
private javax.swing.JLabel jLabel_FinalPopulationResult;
private javax.swing.JLabel jLabel_NumFishDied;
public static void main(String[]);
public void Stage2GUI();
private void initialize();
private void SelectFixedToggle(boolean);
}
Population Calculator/bin/com/pop/calc/Stage3GUI$1.class
package com.pop.calc;
synchronized class Stage3GUI$1 implements Runnable {
void Stage3GUI$1();
public void run();
}
Population Calculator/bin/com/pop/calc/Stage3GUI$2.class
package com.pop.calc;
synchronized class Stage3GUI$2 implements java.awt.event.ActionListener {
void Stage3GUI$2(Stage3GUI);
public void actionPerformed(java.awt.event.ActionEvent);
}
Population Calculator/bin/com/pop/calc/Stage3GUI$3.class
package com.pop.calc;
synchronized class Stage3GUI$3 implements javax.swing.event.ListSelectionListener {
void Stage3GUI$3(Stage3GUI, javax.swing.JList, javax.swing.JLabel, javax.swing.JLabel, Stage3GUI$DrawingPanel);
public void valueChanged(javax.swing.event.ListSelectionEvent);
}
Population Calculator/bin/com/pop/calc/Stage3GUI$DrawingPanel.class
package com.pop.calc;
synchronized class Stage3GUI$DrawingPanel extends javax.swing.JPanel {
private final int BAR_WIDTH;
private final int BAR_WIDTH_MARGIN;
private int[] iaGrowthRateHeights;
private int[] iaBarPostions;
private int iOldMin;
private int iOldMax;
private int iNewMin;
private int iNewMax;
private int iAvg;
public void Stage3GUI$DrawingPanel(Stage3GUI, int);
public void setBarGraphData(int[]);
public void paintComponent(java.awt.Graphics);
private int getValueInRange(int);
}
Population Calculator/bin/com/pop/calc/Stage3GUI.class
package com.pop.calc;
public synchronized class Stage3GUI {
private final int MAX_POP;
private final int NUM_GEN;
private javax.swing.JFrame jFrame_MainFrame;
private javax.swing.JTextField[] jTextFieldArray_VariableGrowthRates;
private javax.swing.JLabel jLabel_FinalPopulationValue;
private javax.swing.JLabel jLabel_NumFishDied;
private java.util.Vector vPopData;
public static void main(String[]);
public void Stage3GUI();
private void readFile(String);
private void initialize();
}
Population Calculator/growth.txt
Fish;Pond;10;100,100,80,70,160,75,80,100,50,67
Rats;Shed;6;115,120,125,80,50,70,110,80,50,2
Mice;Barn;8;80,80,50,30,20,10,-5,20,40,10
Bacteria;Petri Dish;300;200,150,100,30,5,50,4,70,50,10
Snakes;Island;12;20,21,22,17,50,60,70,80,20,40
Rabbits;Farm;24;166,150,150,130,140,120,130,150,160,160
Stoats;Forest;10;90,80,90,75,60,15,18,18,17,15
Bats;Belfry;20;50,18,17,20,25,30,15,-10,10,8
Cats;Abandoned House;6;200,150,100,100,80,70,60,10,5,5
Money;Account;1000;2,3,3,2,3,3,5,10,6,5
Population Calculator/src/com/pop/calc/PopData.java
Population Calculator/src/com/pop/calc/PopData.java
package com.pop.calc;
public class PopData
{
private String sSpeciesName;
private String sHabitat;
private int iStartingPopulation;
private int[] iaGrowthRates;
public PopData(String sSpeciesName, String sHabitat,int iStartingPopulation, int[] iaGrowthRates)
{
this.sSpeciesName = sSpeciesName;
this.sHabitat = sHabitat;
this.iStartingPopulation = iStartingPopulation;
this.iaGrowthRates = iaGrowthRates;
}
public String getSpeciesName() {
return sSpeciesName;
}
public void setSpeciesName(String sSpeciesName) {
this.sSpeciesName = sSpeciesName;
}
public String getHabitat() {
return sHabitat;
}
public void setHabitat(String sHabitat) {
this.sHabitat = sHabitat;
}
public int getStartingPopulation() {
return iStartingPopulation;
}
public void setStartingPopulation(int iStartingPopulation) {
this.iStartingPopulation = iStartingPopulation;
}
public int[] getGrowthRates() {
return iaGrowthRates;
}
public void setGrowthRates(int[] iaGrowthRates) {
this.iaGrowthRates = iaGrowthRates;
}
}
Population Calculator/src/com/pop/calc/Stage1.java
Population...