Repeat Practice Program 5 of Chapter 3, but use a loop so the user can convert other temperatures. If the user enters a letter other than C or F—in either uppercase or lowercase—after a temperature, print an error message and ask the user to reenter a valid selection. Do not ask the user to reenter the numeric portion of the temperature again, however. After each conversion, ask the user to type Q or q to quit or to press any other key to repeat the loop and perform another conversion.

This project uses loops to further enhance the program TemperatureConversionSelction developed in Chapter 3 (which enhanced FtoC developed in Chapter 2). A common error is to write the while control expression as an OR instead of an AND, so the loop does not end when either ‘Q’ or ‘q’ is entered. With an OR expression one or both sides of the expression will always be true (if ‘Q’ is entered, the variable quit is not equal to ‘q’, and vice versa); quit must be both not equal to ‘Q’ and not equal to ‘q’ to enter the loop.


See the code in TemperatureConversion.java.

Computer Science & Information Technology

You might also like to view...

The ________ member function reports when the end of a file has been found.

A) end() B) stop() C) done() D) eof() E) None of the above

Computer Science & Information Technology

Match each item with a statement below.

A. A snapshot of the state of the system at a point in time B. A group of individuals at an organization responsible for detecting, investigating, solving, and documenting computer security incidents C. A symbolic representation of a family of strings that can be generated from the expression D. The part of a cluster that is not used when a file is written to it E. A computer that is made deliberately vulnerable in order to make it attractive to hackers

Computer Science & Information Technology

You can use features on the Video Tools Playback tab to adjust how and when the video plays during the slide show.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

?What is the difference between a works cited list and a bibliography?

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology