Posts

7. Program that allows the user to enter a floating-point number representing degrees Celsius, and then displays the corresponding degrees Fahrenheit.

12. Write the inverse of Exercise 10, so that the user enters an amount in Great Britain’s new decimal-pounds notation (pounds and pence), and the program converts it to the old pounds-shillings-pence notation.

11. Left-justify text output using the manipulator setiosflags(ios::left). Use this manipulator, along with setw(), to help generate the following output.

10. Program to convert the old pounds-shillings-pence format to decimal pounds.

9. Program that encourages the user to enter two fractions, and then displays their sum in fractional form.

8. Rewrite the WIDTH program so that the characters on each line between the location name and the population number are filled in with periods instead of spaces.

6. Program that allows the user to enter an amount in dollars, and the displays this value converted to other monetary units.

5. Program that allows the user to enter a letter, and then displays either zero or nonzero, depending on whether a lowercase or uppercase letter was entered.

4. Program that displays your favorite poem. Use an appropriate escape sequence for the line breaks.

3. Program that generates the following output: 10 20 19 Use an integer constant for the 10, an arithmetic assignment operator to generate the 20, and a decrement operator to generate 19.

2. Program that generates the following table using a single cout statement for all output.

1. Program that asks the user to enter a number of gallons, and then displays the equivalent in cubic feet.