{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

class_notes7

# Out i j k l m is is is is is 0000003 1000000 0000001

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: f", i %f", j %f", k %f", l %f\n", ); ); ); ); m ); return 0; /* indicate that program ended successfully */ } /* end function main */ Example Program Output Output for program on previous page: % a.out i j k l m % is is is is is 0.000003 1.000000 0.000001 -0.000003 230000.000000 Math Function Example Processes like burning coal result in the emission of sulfur dioxide into the atmosphere. Sulfuric acid is formed as a result and the resulting acid rain can damage the environment. The acidity of rain and lakes is measured using pH = − log10 (C ) where C is the concentration of hydronium ions in the water. A pH value of 7 indicates a neutral value, while levels below 7 indicate an acid and above 7 an alkaline or base. Math Function Example Algorithm: • input hydronium ion concentration • calculate pH • display results Hand calculation…consider input C = .0001 (mol/litre) pH = − log10 (.0001) = 4 Example Program: Compound Interest An investor plans to invest an amount of money p in an account with interest r (compounded...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online