Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1 Introduction A fishing company, BaitFishing.com, is looking to implement a new

ID: 3610988 • Letter: 1

Question

1 Introduction
A fishing company, BaitFishing.com, is looking to implement a newscheme to pay its fisherman
employees. The fishermen each work for a maximum of 26 weeks attime. Currently, a fisherman
is paid a weekly salary according to average weight of the fish heor she caught during their last
expedition at $1/lbs. For example, if a fisherman caught 100 poundsof fish per week during their
last expedition, they would be paid $100 per week during theircurrent expedition.
Unfortunately, the fishermen are quite unhappy with their paymentscheme. The fishermen may
do extremely well several weeks of their expeditions but decide notto work on other weeks. This
results in a negative effect in their weekly salaries, even thoughthey may return with many pounds
of fish.

2 Problem
BaitFishing.com has proposed a new payment scheme for theirfisherman that you are to implement.
The company has agreed not to incorporate weeks that the fishermandecided not to work in computing the average weight of the caughtfish. However, as a compromise, the company will, instead,
drop both the smallest and the largest weight of sh caught in anexpedition before performing the
average calculation. The company will also decrease the pay rateper pound by 10%.
As an example, if fisherman Joe sailed on a 5 week expedition andcaught 1000, 32, -1, 743, and
432 pounds of fish each week, respectively, where -1 represents aweek Joe did not work, his weekly
salary would be $528.75.
3 Requirements
You are to write a complete C++ program to simulate the companysnew payroll scheme before it
is implemented in production. You will run the simulation for areasonable, predetermined amount
of runs (sample size). Your program will prompt the user for thename of a fisherman, perform the
simulation, and then return the following information:

The name of the fisherman.
The fishermans weekly pay.
The number of weeks of the fishermans last expedition.
The smallest discarded weight.
The largest discarded weight.

4 Implementation

Your program will be broken down into three parts, eachcorresponding to a separate source code
file, fish_driver.cc (containing at least the main function),fisherman.h (containing only the
declarations of functions which you are required to use to helpsolve the above problem), and
fisherman.cc (containing only the function definitions of thefunctions declared in fisherman.h):
Driver: Your driver program, i.e., the source codefile that will contain (at least) the main function,
will be called fish driver.cc. You may use standard C++ librariessuch as iostream,
cmath, cstring, etc. in your driver to solve the above problem. Youmust, however, also use
(and implement) a programmer-defined library of functions specificto this problem which is
described below.
Library Declaration: Your function library willconsist of a minimum of four functions whose
declarations will be stored in a header le named fisherman.h.Descriptions of these functions
and their parameters are listed as comments above the declarationsin this file.
Library Definition: Your function library will bedefined in a separate implementation file. One of
the function definitions (f catch, which generates data for thesimulation) has been provided
by me (in the file fish_generator.o) while the others (pack,search, and strip) are for you
to implement in an implementation file named fisherman.cc.
You may add any additional functions you deem necessary either toyour driver or fisherman
library but you must have at least the above listed functions. Thedriver will use the functions contained in the fisherman library,but in order to obtain access to these functions, the le
fish driver.cc must contain the following pre-compilerdirective:
#include ``fisherman.h''

/*
* Fisherman function library header life.
* CSE 230
* fisherman.h
*
* NOTE: @param is an abbreviation for "parameter."
*/
using namespace std;
/*
* Prototype for the pack function that extracts all the’-1’ values from
* the weight[] array.
* @param wt The array of weights.
* @param wt The size of the weight array.
* @param packed The resulting packed array.
* @param psize The size of the resulting packed array.
*
*/
void pack(const int wt[], const int wsize, int packed[], int&psize);
/*
* Raffi’s prototype for the catch function that generates thefisherman
* data.
* @param name The name of the fisherman in a array of chars.
* @param weight The resulting weights the fisherman caught.
* @param wsize The size of the weight array.
*
* *** THIS IS DONE FOR YOU ***
*/
void f_catch(const char name[], int weight[], int& wsize);
/*
* Prototype for the search function that searches the packed[]array for
* the largest and smallest values.
* @param smallest The index of the smallest value in packed[].
* @param largest The index of the largest value in packed[].
* @param packed The array of packed values.
* @param psize The size of the packed[] array.
*
* *** YOU IMPLEMENT ***
*/
void search(int& smallest, int& largest, const intpacked[], const int psize);
/*
* This next function takes the "output" of search (i.e., thelocations of the
* smallest and largest values), the array, and its size as inputand "fills in"
* a new array that does not include the smallest and largestelements as returned
* by "search()."
*/
/*
* Strips the smallest and largest locations of packed[] and
* stores the results in stripped[]
* @param packed The array to strip.
* @param psize The # of valid elements in packed.
* @param s_loc The index of the smallest value in packed.
* @param l_loc The index of the largest value in packed.
* @param stripped The resulting stripped array.
* @param s_size The # of valid elements in stripped.
*/
void strip(const int packed[], const int psize, const ints_loc,
const int l_loc, int stripped[], int& s_size);

Explanation / Answer

please rate - thanks (found this) you can fix the input if necessary   -- note the extraline of output #include #include using namespace std; int main() {string name; double salary; int max=0,min=0,total,weeks,n,hours[52],exp,i,j; coutn; for(i=0;i