Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a class LabCh05SumSubRect that will read information from a data file into a 2D array, as detailed below, and will then ask the user

image text in transcribed
image text in transcribed
Create a class LabCh05SumSubRect that will read information from a data file into a 2D array, as detailed below, and will then ask the user for four numbers specifying a sub- rectangle in the array, and will then compute and report the total of all the numbers in that region. Open an input data file named Data5-4 and read the number of rows and number of columns from the first line. Create a 2D array of double that has the required size (for the number of rows and columns given in the file) . Read all the numbers from the input file into the 2D array. . Ask the user for the first row, last row, first column, and last column of the sub-rectangle in the 2D array that they want to total. For example, they might enter 3 6 4 8 meaning they want to total the rectangular sub-region with rows 3 through 6 and columns 4 through 8. . If the values entered do not form a valid sub-rectangle, display an error message and halt

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions