< previous page page_466 next page >

Page 466
MAY WE INTRODUCE
0466-01.jpg
Admiral Grace Murray Hopper
0466-01.jpg
From 1943 until her death on New Year's Day in 1992, Admiral Grace Murray Hopper was intimately involved with computing. In 1991, she was awarded the National Meda! of Technology for her pioneering accomplishments in the development of computer programming languages that simplified computer technology and opened the door to a significantly larger universe of users.
Admiral Hopper was born Grace Brewster Murray in New York City on December 9, 1906. She attended Vassar and received a Ph.D. in mathematics from Yale. For the next 10 years, she taught mathematics at Vassar.
In 1943, Admiral Hopper joined the U.S. Navy and was assigned to the Bureau of Ordnance Computation Project at Harvard University as a programmer on the Mark I. After the war, she remained at Harvard as a faculty member and continued work on the navy's Mark II and Mark III computers. In 1949, she joined Eckert-Mauchly Computer Corporation and worked on the UNIVAC I. It was there that she made a legendary contribution to computing: She discovered the first computer buga moth caught in the hardware.
Admiral Hopper had a working compiler in 1952, at a time when the conventional wisdom was that computers could do only arithmetic. Although not on the committee that designed the computer language COBOL, she was active in its design, implementation, and use. COBOL (which stands for COmmon Business-Oriented Language) was

(text box continued on next page)
Do-While Solution
do
{
    cout << Enter your age: ;
    cin >> age;
    if (age <= 0)
        cout << Your age must be positive. << endl;
} while (age <= 0);
Notice that the Do-While solution does not require the prompt and input steps to appear twiceonce before the loop and once within itbut it does test the input value twice.
We can also use the Do-While to implement a count-controlled loop if we know in advance that the loop body is always executed at least once. Below are two versions of a loop to sum the integers from 1 through n.

 
< previous page page_466 next page >