Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Can anyone help me with this question
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 MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
bartleby
Step by stepSolved in 5 steps with 5 images
Knowledge Booster
Background pattern image
Similar questions
- Is it fair to suggest that the rise in popularity of personal computers can be traced, at least in some measure, to the advent of the electronic spreadsheet?arrow_forwardWhat knowledge do you have about the philosopher Tollman?arrow_forwarddon't use others answer, show your work step by steparrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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