< previous page page_831 next page >

Page 831
11. Write a function that concatenates (joins) two strings into a third string. Use the declaration you wrote in Exercise 10.
12. You are writing a program to keep track of a manufacturing company's inventory. For each part, the following information needs to be stored:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Part number
Part name
Cost
Quantity
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Write a function and the necessary declarations to read in a variable of struct type Inventory.
Programming Problems
1. The MergeLists program merges three lists by merging two lists, and then merging the third list with the result of the merger of the first two. Another way of solving the same problem is to merge three lists at the same time, storing the result into a fourth list. Design a solution to the problem using this second strategy. Code your design in C++. Test your program thoroughly.
2. The Emerging Manufacturing Company has just installed its first computer and hired you as a junior programmer. Your first program is to read employee pay data and produce two reports: 1) an error and control report, and 2) a report on pay amounts. The second report must contain a line for each employee and a line of totals at the end of the report.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Input:
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Transaction File
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Set of five job site number/name pairs
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
One line for each employee containing ID number, job site number, and number of hours worked
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
These data items have been presorted by ID number.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Master File
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
ID number
Name
Pay rate per hour
Number of dependents
Type of employee (1 is management, 0 is union)
Job site
Sex (M, F)
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
This file is ordered by ID number.
3e26ecb1b6ac508ae10a0e39d2fb98b2.gif
Note:
1) Union members, unlike management, get time and a half for hours over 40. 2) The tax formula for tax computation is as follows: If number of dependents is 1, tax rate is 15%. Otherwise, the tax rate is the greater of 2.5% and
0831-01.gif

 
< previous page page_831 next page >