PROBLEMS 16 - 20 Lab Activity
PROBLEM16.CPP • Create a program to read a file (“data.txt”) with a set of numbers then the program will determine the odd numbers and even numbers in the file. Print the odd numbers in the file called “odd.txt” and even numbers in the file called “even.txt” (20 pts.)
PROBLEM17.CPP • Boardman College maintains two files—one for Sociology majors and another for Anthropology majors. Each file contains students’ ID numbers, last names, first names, and grade point averages. Each file is in student ID number order. • The college is merging the two departments into a Department of Sociology and Anthropology. Design the logic for a program that merges the two files into one file containing a list of all students, maintaining ID number order.
PROBLEM18.CPP • The Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patient’s first and last name, home address, and birth year. The records are sorted in ascending birth year order. Two doctors, Dr. Best and Dr. Cushing, have formed a partnership. • Create a program that produces a file of merged list of patients’ names in ascending order by birth year. • Create another file that it does not display patients’ names, but only produces a count of the number of patients born each year.
PROBLEM19.CPP • The MartinWeight Loss Clinic maintains a patient file, each record contains the name of a patient, its gender and current total weight loss in pounds. • Create a function that separates the client file to produce two files —one for male clients and one for female clients. • Each file is in descending weight loss order.
PROBLEM20.CPP • Create a file containing the following names, Social Security numbers, hourly rate, and hours worked. Eddie Vedder Scott Weiland Axl Rose Phil Anselmo
555-98-4182 555-53-2147 555-32-9826 555-09-4263
7.32 8.32 6.54 9.80
37 40 40 35
• Write a C++ program that reads the data file and computes and displays a payroll schedule. The output should list the Name, Social Security Number and Gross pay for every individual.