Professional Documents
Culture Documents
1. Write a program that reads an integer value from standard input into a variable.
2. Assume that x is a float variable to be scanned. Write a statement that prints it out with exactly three
digits to the right of the decimal point no matter what how big its value is.
5. Write a program that reads the dimensions of room A (width and length) and the
dimensions of room B (width and length) into two other variables. Write a
single expression whose value is the total area of the two rooms AND print the final
value. Write a single expression whose value is the average area of the two rooms AND
print the final value.
6. Write programs called PrintPatternX.cpp (where X from A to D) to print EACH of the following
patterns. Use one "cout <<" for each line of outputs. End each line by printing an "endl"
7. Write a program called CircleComputation.cpp that asks the user for the radius of a
circle and compute its area and circumference.
8. Write a program called IntegerArithmetic.cpp that asks the user for two integers and
prints their sum, difference, product, and quotient.
9. Write a program called NumberofTrees.cpp that asks the user to enter two integers
(length and width) of a rectangular piece of land in meters. If you know that the tree
needs 2 m2. How many trees could be planted in the given land (the number of trees
could not be in decimal).