Problem 1TF: 1. Mark the following statements as true or false.
a. An identifier must start with a letter and can... Problem 2MC Problem 3MC: Which of the following is not a reserved word in C++? (1) int include double const cin bool Problem 4SA Problem 5SA: 5. Are the identifiers quizNo1 and quiznol the same? (1)
Problem 6CP: 6. Evaluate the following expressions. (3, 4)
a. 25 + 4 - 7
b. 8/3
c. 13 / 3 * 6 - 10
d. 3 + 5 %... Problem 7CP: If int x = 10;, int y = 7;, double z = 4.5;, and double w = 2.5;, evaluate each of the following... Problem 8CP Problem 9SA: 9. Suppose that x, y, z, and w are int variables. What is stored in x, y, z, and w after the... Problem 10SA Problem 11SA: Which of the following are valid C++ assignment statements? Assume that i is an int variable, and x... Problem 12SA: Write C++ statements that accomplish the following. (6, 7) Declare int variables x and y. Initialize... Problem 13SA: Write each of the following as a C++ expression. (3, 4, 6) 9.0 divided by 5 times c plus 32. The... Problem 14SA Problem 15SA: Suppose x, y, and z are int variables and wandt are double variables. What value is assigned to each... Problem 16SA: 16. Suppose x, y, and z are int variables and x = 18, y = 5, and z = 4. What is the output of each... Problem 17SA: Suppose a and b are int variables, c is a double variable, and a = 25, b = 20, and c = 5.0. What is... Problem 18SA: 18. Write C++ statements that accomplish the following. (10)
a. Outputs the newline... Problem 19SA: Which of the following are correct C++ statements? (10) cout "Programming with C++!" endl; cout "... Problem 20SA: Give meaningful identifiers for the following variables and write a proper C++ declaration and... Problem 21SA: 21. Write C++ statements to do the following. (7,8, 10)
a. Declare int variables num1 and... Problem 22SA Problem 23SA: The following program has syntax errors. Correct them. On each successive line, assume that any... Problem 24SA Problem 25SA Problem 26SA: Preprocessor directives begin with which of the following symbol: (12) * # $ ! None of these. Problem 27SA: 27. Write equivalent compound statements if possible. (14)
a. x = x + 5;
b. x = 2 * x *... Problem 28SA: 28. Write the following compound statements as equivalent simple statements. (14)
a. x += 5 -... Problem 29SA: 29. Suppose a, b, and c are int variables and a = 7 and b = 2. What value is assigned to each... Problem 30SA: Suppose a, b, and sum are int variables and c is a double variable. What value is assigned to each... Problem 31SA Problem 32SA Problem 33SA Problem 34SA Problem 1PE: 1. Write a program that produces the following output:
In your program, substitute ??? with... Problem 2PE Problem 3PE Problem 4PE: 4. Repeat Programming Exercise 3 by declaring numl, num2, and num3, and average of type double.... Problem 5PE Problem 6PE Problem 7PE: 7. Write a program that prompts the user to input a decimal number and outputs the number rounded to... Problem 8PE Problem 9PE: 9. Write a program that prompts the user to enter five test scores and then prints the average test... Problem 10PE: 10. Write a program that prompts the user to input five decimal numbers. The program should then add... Problem 11PE: 11. Write a program that prompts the capacity, in gallons, of an automobile fuel tank and the miles... Problem 12PE: 12. Write a C++ program that prompts the user to input the elapsed time for an event in seconds. The... Problem 13PE: 13. To make a profit, a local store marks up the prices of its items by a certain percentage. Write... Problem 14PE: 14. (Hard drive storage capacity) If you buy a 40 GB hard drive, then chances are that the actual... Problem 15PE: 15. Write a program to implement and test the algorithm that you designed for Exercise 15 of Chapter... Problem 16PE: 16. A milk carton can hold 3.78 liters of milk. Each morning, a dairy farm ships cartons of milk to... Problem 17PE: 17. Redo Programming Exercise 16 so that the user can also input the cost of producing one liter of... Problem 18PE Problem 19PE: 19. Write a program that prompts the user to input the number of quarters, dimes, and nickels. The... Problem 20PE: 20. For each used car a salesperson sells, the commission is paid as follows: $20 plus 30% of the... Problem 21PE: 21. Newton's law states that the force, , between two bodies of masses and is given by:
in which... Problem 22PE: 22. One metric ton is approximately 2,205 pounds. Write a program that prompts the user to input the... Problem 23PE: 23. Cindy uses the services of a brokerage firm to buy and sell stocks. The firm charges 1.5%... Problem 24PE: 24. A piece of wire is to be bent in the form of a rectangle to put around a picture frame. The... Problem 25PE: 25. Repeat Programming Exercise 24, but the wire is to be bent in the form of a circle. In this... Problem 26PE: 26. A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose... Problem 27PE Problem 28PE: 28. In an elementary school, a mixture of equal amounts of nuts and dried fruit is provided during... Problem 29PE: 29. A contractor orders, say, 30 cubic yards of premixed concrete to construct a patio that is to... format_list_bulleted