Programming Projects require more problem-solving than Practice Programs and can usually be solved many different ways. Visit www.myprogramminglab.com to complete many of these Programming Projects online and get instant feedback.
Write a C++ program that reads in two integers and then outputs both their sum and their product. One way to proceed is to start with the program in Display 1.8 and to then modify that program to produce the program for this project. Be certain to type the first line of your program exactly the same as the first line in Display 1.8. In particular, be sure that the first line begins at the left-hand end of the line with no space before or after the #
symbol. Also, be certain to add the symbols \n
to the last output statement in your program. For example, the last output statement might be the following:
cout << "This is the end of the program.\n";
(Some systems require that final \n
, and your system may be one of these.)
Write a program that prints out “C S !” in large block letters inside a border of *s followed by two blank lines then the message Computer Science is Cool Stuff. The output should look as follows:
Write a program that allows the user to enter a number of quarters, dimes, and nickels and then outputs the monetary value of the coins in cents. For example, if the user enters 2 for the number of quarters, 3 for the number of dimes, and 1 for the number of nickels, then the program should output that the coins are worth 85 cents.
Write a program that allows the user to enter a time in seconds and then outputs how far an object would drop if it is in freefall for that length of time. Assume that the object starts at rest, there is no friction or resistance from air, and there is a constant acceleration of 32 feet per second due to gravity. Use the equation:
You should first compute the product and then divide the result by 2. (The reason for this will be discussed later in the book.)
Write a program that inputs a character from the keyboard and then outputs a large block letter “C” composed of that character. For example, if the user inputs the character “X,” then the output should look as follows:
X X X
X X
X
X
X
X
X
X X
X X X