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
Program a: 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
passingreturning arrays
filling and printing a onedimensional array
filling and printing a twodimensional array
Specifications
You will create a class MyStubClass that is a beginning blueprint that will fill a grid 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
If two arguments are not passed in from the command line, your program should use constants defined below:
DEFAULTDIMENSION DEFAULTSEED
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 and seed L if not provided on the command line MyStubClassdimension: int, seed: long createPatternincrement: int : int setGridpattern : int : void getGrid : int setFinderxPos : int, yPos : int : void fillSquarestartX : int, startY : int, length : int, width : int, color: int : void helper method print : void printpattern : int : void printmatrix : 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, different times. Thank you.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
