// This program divides a user-supplied number by another
// user-supplied number. It checks for division by zero.
#include <iostream> using namespace std; int main() { double num1, num2, quotient; cout << "Enter a number: "; cin >> num1; cout << "Enter another number: "; cin >> num2; if (num2 == 0) cout << "Division by zero is not possible.\n"; cout << "Please run the program again "; cout << "and enter a number besides zero.\n"; else quotient = num1 / num2; cout << "The quotient of " << num1 << cout << " divided by " << num2 << " is "; cout << quotient << endl; return 0; }
Use exponential notation to express the number 385,500 to three significant figures.
In Example we saw that light entering a slab with parallel sides will emerge offset, but still parallel to the incoming beam. Our assumption was that the index of refraction of the material did not vary with wavelength. If the slab were made of crown glass , what would the outgoing beam look like?
Look up the details of the SecureRandom class that is defined in the java.security package. Could this class be used instead of the Random class? Why are random numbers important for cryptographic security?