Question: 8 . 4 6 Program 1 0 a: Writing a class stub Instructor note: COMMAND LINE ARGUMENTS Introduction This lab uses things you're learning in

8.46 Program 10a: Writing a class stub
Instructor note:
COMMAND LINE ARGUMENTS
Introduction
This lab uses things you're learning in our introductory programming class. Some of those things are:
constants
random numbers
overloaded methods
passing/returning arrays
filling and printing a one-dimensional array
filling and printing a two-dimensional array
Specifications
You will create a class MyStubClass that is a beginning blueprint that will fill a grid (2-dimensional matrix) with values.
Required elements
MyStubClass class methods are instance methods. (That means that the word static is omitted from the method headers).
Your program will contain a main method that creates an instance of MyStubClass and calls its methods.
The dimension for the grid and the seed for the Random object must be passed in from the command line. See Section 18.3
If two arguments are not passed in from the command line, your program should use constants defined below:
DEFAULT_DIMENSION 30DEFAULT_SEED 150
Methods that return a value must pass unit tests that will not be made available for view, that is, those methods should be thoroughly tested by you prior to submitting your program.
Only the print methods may have output to standard out (the console).
Class members must conform to the UML diagram below:
================ Class Name ================ MyStubClass ============= Private Variables ============- grid : int[][]- dim : int - seed : long ============== Public methods ==============+ MyStubClass()// sets default values for dimension (30) and seed (150L) if not provided on the command line + MyStubClass(dimension: int, seed: long)+ createPattern(increment: int) : int[]+ setGrid(pattern : int[]) : void + getGrid() : int[][]+ setFinder(xPos : int, yPos : int) : void + fillSquare(startX : int, startY : int, length : int, width : int, color: int) : void // helper method + print() : void + print(pattern : int[]) : void + print(matrix : int[][]) : void
Method specifications
You will create an outline called a stub program where the method headers are the only implemented part of the class and all methods only return default values. You can get all the information you need from the UML outline above.
Do this for me and do it in the simplest way, 2 different times. Thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!