tailieunhanh - Absolute C++ (4th Edition) part 5

Absolute C++ (4th Edition) part 5. KEY BENEFIT: C++ programming concepts and techniques are presented in a straightforward style using understandable language and code. KEY TOPICS: C++ Basics; Flow of Control; Function Basics; Parameters and Overloading; Arrays; Structures and Classes; Constructors; Operator Overloading, Friends, and References; Strings; Pointers and Dynamic Arrays; Separate Compilation and Namespaces; Streams and File I/O; Recursion; Inheritance; Polymorphism and Virtual Functions; Templates; Linked Data Structures; Exception Handling; Standard Template Library; Patterns and UML. MARKET: Useful for both beginning and intermediate C++ programmers. . | Programming Projects 4i Programming Projects 1. A metric ton is 35 ounces. Write a program that will read the weight of a package of breakfast cereal in ounces and output the weight in metric tons as well as the number of boxes needed to yield one metric ton of cereal. 2. A government research lab has concluded that an artificial sweetener commonly used in diet soda will cause death in laboratory mice. A friend of yours is desperate to lose weight but cannot give up soda. Your friend wants to know how much diet soda it is possible to drink without dying as a result. Write a program to supply the answer. The input to the program is the amount of artificial sweetener needed to kill a mouse the weight of the mouse and the weight of the dieter. To ensure the safety of your friend be sure the program requests the weight at which the dieter will stop dieting rather than the dieter s current weight. Assume that diet soda contains one-tenth of 1 artificial sweetener. Use a variable declaration with the modifier const to give a name to this fraction. You may want to express the percentage as the double value . 3. Workers at a particular company have won a pay increase retroactive for six months. Write a program that takes an employee s previous annual salary as input and outputs the amount of retroactive pay due the employee the new annual salary and the new monthly salary. Use a variable declaration with the modifier const to express the pay increase. 4. Negotiating a consumer loan is not always straightforward. One form of loan is the discount installment loan which works as follows. Suppose a loan has a face value of 1 000 the interest rate is 15 and the duration is 18 months. The interest is computed by multiplying the face value of 1 000 by yielding 150. That figure is then multiplied by the loan period of years to yield 225 as the total interest owed. That amount is immediately deducted from the face value leaving the consumer with only 775. .

TỪ KHÓA LIÊN QUAN