~johanvandegriff/Stoichiometry

060f20be56fce5af1da5dc8360986b3213680b91 — Johan Vandegriff 2 years ago c7f71f7
ask for input
3 files changed, 15 insertions(+), 6 deletions(-)

M elements/compile_data.py
M src/stoichiometry/Compound.java
M src/stoichiometry/Main.java
M elements/compile_data.py => elements/compile_data.py +3 -0
@@ 68,3 68,6 @@ for filename in files:
#print jsonFormat(elements)
print jsonFormat(elements['K'])
print jsonFormat(elements['Kr'])




M src/stoichiometry/Compound.java => src/stoichiometry/Compound.java +3 -2
@@ 51,7 51,8 @@ public class Compound {
		parts.add(part);
		parts.remove(0);

		//System.out.println("Split	" + parts);
		
//		System.out.println("Split	" + parts);

//		String stateOfMatter = "";
		int charge = 0;


@@ 127,7 128,7 @@ public class Compound {
//			System.out.println(i + " " + parts);
		}

		//System.out.println("Simple	" + parts);
//		System.out.println("Simple	" + parts);

		// List<ElementQuantity> elements = new ArrayList<>();
		Map<Element, Integer> elements = new LinkedHashMap<>();

M src/stoichiometry/Main.java => src/stoichiometry/Main.java +9 -4
@@ 7,10 7,15 @@ import numbers.Solver;

public class Main {
	public static void main(String[] args){
        Reaction.fromString("H2 + O2 => H2O").printInfo();
        Reaction.fromString("Fe(l) + 2 H2O(l) -> Fe(2+)(aq) + OH(-)(aq) + H2(g)").printInfo();
        Reaction.fromString("C3H6(OH)2 + O2 -> CO2 + H2O").printInfo();
        Reaction.fromString("H(+) + Cl(-) -> HCl").printInfo();
		System.out.print("Enter the chemical equation: ");
		Scanner input = new Scanner(System.in);
		Reaction.fromString(input.nextLine()).setMoles(0, 1).printInfo();
		input.close();
//        Reaction.fromString("H2 + O2 => H2O").printInfo();
//        Reaction.fromString("Fe(l) + H2O(l) => Fe(2+)(aq) + OH(-)(aq) + H2(g)").printInfo();
//        Reaction.fromString("C3H6(OH)2 + O2 -> CO2 + H2O").printInfo();
//        Reaction.fromString("H(+) + Cl(-) -> HCl").printInfo();
//        Reaction.fromString("2NO2+NO3+CO => NO3+NO+CO2+NO2").printInfo();
//		Reaction.fromString("Al + I2 -> AlI3").printInfo();
//		Reaction.fromString("NH3 + CO2 → (NH2)2CO + H2O").printInfo();
//		Reaction.fromString("Zn + HCl → ZnCl2 + H2").printInfo();