Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question
Can anyone help me with this question
[画像:4 Two-Dimensional Arrays Use program Chart for Exercises 5-6, // Program Chart manipulates a two-dimensional array variable. #include <iostream> #include <fstream> using namespace std; const int ROW MAX = 8; const int COL_MAX = 10; typedef int ChartType [ROW MAX] [COL MAX]; void GetChart(ifstream&, ChartType, intá, int&); // Reads values and stores them in the chart. void PrintChart ( const ChartType, int, int); // Prints values in the chart to the screen. int main () ChartType chart; int rowsUsed; int colsUsed; ifstream dataIn; dataIn.open ("Chart.dat"); GetChart (dataIn, chart, rowsUsed, colsUsed); PrintChart (chart, rowsUsed, colsUsed); return 0; //** void GetChart(ifstream& data, ChartType chart, int& rowsUsed, int& colsUsed) // Pre: rowsUsed and colsUsed are on the first line of // file data; values are one row per line // beginning with the second line. // Post: Values have been read and stored in the chart. data >> rowsUsed >> colsUsed; for (int row - 0; row < rowsUsed; row++) for (int col = 0; col < colsUsed; col++) // FILL IN code to read and store the next value void PrintChart( const ChartType chart, int rowsUsed, int colsUsed) // Pre: The chart contains valid data. // Post: Values in the chart have been printed on the screen // one row per line. // FILL IN code to print chart by row for (int row = 0; row < rowsUsed; row++) { < colsUsed; col++) for (int col = n. // FILL IN int the next value Exercise 5: Read the documentation carefully and complete program Chart. Enter the following data in the file Chart.dat. 45 31415 23671 7888 8 9 8765 Show what is printed. Exercise 6: Add a function that prints the largest value in array variable chart. Rerun the program and show the result. ]
expand button
Transcribed Image Text:4 Two-Dimensional Arrays Use program Chart for Exercises 5-6, // Program Chart manipulates a two-dimensional array variable. #include <iostream> #include <fstream> using namespace std; const int ROW MAX = 8; const int COL_MAX = 10; typedef int ChartType [ROW MAX] [COL MAX]; void GetChart(ifstream&, ChartType, intá, int&); // Reads values and stores them in the chart. void PrintChart ( const ChartType, int, int); // Prints values in the chart to the screen. int main () ChartType chart; int rowsUsed; int colsUsed; ifstream dataIn; dataIn.open ("Chart.dat"); GetChart (dataIn, chart, rowsUsed, colsUsed); PrintChart (chart, rowsUsed, colsUsed); return 0; //** void GetChart(ifstream& data, ChartType chart, int& rowsUsed, int& colsUsed) // Pre: rowsUsed and colsUsed are on the first line of // file data; values are one row per line // beginning with the second line. // Post: Values have been read and stored in the chart. data >> rowsUsed >> colsUsed; for (int row - 0; row < rowsUsed; row++) for (int col = 0; col < colsUsed; col++) // FILL IN code to read and store the next value void PrintChart( const ChartType chart, int rowsUsed, int colsUsed) // Pre: The chart contains valid data. // Post: Values in the chart have been printed on the screen // one row per line. // FILL IN code to print chart by row for (int row = 0; row < rowsUsed; row++) { < colsUsed; col++) for (int col = n. // FILL IN int the next value Exercise 5: Read the documentation carefully and complete program Chart. Enter the following data in the file Chart.dat. 45 31415 23671 7888 8 9 8765 Show what is printed. Exercise 6: Add a function that prints the largest value in array variable chart. Rerun the program and show the result.
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education