A data file contains the names, departments, and salaries of the professors of a small college...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A data file contains the names, departments, and salaries of the professors of a small college named Marvel College. In this program we will work with an array of structures, up to maxp = 100. The structure will hold the following data fields: whole (a string), first (a string), mi (a single character), last (a string), department (a string) and salary (type integer). Perform the following steps: A) Create an initrec and use it to initialize the array. B) Each line in the data file contains the professor's whole name and the professor's department. Read in the entire name into whole (you MUST use getline after adapting the data file for your needs) and the salary. Output the name (whole),salary, and department (in that order) to the output file, using appropriate titles. *Hint: You will need to use the getline (filevar, string, delimiter); B) Sort the arrays by the Department, and print using appropriate titles. C) Code the statements to separate the first name, middle initial, and last name into the appropriate fields in the structure. D) Sort the arrays by last name. E) Print out the results in the form : last_name, first_name mi., followed by their salary. Determine and print the average salary for the college. XCredit: Convert the salary to a string, inserting commas where they would be for a number of that magnitude and a $ just before the first number. Print the data as in part E. Use the following data for your data file: John Q. Smith Sally Jo T. Handle Jorge G. Martinez Luke X. Skywalker Antonio M. Juarez Han D. Solo Exercise Science Geology Structural Engineering Metaphysics History Entreneurship Mathematics Education Anna Mae L. Pine Old M. McDonald Alice Q. Sanderson Jorge M. De La Rosa Kinesiology Santa X. Claus Philanthropy Agriculture Sciences Computer Science 56000 63500 127500 500000 40200 48700 55153 43000 87220 875234 1000000 A data file contains the names, departments, and salaries of the professors of a small college named Marvel College. In this program we will work with an array of structures, up to maxp = 100. The structure will hold the following data fields: whole (a string), first (a string), mi (a single character), last (a string), department (a string) and salary (type integer). Perform the following steps: A) Create an initrec and use it to initialize the array. B) Each line in the data file contains the professor's whole name and the professor's department. Read in the entire name into whole (you MUST use getline after adapting the data file for your needs) and the salary. Output the name (whole),salary, and department (in that order) to the output file, using appropriate titles. *Hint: You will need to use the getline (filevar, string, delimiter); B) Sort the arrays by the Department, and print using appropriate titles. C) Code the statements to separate the first name, middle initial, and last name into the appropriate fields in the structure. D) Sort the arrays by last name. E) Print out the results in the form : last_name, first_name mi., followed by their salary. Determine and print the average salary for the college. XCredit: Convert the salary to a string, inserting commas where they would be for a number of that magnitude and a $ just before the first number. Print the data as in part E. Use the following data for your data file: John Q. Smith Sally Jo T. Handle Jorge G. Martinez Luke X. Skywalker Antonio M. Juarez Han D. Solo Exercise Science Geology Structural Engineering Metaphysics History Entreneurship Mathematics Education Anna Mae L. Pine Old M. McDonald Alice Q. Sanderson Jorge M. De La Rosa Kinesiology Santa X. Claus Philanthropy Agriculture Sciences Computer Science 56000 63500 127500 500000 40200 48700 55153 43000 87220 875234 1000000
Expert Answer:
Answer rating: 100% (QA)
include include include include include include using namespace std const int maxp 100 struct Professor string whole string first char mi string last string department int salary Function to separate ... View the full answer
Related Book For
Statistics for Business and Economics
ISBN: 978-0132930192
8th edition
Authors: Paul Newbold, William Carlson, Betty Thorne
Posted Date:
Students also viewed these programming questions
-
This project is to acquaint you with fundamental UNIX commands and utilities when creating a multifunctional application. You will practice on managing shell variables, using shell operators,...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
For the network in the given figure, find the current, voltage, and power associated with R. Assume R = 25 k. 5 mA 10 + V 0.01V The current associated with 25 KQ is The voltage associated with 25 kQ...
-
Ebrahim Patel is a wholesaler who uses the periodic inventory system to account for inventory. Transactions for February: 1 Bought inventory from Rich Traders for R5 000 on credit. 2 Sold inventory...
-
What are the key differences between an advertising plan and an IMC plan?
-
It is January 2nd. Senior management of Baldwin meets to determine their investment plan for the year. They decide to fully fund a plant and equipment purchase by issuing 50,000 shares of stock plus...
-
3. BYSTANDER RULE The common law bystander rule holds that, generally, no one has a duty to assist someone in peril unless the bystander himself created the danger. Courts have carved some exceptions...
-
The following data were taken from the records of Blumbey Manufacturing Company for the fiscal year ended June 30, 2012. Instructions(a) Prepare a cost of goods manufactured schedule. (Assume all raw...
-
MIRR unequal lives Singing Fish Fine Foods has $1,800,000 for capital investments this year and is considering two potential projects for the funds Project 1 is updating the store's del section for...
-
Sukdev Basi funded an irrevocable simple trust in May 2008. The trust benefits Sukdev's son for life and grandson upon the son's death. One of the assets he transferred to the trust was Jetco stock,...
-
Can you write a memo to a coworker handling the case? Emily has operated her startup venture as a sole proprietorship since launching the business two years ago. David, a friend from college, has...
-
Looking to calculate the adjusting/eliminating journal entry while consolidating SBW and its subsidiary CDL. SBW owns 90% of shares in CDL that were purchased in 2018. Preparing consolidated books...
-
Alien Corp. is considering the purchase of a new truck which costs $14,340. The truck is expected to save $3,600 in operating costs annually for the next 7 years. How low can the annual cost savings...
-
You are the new project manager tasked with taking over for a projectmanagerwho left six weeks ago. Some of the numbers that you find in your initial research are as follows: A)Estimated project...
-
What defines acceptable range of variance for estimates in the cost management plan. 2. Which one describe the process to create the budget at completion. . WBS components .aggregation of activities...
-
fixed cost can be expressed as per-unit basis. Do you agree? Explain briefly why or why not?
-
(1 point) Write out the form of the partial fraction decomposition of the function: ????=?1058????????2+4????+4???????? Q = ? 5 10 8 x x 2 + 4 x + 4 d x Determine the numerical values of the...
-
The following selected accounts and normal balances existed at year-end. Notice that expenses exceed revenue in this period. Make the four journal entries required to close the books: Accounts...
-
The data file Earnings per Share shows earnings per share of a corporation over a period of 28 years. Compute a simple, centered 7-point moving average series for the corporate earnings data. Based...
-
The Mendez Mortgage Company case study was introduced in Chapter 2. A random sample of n = 350 accounts of the company's total portfolio is stored in the data file Mendez Mortgage. Consider the...
-
Find and interpret the coefficient of determination for the regression of DVD system sales on price, using the following data. Sales 420 380 350 400 440 380 50 420 Price 98 194 244 07 89 261 149 198
-
\(2,4,8,-2,-5\) Plot the integers on the same number line.
-
\(4,-2,10,0\) Plot the integers on the same number line.
-
\(7>-6\) Determine if the comparison is true or false.
Study smarter with the SolutionInn App