DECLARE SUB groupperiod () DECLARE SUB mixmaincomp () DECLARE SUB masspercentcomp () DECLARE SUB rmmcomp () DECLARE SUB rmmgramscomp () DECLARE FUNCTION calcrmmcomp! (comp!) DECLARE SUB masspercent () DECLARE SUB rmmgrams () DECLARE FUNCTION calcrmm! (cation!, anion!) DECLARE SUB qmark (ans!, nans!) DECLARE SUB printtrueformula (cation!, anion!) DECLARE SUB printformula (cation!, anion!, i!, j!) DECLARE SUB formula () DECLARE SUB mark (choice!, ans!) DECLARE SUB rmm () DECLARE SUB question () DECLARE SUB pause () DECLARE SUB mainmenu () DECLARE SUB mainhelp () DECLARE SUB categorymenu () DECLARE SUB question () DECLARE SUB match (qarray() AS STRING, aarray() AS STRING, narray!, nans!) DECLARE SUB number (qarray() AS STRING, aarray!(), nques!) DECLARE SUB elemparticle (qarray() AS STRING, aarray1(), aarray2(), nques) DECLARE FUNCTION irand! (i!) DIM SHARED correct, tries, nchoices nchoices = 4 DIM SHARED progname AS STRING progname = "Chemistry Quiz Program" ' Question Categories DIM SHARED category, ncat ncat = 18 DIM SHARED CatName(ncat) AS STRING DATA "Element Names and Symbols", "Element Properties", "Element Uses", "Element Particles", "Element Groups and Periods", "Ion Names and Formulas", "Ion Charges", "Ionic Compound Formula Balancing", "Compound Names and Formulas", "Compound Properties", "Compound Uses", "Compound Relative Molecular Mass", "Compound Moles to Mass Conversion", "Compound Percentage by Mass of Element", "Mixture Components", "Mixture Properties", "Mixture Uses", "Chemical Terms" FOR i = 1 TO ncat READ CatName(i) NEXT i ' Elements DIM SHARED nelem nelem = 31 DIM SHARED ElemName(nelem) AS STRING DIM SHARED ElemSymbol(nelem) AS STRING DIM SHARED ElemProtons(nelem) DIM SHARED ElemNucleons(nelem) DIM SHARED ElemProp(nelem) AS STRING DIM SHARED ElemUse(nelem) AS STRING DATA hydrogen, H, 1, 1, "colourless, explosive, diatomic gas, lowest melting point, lowest density, most common element in universe, found in water", "fills balloons, making rocket fuel, margarine, methanol" DATA helium, He, 2, 4, "inert gas, low density, low melting point", "fills balloons, used in diving equipment" DATA lithium, Li, 3, 7, "lightest metal, soft", "" DATA beryllium, Be, 4, 9, "light metal", "making alloy for copper springs" DATA boron, B, 5, 11, "solid non-metal", "borax" DATA carbon, C, 6, 12, "two elemental forms are diamond (clear, hardest solid) and graphite (black solid, conducts electricity)", "added to iron to make steel; found in all organic compounds (plants and animals), carbonates, coal, charcoal, coke, petroleum, natural gas, and hydrocarbons" DATA nitrogen, N, 7, 14, "colorless unreactive diatomic gas", "making ammonia, nitric acid, fertilisers, and explosives; fills some light bulbs; inert atmosphere for food, freezing things" DATA oxygen, O, 8, 16, "reacts with other elements and heat in combustion, found in water and colourless diatomic gas in air", "respiration (breathing), combustion of fuels, cutting and welding metals, and making steel and ozone" DATA fluorine, F, 9, 19, "very reactive, most powerful oxidising agent, very poisonous diatomic halogen gas", "making toothpaste and freon (refridgerator gas)" DATA neon, Ne, 10, 20, "colourless inert gas found in the air", "fills glowing fluorescent electric lights in advertisement signs" DATA sodium, Na, 11, 23, "soft metal, very reactive, floats in water and reacts strongly with water, conducts heat well, low melting point, catches fire with little heating", "found in table salt, used as liquid coolant in nuclear reactors" DATA magnesium, Mg, 12, 24, "strong, lightweight metal, burns in air with bright white light", "protective coating for steel" DATA aluminium, Al, 13, 27, "strong, lightweight metal, extracted from bauxite using electrolysis, conducts electricity and heat, non-toxic", "aircraft, beverage cans, milk tops, foil to wrap food, saucepans, overhead electricity cables" DATA silicon, Si, 14, 28, "metalloid solid found in sand and rocks", "making computer semiconductors and glass" DATA phosphorus, P, 15, 31, "soft, non-metal, solid, ignites easily in air without heating", "making phosphates (fertilisers, detergents), used by plant roots and seeds" DATA sulphur, S, 16, 32, "solid, yellow, non-metal, produces poison gas with rotten egg smell", "making sulphuric acid, rubber, drugs, pesticides, matches, paper, concrete" DATA chlorine, Cl, 17, 35, "greenish yellow, poisonous, diatomic, halogen, gas", "making hydrochloric acid, bleaches, pesticides, and solvents; found in table salt; sterilise water for drinking and swimming" DATA argon, Ar, 18, 40, "colourless, inert, gas, found in the air", "fills electric bulbs, inert atmosphere for electric welding" DATA potassium, K, 19, 39, "soft metal, very reactive, floats in water and produces fire", "helps plants to survive frost and resist disease" DATA calcium, Ca, 20, 40, "lightweight metal, reacts with water, many compounds in earth's crust", "found in limestone, quick lime, slaked lime, bones and teeth" DATA iron, Fe, 26, 56, "magnetic, grey, abundant metal, hard if carbon added, extracted from haematite, does not burn", "steel buildings, bridges, cars, cutting blades, tanks, pipes, permanent magnets, electromagnets" DATA copper, Cu, 29, 63, "orange, scarce metal, does not burn, good conductor of heat and electricity, extracted from pyrites", "electric wires, bronze, brass" DATA zinc, Zn, 30, 65, "scarce, grey metal", "added as a coating to make galvanised iron to prevent rust" DATA bromine, Br, 35, 80, "diatomic red liquid halogen, poisonous non-metal", "solution used to test for alkene (unsaturation)" DATA silver, Ag, 47,108, "shiny, valuable metal, good conductor of electricity", "jewelery, coating for photographic film and paper" DATA tin, Sn, 50,119, "scarce, unreactive, non-toxic metal", "plating on steel food cans to prevent rust" DATA iodine, I, 53,127, "purple or black, solid, diatomic, halogen, poisonous, non-metal", "cleaning cuts of skin" DATA gold, Au, 79,197, "very dense, soft, malleable, shiny, unreactive, does not burn or react with any acid, very valuable metal, good conductor of heat and electricity", "jewelry" DATA mercury, Hg, 80,201, "scarce, dense metal, liquid at room temperature, expands when heated", "thermometers" DATA lead, Pb, 82,207, "dense, soft, malleable, dull, unreactive metal", "pipes, roofing" DATA uranium, U, 92,238, "heavy metal, radioactive isotopes", "fuel for fission in nuclear reactors" FOR i = 1 TO nelem READ ElemName(i), ElemSymbol(i), ElemProtons(i), ElemNucleons(i), ElemProp(i), ElemUse(i) NEXT i ' Ions DIM SHARED nion nion = 19 DIM SHARED IonName(nion) AS STRING DIM SHARED IonFormula(nion) AS STRING DIM SHARED IonCharge(nion) DIM SHARED IonElem(3, nion) DIM SHARED IonNElem(3, nion) DATA ammonium, "NH4 +", 1, 7, 1, 0, 1, 4, 0 DATA carbonate, "CO3 2-", -2, 6, 8, 0, 1, 3, 0 DATA "hydrogen carbonate", "HCO3 -", -1, 1, 6, 8, 1, 1, 3 DATA hydroxide, "OH -", -1, 8, 1, 0, 1, 1, 0 DATA nitrate, "NO3 -", -1, 7, 8, 0, 1, 3, 0 DATA phosphate, "PO4 3-", -3, 15, 8, 0, 1, 4, 0 DATA sulphate, "SO4 2-", -2, 16, 8, 0, 1, 4, 0 DATA lithium, "Li +", 1, 3, 0, 0, 1, 0, 0 DATA beryllium, "Be 2+", 2, 4, 0, 0, 1, 0, 0 DATA nitride, "N 3-", -3, 7, 0, 0, 1, 0, 0 DATA oxide, "O 2-", -2, 8, 0, 0, 1, 0, 0 DATA fluoride, "F -", -1, 9, 0, 0, 1, 0, 0 DATA sodium, "Na +", 1, 11, 0, 0, 1, 0, 0 DATA magnesium, "Mg 2+", 2, 12, 0, 0, 1, 0, 0 DATA aluminium, "Al 3+", 3, 13, 0, 0, 1, 0, 0 DATA sulphide, "S 2-", -2, 16, 0, 0, 1, 0, 0 DATA fluoride, "F -", -1, 17, 0, 0, 1, 0, 0 DATA potassium, "K +", 1, 19, 0, 0, 1, 0, 0 DATA calcium, "Ca 2+", 2, 20, 0, 0, 1, 0, 0 FOR i = 1 TO nion READ IonName(i), IonFormula(i), IonCharge(i) FOR j = 1 TO 3 READ IonElem(j, i) NEXT j FOR j = 1 TO 3 READ IonNElem(j, i) NEXT j NEXT i ' Compounds DIM SHARED ncomp ncomp = 30 DIM SHARED CompName(ncomp) AS STRING DIM SHARED CompFormula(ncomp) AS STRING DIM SHARED CompElem(3, ncomp) DIM SHARED CompNElem(3, ncomp) DIM SHARED CompProp(ncomp) AS STRING DIM SHARED CompUse(ncomp) AS STRING DATA water, "H2 0", 1, 8, 0, 2, 1, 0, "liquid at room temperature, solvent for ionic substances, expands when frozen, defines fixed points, turns blue when adding white anhydrous copper(II) sulphate, turns blue cobalt (II) chloride paper pink", "drinking, cleaning, cooking; making cement, steel and electricity; solvent" DATA "table salt", "Na Cl", 11, 17, 0, 1, 1, 0, "ionic solid", "improves flavour of food" DATA ammonia, "N H3", 7, 1, 0, 1, 3, 0, "colourless flammable gas with pungent odour, turns damp red litmus paper blue", "nitric acid, fertilisers, household cleaners, dyes, explosives, nylon" DATA "carbon dioxide", "C O2", 6, 8, 0, 1, 2, 0, "colourless, odourless gas, turns limewater milky, produced by complete combustion of carbon-containing substances, or by reaction of acid and carbonate", "fire extinguishers, fizzy drinks, freezing foods, photosynthesis by plants" DATA "carbon monoxide", "C O", 6, 8, 0, 1, 1, 0, "colourless, odourless, deadly poisonous gas (reacts with haemoglobin in blood), made from incomplete combustion of carbon-containing substances", "extraction of iron" DATA methane, "C H4", 6, 1, 0, 1, 4, 0, "colourless, bad smelling gas produced at sewage plants", "fuel for cooking and heating, production of hydrogen" DATA ethane, "C2 H6", 6, 1, 0, 2, 6, 0, "", "fuel found in natural gas" DATA propane, "C3 H8", 6, 1, 0, 3, 8, 0, "", "camping gas, gas lighters" DATA butane, "C4 H10", 6, 1, 0, 4, 10, 0, "", "camping gas, gas lighters" DATA ethene, "C2 H4", 6, 1, 0, 2, 4, 0, "", "polymers like polythene, a plastic" DATA propene, "C3 H6", 6, 1, 0, 3, 6, 0, "", "" DATA methanol, "C H3 OH", 6, 1, 8, 1, 4, 1, "", "solvent" DATA ethanol, "C2 H5 OH", 6, 1, 8, 2, 6, 1, "clear, colourless flammable liquid with strong smell, less dense than water, soluble in water, dangerous to drink", "methylated spirits (fuel), beer, wine; solvent" DATA "hydrochloric acid", "H Cl", 1, 17, 0, 1, 1, 0, "gas with choking smell, irritates eyes and lungs, dissolves easily in water, reacts with bases to form chlorides", "digestion of food in the stomach" DATA "sulphuric acid", "H2 S O4", 1, 16, 8, 2, 1, 4, "colourless oily liquid, dehydrates (removes water), oxidises, reacts with bases to form sulphates", "fertilisers like ammonium sulphate, paint, soap, dyes, plastic, batteries" DATA "nitric acid", "H N O3", 1, 7, 8, 1, 1, 3, "reacts with bases to form nitrates", "fertilisers, explosives like trinitrotoluene (TNT), nylon, drugs" DATA "ethanoic acid", "C H3 C O OH", 6, 1, 8, 2, 4, 2, "weak acid", "vinegar" DATA "carbonic acid", "H2 C O3", 1, 6, 8, 2, 1, 3, "solution of carbon dioxide in water, weak acid", "fizzy drinks" DATA "phosphoric acid", "H3 P O4", 1, 15, 8, 3, 1, 4, "", "" DATA hydrogen, H2, 1, 0, 0, 2, 0, 0, "diatomic, least dense gas, explosive, burns with a pop near lighted splint", "rocket fuel, fills balloons, margarine, methanol" DATA nitrogen, N2, 7, 0, 0, 2, 0, 0, "non-reactive diatomic gas in air", "nitrates for fertilisers, ammonia, freezing food, filling spaces with inert atmosphere, proteins in organisms" DATA oxygen, O2, 8, 0, 0, 2, 0, 0, "colourless reactive diatomic gas in air, relights glowing splint", "respiration (breathing), combustion of fuels, steel, cutting and welding metals, ozone" DATA chlorine, Cl2, 17, 0, 0, 2, 0, 0, "greenish yellow poison diatomic gas, bleaches damp litmus", "hydrochloric acid, table salt, sterilise water for drinking and swimming, bleaches, pesticides, solvents" DATA "sulphur dioxide", "S O2", 16, 8, 0, 1, 2, 0, "colourless gas with strong choking smell, heavier than air, soluble in water, acidic, reduces, bleaches, made from combustion of fossil fuels containing sulphur compounds", "sulphuric acid, bleach, newspapers, fruit preparation, acid rain" DATA "limestone, chalk or marble", "Ca C O3", 20, 6, 8, 1, 1, 3, "hard strong white ionic solid, can be smoothly polished, cheap base", "building, extracting iron, glass, cement, quicklime, neutralises acids in soil" DATA quicklime, "Ca O", 20, 8, 0, 1, 1, 0, "white substance, reacts with water and crumbles to a powder, cheap base", "slaked lime, neutralises acids in soil" DATA "slaked lime", "Ca (OH)2", 20, 8, 1, 1, 2, 2, "white powder, cheap base", "neutralises acids in soil and factory waste" DATA glucose, "C6 H12 O6", 6, 1, 8, 6, 12, 6, "white powder, sweet sugar taste", "starches and proteins for roots, stems and leaves in plants; energy source" DATA "hydrogen peroxide", "H2 O2", 1, 8, 0, 2, 2, 0, "clear colourless liquid, decomposes to form water and oxygen", "making oxygen" DATA sand, "Si O2", 14, 8, 0, 1, 2, 0, "hard, clear solid", "making glass, filtering water" FOR i = 1 TO ncomp READ CompName(i) READ CompFormula(i) FOR j = 1 TO 3 READ CompElem(j, i) NEXT j FOR j = 1 TO 3 READ CompNElem(j, i) NEXT j READ CompProp(i) READ CompUse(i) NEXT i ' Mixtures DIM SHARED nmix nmix = 14 DIM SHARED temp1(4) AS STRING DIM SHARED temp2(4) AS STRING DIM SHARED MixName(nmix) AS STRING DIM SHARED MixProp(nmix) AS STRING DIM SHARED MixUse(nmix) AS STRING DIM SHARED MixComp(4, nmix) AS STRING DIM SHARED MixComps(nmix) AS STRING DATA "acid rain", "liquid precipitation with a pH less than 7, due to its absorbtion of non-metal oxides", "", "sulphur dioxide", "carbon dioxide", "nitric oxide", "" DATA air, "odourless, colourless gas", "breathing, wind, cooling, insulation, fractional distillation to separate gases", nitrogen, oxygen, argon, "carbon dioxide and water vapour" DATA milk, "white liquid", "drinking, cheese, yogurt, butter", water, fat, glucose, calcium DATA coal, "hard black solid", "fuel, coke", carbon, hydrogen, sulphur, lead DATA petroleum, "sticky black oily liquid", "fuels, plastics, washing powders, paints, drugs, cosmetics", "liquid fuels like petrol", "gas fuels like methane", "waxes like paraffin", bitumen DATA natural gas, "smelly colourless gas", "fuel for heating and cooking", methane, ethane, propane, butane DATA "earth's crust", "many-coloured solid with many different properties", "mining, plant and animal habitat", oxygen, silicon, aluminium, iron DATA brass, "gold-coloured, sonorous solid", "musical instruments like trumpets and saxophones", copper, zinc, "", "" DATA bronze, "gold-coloured solid, turns green when corroded", "statues, ornaments, church bells", copper, tin, "", "" DATA "mild steel", "hard, strong solid, easily shaped", "buildings, bridges, ships, car bodies, machinery", iron, carbon, "", "" DATA "hard steel", "very hard and strong solid", "blades for cutting tools", iron, carbon, "", "" DATA "stainless steel", "hard, strong solid, does not rust", "car parts, tableware and cutlery, kitchen sinks, chemical plants, things that should not rust", iron, chromium, nickel, "" DATA "salad dressing", "cloudy, oily liquid", "seasoning for vegetables", vinegar, oil, water, spices DATA solder, "solid with low melting point", "joining pipes and wires", "tin", "lead", "", "" FOR i = 1 TO nmix READ MixName(i), MixProp(i), MixUse(i) MixComps(i) = "" flag = 0 FOR j = 1 TO 4 READ MixComp(j, i) IF MixComp(j, i) <> "" THEN MixComps(i) = MixComps(i) + MixComp(j, i) + ", " ELSE flag = 1 NEXT j IF flag = 0 THEN MixComps(i) = MixComps(i) + "etc." NEXT i ' Terms DIM SHARED nterm nterm = 126 DIM SHARED TermName(nterm) AS STRING DIM SHARED TermDef(nterm) AS STRING DATA acid, "a substance which can lose protons (hydrogen) to gain a metal, produce carbon dioxide from carbonates, turns litmus red (pH < 7)" DATA alcohol, "organic compound containing an -OH group, formed by fermentation of a sugar like glucose or adding steam to an alkene, soluble in water, used as solvent or burned as a fuel" DATA alkali, "a substance which dissolves in water to produce hydroxide ions and which neutralises an acid to produce a salt and water; a soluble base; turns litmus blue (pH > 7)" DATA "alkali earth metal", "an element in Group II of the Periodic Table" DATA "alkali metal", "an element in Group I of the Periodic Table, having low melting point, low density and strong reaction with water" DATA alkane, "saturated hydrocarbon with the general formula Cn H2n+2, unreactive except for burning to give carbon dioxide and water; used as fuel; found in natural gas and crude oil" DATA alkene, "unsaturated hydrocarbon with the general formula Cn H2n and one double bond, turns orange bromine water colourless, reacts with hydrogen to form an alkane, reacts with steam to form an alcohol, burns to give carbon dioxide and water, manufactured by cracking alkanes, used to make polymers and alcohols" DATA alloy, "metallic solid produced by dissolving two or more molten metals in each other" DATA amphoteric, "acting as either acid or base" DATA anion, "a negatively charged ion which is attracted toward the anode in electrolysis" DATA aqueous, "dissolved in a water solution" DATA atom, "the smallest part of an element which can take part in a chemical reaction" DATA "atomic number", "the number of protons in the nucleus of an atom, or the number of electrons surrounding the nucleus of a neutral atom" DATA base, "the hydroxide of a metal; an alkali" DATA bauxite, "main ore of aluminium" DATA boiling, "the change of state of a substance from liquid to gas" DATA "boiling point", "temperature at which a substance changes between a liquid and a gas" DATA bond, "putting elements together to form a compound or substance; can be ionic, covalent, or metallic" DATA brittle, "a substance which breaks easily when struck by a hard object; not malleable" DATA "brownian motion", "the random movement of particles due to collisions" DATA catalyst, "a substance which changes the rate of reaction but is itself unchanged in amount at the end of the reaction" DATA cation, "a positively charged ion which is attracted toward the cathode in electrolysis" DATA celsius, "thermometer scale on which the freezing point of water is zero and the boiling point is 100" DATA "chemical change", "a process which is difficult to reverse in which a new substance is formed with different properties, and energy is gained or lost" DATA chemistry, "the science which deals with the composition, behaviour and transformation of matter" DATA chlorophyll, "the green substance in leaves used for photosynthesis" DATA combustion, "burning (e. g. of fuels), usually in air; oxidation which gives out heat and light energy (flame)" DATA compound, "a pure substance formed when two or more elements are chemically combined in definite proportions by mass" DATA condensation, "the change of state of a substance from gas to liquid" DATA conductor, "a substance which allows heat or electricity to pass through easily" DATA covalent, "a type of bond resulting from the sharing of pairs of electrons between atoms" DATA crystal, "a solid whose particles (molecules, atoms, ions) are arranged in a definite pattern, to make a geometric shape" DATA decomposition, "breaking down a substance into simpler ones" DATA density, "the mass of a unit volume of a substance" DATA diesel, "fraction of petroleum used as fuel in lorries" DATA diffusion, "particles move through gases and solutions to make a uniform mixture" DATA dissolve, "when particles of one substance are put in a liquid, mix with the liquid, separate and become too small to be seen in the liquid" DATA ductile, "a substance which can be made into wires" DATA electrolysis, "decomposing a substance (molten or in solution) by passing electric current through it" DATA electron, "a particle in an atom with a negative charge and small mass which revolve around the nucleus" DATA element, "a substance that cannot be broken down into a simpler substance by chemical means; all its atoms have the same atomic number" DATA endothermic, "a process which absorbs heat uses the heat to break chemical bonds" DATA equation, "a statement of a chemical reaction using the symbols and formulas of the reactants and products" DATA evaporation, "the change of state from liquid to vapour below boiling point" DATA exothermic, "a process which forms chemical bonds and gives out heat" DATA expand, "increase in volume" DATA explosion, "a very fast exothermic reaction" DATA filtrate, "the liquid which passes through the filter paper during filtration" DATA formula, "the composition of a substance indicated by symbols of each element present and subscript numbers showing the number of each type of atom involved" DATA freezing, "the change of state of a substance from liquid to solid" DATA fuel, "substance that produces useful energy" DATA galvanising, "a process to coat a metal or alloy such as steel with a layer of another metal with different reactivity such as zinc, to prevent corrosion" DATA gram, "a unit of mass" DATA group, "vertical column in the Periodic Table" DATA haematite, "main ore of iron" DATA halogen, "an element in Group VII of the Periodic Table; a diatomic non-metal which reacts with other elements in the group" DATA "hard water", "water, containing dissolved calcium and magnesium compounds, which produces scum and very little lather when soap is added" DATA "homologous series", "family of similar compounds with similar properties due to the presence of the same functional group" DATA hydrated, "an ionic crystal that contains water molecules as well as ions" DATA hydrocarbon, "organic compound containing only hydrogen and carbon" DATA ion, "an electrically charged particle formed from an atom or group of atoms by loss or gain of electrons" DATA ionic, "a type of bond where electrons are transferred from one atom (e.g. metal) to another (e.g. non-metal) and the two atoms attract because of their opposite charges" DATA impurity, "small amount of a substance mixed with another substance which has a lowered freezing point and raised melting point" DATA indicator, "a substance like litmus that shows different colours in acidic or alkaline conditions" DATA inert, "having little tendency to undergo chemical change" DATA isomers, "compounds with the same formula but different molecular structures" DATA isotopes, "atoms of an element having the same chemical properties but differing in atomic weight" DATA litre, "a unit of liquid volume" DATA malleable, "a substance which can be struck with a hard instrument and made into different shapes without breaking; not brittle" DATA matter, "anything that occupies space and has mass" DATA mass, "a measure of the amount of mass in a substance or object" DATA "mass number", "number of nucleons (protons + neutrons) in an atom" DATA melting, "the change of the state of a substance from solid to liquid" DATA "melting point", "temperature at which a substance changes between solid and liquid" DATA metal, "an element which easily loses electrons to form positive ions and conduct electricity" DATA "metallic bond", "a lattice of positive ions in a 'sea of electrons' which gives high electrical conductivity and malleability" DATA metalloid, "element with characteristics of both metals and non-metals" DATA metre, "a unit of length" DATA mixture, "a combination of substances held together by physical rather than chemical means" DATA mole, "amount of a substance when its relative molecular (or atomic) mass equals the mass in grams of the substance" DATA molecule, "smallest particle of a substance which can exist by itself and still have the properties of that substance" DATA molten, "a substance which would be solid at room temperature but is liquid" DATA neutral, "a charge of zero or pH of 7" DATA neutralisation, "combining an acid and base to produce a neutral solution of a salt and water" DATA neutron, "a particle in the nucleus of an atom with the same mass as a proton but no charge" DATA noble, "not chemically active; relatively inert" DATA "noble gas", "an atom in Group VIII (or Group 0) of the Periodic Table which is unreactive and used to provide an inert atmosphere" DATA "non-metal", "element which easily gains electrons to form negative ions; non-conductor of electricity" DATA nucleon, "a particle in the nucleus of an atom (proton or neutron)" DATA nucleus, "the centre of an atom containing nearly all of the atom's mass and a positive charge" DATA ore, "a solid, natural mineral which is mined and from which metals are extracted" DATA oxidation, "the addition of oxygen or removal of hydrogen or loss of electrons" DATA paraffin, "fraction of petroleum, used as fuel for oil stoves and aircraft" DATA period, "horizontal row in the Periodic Table" DATA petrol, "fraction of petroleum, used as fuel in cars" DATA pH, "a scale to measure the acidity or alkalinity of a solution" DATA photosynthesis, "the production of glucose from carbon dioxide and water in the presence of chlorophyll and sunlight" DATA "physical change", "changing the properties of a substance without creating a new substance" DATA plastic, "a solid that is easily moulded into different shapes" DATA polymer, "very large molecule created by joining many small molecules" DATA precipitate, "an insoluble substance which separates from solution during a chemical reaction, often forming a sediment on the bottom" DATA products, "the substances formed as a result of a chemical change" DATA proton, "a particle in the nucleus of an atom with the same mass as a neutron and a positive charge" DATA pure, "a substance that has no other substances mixed with it" DATA pyrites, "ore of copper" DATA radioactivity, "the emission of alpha, beta and gamma rays from a substance through the breakdown or decay of nuclei of its atoms" DATA reactants, "the substances that react with one another in a chemical change" DATA reaction, "a chemical change" DATA reduction, "the removal of oxygen or the addition of hydrogen or gain of electrons" DATA redox, "a reaction where oxidation and reduction are occurring" DATA "relative atomic mass", "the mass of an atom where the mass of the carbon-12 isotope is defined to be 12; also called atomic weight" DATA "relative molecular mass", "the mass of a molecule where the mass of the carbon-12 isotope is defined to be 12; also called molecular or formula weight" DATA "renewable energy", "energy that can be replenished, such as solar, hydroelectric, and wind" DATA residue, "the solid which is left in the filter paper" DATA reversible, "a physical change or chemical reaction reaction that can go in either direction depending on the conditions, such as hydration" DATA rust, "corrosion or oxidising of iron and steel by water and oxygen in the air to form iron oxide, a brown solid" DATA salt, "an ionic solid containing no hydrogen, oxide or hydroxide ions, possibly formed in a reaction of an acid with a base or metal" DATA saturated, "full; containing the maximum amount possible under the conditions" DATA second, "a unit of time" DATA "soft water", "water which produces lather when soap is added" DATA soluble, "a substance that can dissolve in a given solvent" DATA solubility, "the amount of solute which can dissolve in a solvent, or the concentration of a saturated solution of a given solute" DATA solute, "a substance (often solid) which dissolves in another substance" DATA solution, "a mixture of two substances, one dissolved in the other" DATA solvent, "a substance (often liquid) which is dissolved in another substance" DATA stable, "relatively inert; hard to decompose" DATA sublimation, "the change of state of a substance from solid to gas or gas to solid" DATA symbol, "a letter or letters representing the name of an element" DATA "transition element", "a metal between Group II and Group III in the Periodic Table which has high density, high melting point, forms coloured compounds, and can act as a catalyst" DATA volatile, "evaporates easily" DATA volume, "amount of space occupied by a substance" ' equipment 'DATA anode, "the positive electrode in electrolysis which attracts anions" 'DATA beaker, "glass container for a liquid in a chemistry experiment" 'DATA "bunsen burner", "laboratory instrument used to heat using a gas flame" 'DATA burette, "instrument with a tap used to find the volume of a reactant in a neutralisation reaction" 'DATA cathode, "the negative electrode in electrolysis which attracts cations" 'DATA centrifuge, "instrument to separate small amounts of suspension from a liquid in a test tube by spinning the test tube" 'DATA crucible, "dish used to contain substances for heating" 'DATA "evaporating dish", "chemical instrument used to separate a liquid from a solid by heating" 'DATA funnel, "conical instrument used when filtering or pouring liquids" 'DATA "filter paper", "porous substance used to separate a liquid from a solid" 'DATA "measuring cylinder", "laboratory instrument used to find the volume of a liquid or powdered substance" 'DATA pipette, "glass container to accurately measure a small amount of liquid" 'DATA syringe, "instrument used to put in or take out an exact volume of liquid or gas, often used in hospitals to give injections" 'DATA test tube, "cylindrical glass container for a small amount of substance in chemical experiments" 'DATA thermometer, "an instrument made of glass containing a liquid such as alcohol or mercury used to measure temperature" 'DATA "triple beam balance", "an instrument used to measure mass" ' techniques 'DATA centrifuging, "method of spinning test tubes to separate small amounts of suspension from a liquid" 'DATA chromatography, "technique of separating coloured substances by how they dissolve and are absorbed" 'DATA crystallisation, "separating solids from liquids in a supersaturated (highly concentrated) solution" 'DATA decanting, "technique of separating a liquid from another liquid or a solid by pouring it off from the top" 'DATA dissolving, "method to separate a soluble solid from an insoluble solid" 'DATA distillation, "separation or purification of liquids by heating to convert to vapour and re-condensing to a liquid" 'DATA filtration, "a method of separating solids from liquids using porous paper" 'DATA "fractional distillation", "the separation of several liquids which have different boiling points by collecting the distillates at different temperatures" 'DATA precipitation, "technique of producing a solid by mixing two liquids" FOR i = 1 TO nterm READ TermName(i), TermDef(i) NEXT i ' Main Loop DIM SHARED playsound playsound = 1 PLAY "l16" RANDOMIZE TIMER DIM SHARED starttime starttime = TIMER DIM SHARED maketest maketest = 0 IF maketest = 1 THEN OPEN test$ FOR OUTPUT AS #1 CALL mainhelp DO CALL mainmenu LOOP IF maketest = 1 THEN CLOSE #1 FUNCTION calcrmm (cation, anion) ans1 = 0 FOR j = 1 TO 3 ans1 = ans1 + ElemNucleons(IonElem(j, cation)) * IonNElem(j, cation) NEXT j ans2 = 0 FOR j = 1 TO 3 ans2 = ans2 + ElemNucleons(IonElem(j, anion)) * IonNElem(j, anion) NEXT j IF IonCharge(cation) <> -IonCharge(anion) THEN ans1 = -ans1 * IonCharge(anion) ans2 = ans2 * IonCharge(cation) END IF ans = ans1 + ans2 calcrmm = ans END FUNCTION FUNCTION calcrmmcomp (comp) ans = 0 FOR j = 1 TO 3 ans = ans + ElemNucleons(CompElem(j, comp)) * CompNElem(j, comp) NEXT j calcrmmcomp = ans END FUNCTION SUB categorymenu CLS PRINT progname; " - Question Category" PRINT PRINT 0, "Random", IF category = 0 THEN PRINT "<----" ELSE PRINT FOR i = 1 TO ncat PRINT i, CatName(i), IF i = category THEN PRINT "<----" ELSE PRINT NEXT i PRINT INPUT "Enter the number of a category"; category DO WHILE category < 0 OR category > ncat PRINT "Please enter a number from 0 to"; ncat INPUT category LOOP END SUB SUB elemparticle (qarray() AS STRING, aarray1(), aarray2(), nques) DIM particles(4) AS STRING particles(1) = "protons" particles(2) = "electrons" particles(3) = "neutrons" particles(4) = "nucleons" n = irand(nques) qty = irand(4) SELECT CASE qty CASE 1, 2 ans = aarray1(n) CASE 3 ans = aarray2(n) - aarray1(n) CASE 4 ans = aarray2(n) END SELECT PRINT qarray(n); " has atomic number"; aarray1(n); "and mass number"; aarray2(n); "." PRINT "How many "; particles(qty); " does it have"; INPUT choice CALL mark(choice, ans) END SUB SUB formula DO cation = irand(nion) LOOP WHILE IonCharge(cation) < 0 PRINT IonName(cation); " ions have a charge +"; IonCharge(cation); "." DO anion = irand(nion) LOOP WHILE IonCharge(anion) > 0 PRINT IonName(anion); " ions have a charge "; IonCharge(anion); "." PRINT "What is the chemical formula of "; IonName(cation); " "; IonName(anion); "?" PRINT k = 0 FOR i = 1 TO 3 FOR j = 1 TO 3 k = k + 1 PRINT k; CALL printformula(cation, anion, i, j) NEXT j NEXT i ans1 = -IonCharge(anion) ans2 = IonCharge(cation) ans = ans2 + (ans1 - 1) * 3 IF IonCharge(cation) = -IonCharge(anion) THEN ans = 1 CALL qmark(ans, 9) END SUB SUB groupperiod r = irand(3) e = irand(20) SELECT CASE r CASE 1 PRINT "In what period is the element "; ElemName(e); "?" IF ElemProtons(e) < 3 THEN ans = 1 ELSE ans = INT((ElemProtons(e) - 3) / 8) + 2 CASE 2 PRINT "In what group is the element "; ElemName(e); "?" SELECT CASE ElemProtons(e) CASE 1 ans = 1 CASE 2 ans = 8 CASE ELSE ans = (ElemProtons(e) - 2) MOD 8 IF ans = 0 THEN ans = 8 END SELECT CASE 3 PRINT "How many valence (outer shell) electrons are in the element "; ElemName(e); "?" SELECT CASE ElemProtons(e) CASE 1 ans = 1 CASE 2 ans = 2 CASE ELSE ans = (ElemProtons(e) - 2) MOD 8 IF ans = 0 THEN ans = 8 END SELECT END SELECT CALL qmark(ans, 8) END SUB FUNCTION irand (i) irand = INT(RND * i) + 1 END FUNCTION SUB mainhelp CLS PRINT progname PRINT PRINT "This program tests your knowledge of chemistry." PRINT "It is loosely based on the Cambridge IGCSE Physical Science syllabus." PRINT "It concentrates on the first 20 elements of the Periodic Table." PRINT "For some question categories you may need a Periodic Table or calculator." PRINT CALL pause END SUB SUB mainmenu CLS PRINT progname; " - Main Menu" PRINT IF tries = 0 THEN score = 0 ELSE score = INT(correct / tries * 100) PRINT "Correct Answers: "; correct PRINT "Questions Tried: "; tries PRINT "Percent Score: "; score; "%" IF correct > 0 THEN PRINT "Average Time per Correct Answer:"; INT((TIMER - starttime) / correct); "seconds" PRINT PRINT "Question Category: "; IF category = 0 THEN PRINT " 0 (Random)" ELSE PRINT category; "("; CatName(category); ")" END IF PRINT "Multiple Choice Options: "; nchoices PRINT "Sound: "; IF playsound > 0 THEN PRINT "On" ELSE PRINT "Off" PRINT PRINT "Press Enter to try the next question." PRINT "Press R to reset the score to zero." PRINT "Press Q to change the question category." PRINT "Press M to change the number of multiple choice options." PRINT "Press S to turn sounds on or off." PRINT "Press I to display information about this program." PRINT "Press Esc to exit this program." DO a$ = INKEY$ LOOP WHILE a$ = "" SELECT CASE a$ CASE CHR$(13) 'enter CALL question CASE "r" correct = 0 tries = 0 starttime = TIMER CASE "q" CALL categorymenu CASE "m" CLS DO PRINT "Enter the number of choices for multiple choice questions (2 to 9)" INPUT nchoices IF nchoices < 2 OR nchoices > 9 THEN PRINT "You must enter a number from 2 to 9." LOOP WHILE nchoices < 2 OR nchoices > 9 CASE "s" playsound = -playsound CASE "i" CALL mainhelp CASE CHR$(27) 'esc CLS SYSTEM 'PRINT "You have exited the program." 'PRINT "To return to Windows, press Alt, press F, and press X." 'END 'CHAIN "c:\users\vogl\basic\exit.bas" CASE ELSE PRINT PRINT "Sorry, you have made an invalid choice." CALL pause END SELECT END SUB SUB mark (choice, ans) IF choice = ans THEN IF playsound > 0 THEN PLAY "CF" PRINT "Correct!" correct = correct + 1 ELSE IF playsound > 0 THEN PLAY "FDD" PRINT "Incorrect. The correct answer is:" PRINT ans END IF tries = tries + 1 PRINT END SUB SUB masspercent DO cation = irand(nion) LOOP WHILE IonCharge(cation) < 0 DO anion = irand(nion) LOOP WHILE IonCharge(anion) > 0 ion = cation total = calcrmm(cation, anion) ans = ElemNucleons(IonElem(1, ion)) * IonNElem(1, ion) / total * 100 IF IonCharge(cation) <> -IonCharge(anion) THEN ans = ans * -IonCharge(anion) ans = INT(ans) PRINT IonName(cation); " "; IonName(anion); " has the formula "; CALL printtrueformula(cation, anion) PRINT "and relative molecular mass"; total; "." PRINT ElemName(IonElem(1, ion)); " has relative atomic mass"; ElemNucleons(IonElem(1, ion)); "." PRINT "What is the percentage by mass of the element "; ElemName(IonElem(1, ion)); " in the compound "; IonName(cation); " "; IonName(anion); "?" INPUT choice CALL mark(choice, ans) END SUB SUB masspercentcomp comp = irand(ncomp) total = calcrmmcomp(comp) ans = ElemNucleons(CompElem(1, comp)) * CompNElem(1, comp) / total * 100 ans = INT(ans + .5) PRINT CompName(comp); " has the formula "; CompFormula(comp) PRINT "and relative molecular mass"; total; "." PRINT ElemName(CompElem(1, comp)); " has relative atomic mass"; ElemNucleons(CompElem(1, comp)); "." PRINT "What is the percentage by mass of the element "; ElemName(CompElem(1, comp)); " in the compound "; CompName(comp); "?" INPUT choice CALL mark(choice, ans) END SUB SUB match (qarray() AS STRING, aarray() AS STRING, narray, nans) DIM temp(nans) AS STRING na = nans IF narray < na THEN na = narray ' to avoid infinite loops DO ques = irand(narray) LOOP WHILE qarray(ques) = "" OR aarray(ques) = "" ans = irand(na) PRINT qarray(ques) PRINT FOR i = 1 TO na IF ans = i THEN j = ques ELSE DO j = irand(narray) flag = 0 FOR k = 1 TO i - 1 IF temp(k) = aarray(j) THEN flag = 1 NEXT k LOOP WHILE j = ques OR qarray(j) = "" OR aarray(j) = "" OR flag = 1 END IF temp(i) = aarray(j) PRINT i; temp(i) NEXT i CALL qmark(ans, na) END SUB SUB mixmaincomp PRINT "What is the main component of this mixture?" m = irand(nmix) PRINT MixName(m) PRINT FOR n = 4 TO 1 STEP -1 IF MixComp(n, m) <> "" THEN EXIT FOR NEXT n ans = irand(n) PRINT 1; MixComp(ans, m) FOR i = 2 TO n PRINT i; IF i = ans THEN j = 1 ELSE j = i PRINT MixComp(j, m) NEXT i CALL qmark(ans, n) END SUB SUB number (qarray() AS STRING, aarray(), nques) n = irand(nques) PRINT qarray(n) INPUT choice CALL mark(choice, aarray(n)) END SUB SUB pause ' PRINT "Press any key to continue." PRINT "Press Enter to continue." DO a$ = INKEY$ ' LOOP WHILE a$ = "" LOOP WHILE a$ <> CHR$(13) 'Enter END SUB SUB printformula (cation, anion, i, j) DIM catpart AS STRING, anpart AS STRING catpart = IonFormula(cation) catlen = LEN(catpart) IF IonCharge(cation) > 1 THEN catpart = LEFT$(catpart, catlen - 3) ELSE catpart = LEFT$(catpart, catlen - 2) IF i = 1 THEN PRINT catpart; ELSEIF IonElem(2, cation) = 0 THEN PRINT catpart; i; ELSE PRINT "("; catpart; ")"; i; END IF PRINT " "; anpart = IonFormula(anion) anlen = LEN(anpart) IF IonCharge(anion) < -1 THEN anpart = LEFT$(anpart, anlen - 3) ELSE anpart = LEFT$(anpart, anlen - 2) IF j = 1 THEN PRINT anpart ELSEIF IonElem(2, anion) = 0 THEN PRINT anpart; j ELSE PRINT "("; anpart; ")"; j END IF END SUB SUB printtrueformula (cation!, anion!) IF IonCharge(cation) = -IonCharge(anion) THEN CALL printformula(cation, anion, 1, 1) ELSE CALL printformula(cation, anion, -IonCharge(anion), IonCharge(cation)) END IF END SUB SUB qmark (ans, nans) PRINT PRINT "Press a number from 1 to"; nans; "." DO a$ = INKEY$ IF a$ <> "" THEN choice = ASC(a$) - ASC("0") LOOP WHILE a$ = "" OR choice < 1 OR choice > nans PRINT choice PRINT CALL mark(choice, ans) END SUB SUB question CLS PRINT progname; PRINT cat = category IF category = 0 THEN cat = irand(ncat) PRINT "Question Category: "; cat; "("; CatName(cat); ")" PRINT SELECT CASE cat CASE 1 IF RND > .5 THEN PRINT "What is the atomic symbol of the element named below?" CALL match(ElemName(), ElemSymbol(), nelem, nchoices) ELSE PRINT "What is the element of the atomic symbol shown below?" CALL match(ElemSymbol(), ElemName(), nelem, nchoices) END IF CASE 2 IF RND > .5 THEN PRINT "What is the name of the element with these properties?" CALL match(ElemProp(), ElemName(), nelem, nchoices) ELSE PRINT "What are the properties of this element?" CALL match(ElemName(), ElemProp(), nelem, nchoices) END IF CASE 3 IF RND > .5 THEN PRINT "What is the name of the element with these uses?" CALL match(ElemUse(), ElemName(), nelem, nchoices) ELSE PRINT "What are the uses of this element?" CALL match(ElemName(), ElemUse(), nelem, nchoices) END IF CASE 4 CALL elemparticle(ElemName(), ElemProtons(), ElemNucleons(), nelem) CASE 5 CALL groupperiod CASE 6 IF RND > .5 THEN PRINT "What is the formula of the ion named below?" CALL match(IonName(), IonFormula(), nion, nchoices) ELSE PRINT "What is the name of the ion formula shown below?" CALL match(IonFormula(), IonName(), nion, nchoices) END IF CASE 7 PRINT "What is the charge on the ion named below?" CALL number(IonName(), IonCharge(), nion) CASE 8 CALL formula CASE 9 IF RND > .5 THEN PRINT "What is the chemical formula of the compound named below?" CALL match(CompName(), CompFormula(), ncomp, nchoices) ELSE PRINT "What is the compound name for the chemical formula shown below?" CALL match(CompFormula(), CompName(), ncomp, nchoices) END IF CASE 10 IF RND > .5 THEN PRINT "What is the name of the compound with these properties?" CALL match(CompProp(), CompName(), ncomp, nchoices) ELSE PRINT "What are the properties of this compound?" CALL match(CompName(), CompProp(), ncomp, nchoices) END IF CASE 11 IF RND > .5 THEN PRINT "What is the name of the compound with these uses?" CALL match(CompUse(), CompName(), ncomp, nchoices) ELSE PRINT "What are the uses of this compound?" CALL match(CompName(), CompUse(), ncomp, nchoices) END IF CASE 12 IF RND > .5 THEN CALL rmm ELSE CALL rmmcomp CASE 13 IF RND > .5 THEN CALL rmmgrams ELSE CALL rmmgramscomp CASE 14 IF RND > .5 THEN CALL masspercent ELSE CALL masspercentcomp CASE 15 r = irand(3) SELECT CASE r CASE 1 PRINT "What is the name of the mixture with these components?" CALL match(MixComps(), MixName(), nmix, nchoices) CASE 2 PRINT "What are the components of this mixture?" CALL match(MixName(), MixComps(), nmix, nchoices) CASE ELSE CALL mixmaincomp END SELECT CASE 16 IF RND > .5 THEN PRINT "What is the name of the mixture with these properties?" CALL match(MixProp(), MixName(), nmix, nchoices) ELSE PRINT "What are the properties of this mixture?" CALL match(MixName(), MixProp(), nmix, nchoices) END IF CASE 17 IF RND > .5 THEN PRINT "What is the name of the mixture with these uses?" CALL match(MixUse(), MixName(), nmix, nchoices) ELSE PRINT "What are the uses of this mixture?" CALL match(MixName(), MixUse(), nmix, nchoices) END IF CASE 18 IF RND > .5 THEN PRINT "What is the chemical term with this definition?" CALL match(TermDef(), TermName(), nterm, nchoices) ELSE PRINT "What is the definition of this chemical term?" CALL match(TermName(), TermDef(), nterm, nchoices) END IF CASE ELSE PRINT "This question category does not exist yet." END SELECT CALL pause END SUB SUB rmm DO cation = irand(nion) LOOP WHILE IonCharge(cation) < 0 DO anion = irand(nion) LOOP WHILE IonCharge(anion) > 0 PRINT IonName(cation); " "; IonName(anion); " has the formula "; CALL printtrueformula(cation, anion) FOR j = 1 TO 3 IF IonElem(j, cation) > 0 THEN PRINT ElemName(IonElem(j, cation)); " has relative atomic mass"; ElemNucleons(IonElem(j, cation)); "." NEXT j FOR j = 1 TO 3 IF IonElem(j, anion) > 0 THEN PRINT ElemName(IonElem(j, anion)); " has relative atomic mass"; ElemNucleons(IonElem(j, anion)); "." NEXT j PRINT "What is the relative molecular mass of "; IonName(cation); " "; IonName(anion); "?" INPUT choice ans = calcrmm(cation, anion) CALL mark(choice, ans) END SUB SUB rmmcomp comp = irand(ncomp) PRINT CompName(comp); " has the formula "; CompFormula(comp); "." FOR j = 1 TO 3 IF CompElem(j, comp) > 0 THEN PRINT ElemName(CompElem(j, comp)); " has relative atomic mass"; ElemNucleons(CompElem(j, comp)); "." NEXT j PRINT "What is the relative molecular mass of "; CompName(comp); "?" INPUT choice ans = calcrmmcomp(comp) CALL mark(choice, ans) END SUB SUB rmmgrams DO cation = irand(nion) LOOP WHILE IonCharge(cation) < 0 DO anion = irand(nion) LOOP WHILE IonCharge(anion) > 0 gramspermole = calcrmm(cation, anion) moles = irand(6) / 2 grams = moles * gramspermole PRINT "The relative molecular mass of "; IonName(cation); " "; IonName(anion); " is"; gramspermole IF RND > .5 THEN PRINT "How many grams are there in"; moles; "moles of this compound" ans = grams ELSE PRINT "How many moles are there in"; grams; "grams of this compound" ans = moles END IF INPUT choice CALL mark(choice, ans) END SUB SUB rmmgramscomp comp = irand(ncomp) gramspermole = calcrmmcomp(comp) moles = irand(6) / 2 grams = moles * gramspermole PRINT "The relative molecular mass of "; CompName(comp); " is"; gramspermole IF RND > .5 THEN PRINT "How many grams are there in"; moles; "moles of this compound" ans = grams ELSE PRINT "How many moles are there in"; grams; "grams of this compound" ans = moles END IF INPUT choice CALL mark(choice, ans) END SUB