|
|
|
|
|
|
|
|
void read(int[][COl],int&);
void read(ifstream& inf,int ary[][COl])
int&
? What is the purpose of the int&
?
|
|
10, 12, 81, 33, 53, 1, 34, 98, 1, 27, 98, 26, 52, 33 34, 49, 61, 55, 61, 15, 96, 43, 64, 79, 96, 61, 71, 80 83, 72, 79, 66, 53, 51, 30, 29, 27, 10, 73, 49, 53, 78 88, 31, 4, 22, 65, 17, 85, 56, 42, 84, 96, 75, 36, 56 96, 98, 32, 73, 35, 23, 42, 37, 24, 67, 86, 53, 5, 50 41, 81, 0, 32, 59, 88, 68, 40, 33, 7, 33, 70, 37, 55 39, 52, 96, 67, 26, 97, 45, 92, 32, 10, 5, 8, 25, 13 10, 12, 81, 33, 53, 1, 34, 98, 1, 27, 98, 26, 52, 33 34, 49, 61, 55, 61, 15, 96, 43, 64, 79, 96, 61, 71, 80 83, 72, 79, 66, 53, 51, 30, 29, 27, 10, 73, 49, 53, 78 88, 31, 4, 22, 65, 17, 85, 56, 42, 84, 96, 75, 36, 56 -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460 -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460, -858993460 |
int counter{}, ary[ROW][COl]{};
the output would be:10, 12, 81, 33, 53, 1, 34, 98, 1, 27, 98, 26, 52, 33 34, 49, 61, 55, 61, 15, 96, 43, 64, 79, 96, 61, 71, 80 83, 72, 79, 66, 53, 51, 30, 29, 27, 10, 73, 49, 53, 78 88, 31, 4, 22, 65, 17, 85, 56, 42, 84, 96, 75, 36, 56 96, 98, 32, 73, 35, 23, 42, 37, 24, 67, 86, 53, 5, 50 41, 81, 0, 32, 59, 88, 68, 40, 33, 7, 33, 70, 37, 55 39, 52, 96, 67, 26, 97, 45, 92, 32, 10, 5, 8, 25, 13 10, 12, 81, 33, 53, 1, 34, 98, 1, 27, 98, 26, 52, 33 34, 49, 61, 55, 61, 15, 96, 43, 64, 79, 96, 61, 71, 80 83, 72, 79, 66, 53, 51, 30, 29, 27, 10, 73, 49, 53, 78 88, 31, 4, 22, 65, 17, 85, 56, 42, 84, 96, 75, 36, 56 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
|
|
|
|
|
|
|
|
|
|
|
|
What was going on with my code |
1.2 3.4 |
|
|
1 |
|
|
1.2 3.4 |
The functions need to be in the format i have |
void read(int ary[][14], int& n)
Infile: 2021 15371.7 31660.1 1950.28 25420.3 26744.2 29213.9 8022.51 30317.7 12677.9 2430.61 14591.5 32974.8 17353.2 [...] |
|
|
I altered things via the video my professor uploaded |
|
|
|
|
|
|
|
|
double salesmen[ROW][COL];
. This is an uninitialized array and could produce a possible output of:Salesman ID 2021.00, 15371.70, 31660.10, 1950.28, 25420.30, 26744.20, 29213.90, 8022.51, 30317.70, 12677.90, 2430.61, 14591.50, 32974.80, 17353.20, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, -92559631349317830736831783200707727132248687965119994463780864.00, |
|
|
Salesman ID 2021.00, 15371.70, 31660.10, 1950.28, 25420.30, 26744.20, 29213.90, 8022.51, 30317.70, 12677.90, 2430.61, 14591.50, 32974.80, 17353.20, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, 0.00, |
|
|
IN this program is says I have to compute this year's monthly averages, but I only have one infile of data and thats last years monthly averages. How does one compute this years without any data? |
The format of the input file: ID JanSales Feb Mar …. Dec LastYrAvg |
2021 15371.7 31660.1 1950.28 25420.3 26744.2 29213.9 8022.51 30317.7 12677.9 2430.61 14591.5 32974.8 17353.2 |
The “Wild and Wooley” company has a large salesman staff and the company needs to gather info about the salesman’s yearly sales results. You have been tasked with this assignment. There are no more than 15 salesmen on staff and for each salesman the company has recorded for each month of the year, each salesman’s total monthly sales. Also recorded for each salesman is his ID and his last year’s average monthly sales. (The last number in the row) You are to compute for each salesman, this year’s average monthly sales. (uses the first 12 numbers). Since everyone generally has a bad month, and the company is nice, you will also calculate a second monthly average sales dropping his one worst monthly sales. (find the lowest monthly sales, add all 12 months sales and subtract the lowest then divide by 11) |
The information to be reported are the following: 1) Print out each salesman’s ID, his last year’s average monthly sales, the current year’s monthly sales, the current year’s average monthly sales minus his worst month all in a table format (columns, headers, ect.). 2) Also to show in the table are the salesmen who had a 10% increase for this year’s sales over last years. (use 12 month averages). These salesmen will be slated for a year in bonus. 3) Also, show my worst salesman whose two-year average is the lowest of all the salesmen, again to be shown in the table. |