As I suspected, the code you're referencing is from the National Fuel Gas Code. I was not able to find anything in National Electrical Code, or International Residential Code that mentions this in the context of electric appliances.
So this code only applies to gas water heaters, and only those that are not listed as flammable vapor ignition resistant (FVIR).
NFPA 54: National Fuel Gas Code 2015
Chapter 9 Appliance, Equipment, and Accessory Installation
9.1 General.
9.1.10 Installation in Residential Garages.
9.1.10.1 Appliances in residential garages and in adjacent spaces that open to the garage and are not part of the living space of a dwelling unit shall be installed so that all burners and burner ignition devices are located not less than 18 in. (460 mm) above the floor unless listed as flammable vapor ignition resistant.
A - Expansion tank. This prevents the pressure increase due to heating water, from damaging the plumbing. The tank is filled with air, that is separated from the water by a bladder. When the water expands due to heating, water compresses the air absorbing the pressure.
B - Check valve (or back flow valve). This is designed to only allow water to flow in one direction.
C - Thermostatic mixing valve. This allows hot and cold water to mix, so the water is not too hot. You can adjust this to make the water leaving the tank hotter or cooler. Note, the water can only be as hot as the water in the tank, so you'll also need to set the control knob to the proper temperature setting.
D - Ball valve (or quarter turn valve). Used to isolate expansion tank and turn off cold water to water heater.
E - Globe valve. Outlet to heating system.
F - Temperature and pressure relief valve (T&P valve). This is designed to open if the water temperature, or pressure in the tank gets too high.
G - Hose bib. Not sure what it's used for here.
H - Globe valve. Inlet from heating system.
I - Ball valve. Used to turn the gas supply on/off.
J - Temperature control. Used to set the desired temperature for hot water. Adjusting this will change the temperature to which the heater heats the water to.
K - Drain. This allows you to drain the tank.
L - Ball valve. Not sure what it's used for here.
Possibly shuts off cold water supply to heater, and/or other fixtures. If anything in this closet was a main shutoff, this would be it. Can't see where the plumbing goes, so can't tell if it only goes to the heater or splits to other fixtures.
M - Drip leg. This is used to catch any debris in the gas line, to prevent it from clogging the orifice.
N - Pilot view port. An opening where the pilot flame can be viewed from. Peek through here to see if the pilot is lit.
O - Burner cover. removing this would give you access to the main burner assembly.
It's not clear if any of these valves are the main shutoff.
You'll use a combination of the control knob and the thermostatic mixing valve, to set the temperature of the hot water delivered to the taps.
Best Answer
Virginia code regarding materials for water heater hookups doesn't get too specific but does to say to make sure you're in accordance with the water heater's manual.
I'm not sure what model you have but the instructions for a current Whirlpool electric water say CPVC is fine (see page 6, item 3). It also recommends compression fittings if you don't want to solder, but doesn't specifically prohibit Sharkbites.
Also the code is OK with CPVC. I took a look for something specifit to within 'X' distance of a water heater and didn't see anything. Here's the link for the code if you'd like to take a look yourself.
Expansions tanks are required if you have a Pressure reducing value (PRV) or backflow preventer. If you do not then there's no need for an expansion tank.
Local codes may superceed state codes, so check what your county & town say. If you call the inspector's office and set up a time to call and speak with an inspector, they should be happy to answer your questions. And if this was installed without a permit they'll be interested to hear about that as well probably. (And if it was installed with a permit it should have been inspected, which would mean it's fine).