Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 . a method named fillArrayWithPrimes that takes as input parameter a file named ( String ) . the method will then open a file

1. a method named fillArrayWithPrimes that takes as input parameter a file named (String). the method will then open a file and try to read (1) a positive integer N ( for the size of the array) and (2) a positive double value p ( for the starting prime value). A warning message will be displayed if the file does not contain these values. The method will return an array size of N filled with primes starting from the value P. input parameters: the file name (String) output parameters: a 1d array of size containint primes of p2. a method named readtablefromfile to initialize a 2d square table with content form a given file name (string), they table size n (int) and two values for min and max (double). Then fill the table with N double values from the file. if there are less than N values form the file print out a warning message and the rest of the table should be filled with random double values from the {min.max} range. input: the file name(String) the table size N (int) min (double) and max (double) Output: a 2D table of size N x N as specified above 3. a method named findmaxrows to find the maximum value of each row in the table 4. a method named isXTable to chekc if the table is a x table - i.e., the values in each of the two diaganols ( top left > bottom right and top right > bottom left) of the table are sorted 5. a method named sortTable to sort the table using bubble sort 6. the main() function to prompt the user for the name of the input file produce the following output making calls to methods #1-5 the main() function will define two double constnts MIN_RANGE =-11.9 and MAX_RANGE =99.9, and then will read the first positive integer N from the file to be the size of the table. ( if there isnt any such positive integer N main() will print out a warning and exit the program)

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

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions