Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the language is C++. please follow all instructions as seen. and follow the template. thanks! Problem: The Sangree Old Folks Home is in deep financial

the language is C++. please follow all instructions as seen. and follow the template. thanks! image text in transcribed
image text in transcribed
image text in transcribed
Problem: The Sangree Old Folks Home is in deep financial trouble and the owner, old Doc's Sangree, decides to go on a massive fundraising campaign. The local high school offers to help by sponsoring a dance marathon. Old Doc Sangree would like you to write a program to process the data gathered on the couples who will dance and their sponsors, Input: Every couple that dances is given a unique ID number. Each sponsor is asked how much they are willing to donate for each hour the couple dances and the maximum number of hours they are willing to pay for. Data: ID HRS Rate 0.80 117 141 161 2 2 .00 3.40 6 2.25 1.00 0.65 1.50 00 10.00 141 141 161 132 157 4 a) The first number is the ID number of the couple being sponsored (ID) b) The second number represents the maximum number of hours the sponsor is willing to pay for (HRS) c) The third number is a real value which gives the dollar per hour amount that the sponsor will donate (RATE). Output: The Old Doc would appreciate it if you printed out the following information: a. Read the input from an external input file. b. Sort the arrays in ascending order by couple ID; If there are several ID'S the same, the one with higher dollar per hour pledged should be first; print these assorted arrays (print ID, HRS, Rate). c Print an integer count for the number of sponsors followed by an integer count for the real number of couples, and then the real value which represents the total amount of money that will be collected assuming all couples dance the maximum number of hours). Print theses three numbers on one line. d. Print out each unique ID number, the total number of sponsors for that ID, and the total amount the couple will collect again assuming they all dance long enough to collect the full amount pledged). Print these three values on one line for each Unique ID. (These should already be sorted by ID). e. Find the couple who will earn the most money (if they all dance long enough), then print that couple's ID, the number of sponsors they have, and the total amount they will collect. Print these three numbers on the line. f. All output should start with proper headings. 8. Proper internal documentation. MUST use the concept of Object Oriented Programming in implementing the program. Must submit the following with all documents stapled. a. Documented program b. Raw Input c. Documented outputs based on the items 1 through 6 as mentioned in the Output class dancer int id, hrs; float rate; public: dancer(); void read_val(ifstream &); void print_val(ofstream &); void sort_by_id(dancer a[], int); void sort_by_rate(dancer a[], int); int couple_counter(dancer a[], int); void u_id(dancer all, ofstream &); float get_earnings (dancer a[], int); int get_id(); int get_hrs(); float get_rate(); float total_raised(dancer a[]); void swap(int, int, dancer a[]); void best_couple(dancer a[], ofstream &); }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Information And Database Systems Second International Conference Acids Hue City Vietnam March 2010 Proceedings Part 1 Lnai 5990

Authors: Manh Thanh Le ,Jerzy Swiatek ,Ngoc Thanh Nguyen

2010th Edition

3642121446, 978-3642121449

More Books

Students also viewed these Databases questions

Question

2. What are your challenges in the creative process?

Answered: 1 week ago